MCPZERO SDK: expose your MCP server through the MCPZERO tunnel
Project description
mcpzero (Python)
Python SDK for MCPZERO (open source, MIT). Expose your own MCP server through the MCPZERO tunnel — a public Streamable-HTTP endpoint plus full dashboard visibility — directly from code, without the CLI.
pip install mcpzero-sdk # embedded proxy only
pip install "mcpzero[mcp]" # + in-process adapter for the official MCP SDK
Create an endpoint and a management key in the dashboard.
A management key is a user-level credential that lets the SDK publish (register a
tunnel for) any endpoint you own — the headless alternative to mcpzero login.
By convention they are read from MCPZERO_ENDPOINT_ID / MCPZERO_MGMT_KEY
(gateway base from MCPZERO_GW_BASE, default https://gw.mcpzero.io).
Not to be confused with an API key, which is the consumer-side credential AI clients use to call your published endpoint.
Tunnel an in-process MCP server (primary API)
Run your official mcp SDK server with its streams backed by the tunnel:
import asyncio
import mcpzero
from mcp.server.lowlevel import Server
server = Server("my-mcp")
# ... @server.list_tools() / @server.call_tool() ...
asyncio.run(mcpzero.serve(server, endpoint_id="ep_...", management_key="mzm_..."))
Or drive the streams yourself:
async with mcpzero.tunnel(endpoint_id="ep_...", management_key="mzm_...") as (read, write):
await server.run(read, write, server.create_initialization_options())
Tunnel a local MCP server (lower-level primitive)
A library version of mcpzero tunnel, for a server running as a separate
process or HTTP service:
# stdio:
handle = await mcpzero.tunnel_proxy(command=["python", "server.py"])
# or HTTP:
handle = await mcpzero.tunnel_proxy(url="http://localhost:3000/mcp")
print("Live at", handle.endpoint_url)
# ... later:
await handle.aclose()
Visibility
In tunnel mode, visibility is produced by the gateway automatically — the dashboard reflects calls exactly as it does for the CLI tunnel. No extra code is needed.
See ../PROTOCOL.md for the tunnel wire protocol.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpzero_sdk-0.1.1.tar.gz.
File metadata
- Download URL: mcpzero_sdk-0.1.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82578ca617f42e7d092f84e208adeeab700614688c0936fb533498923feaea77
|
|
| MD5 |
fdbab39b029548c45fbfb783a80a6473
|
|
| BLAKE2b-256 |
f83745c4f9c687be75c0c9d747a3b3c9fe42837feb2015d887d833f7491dc380
|
File details
Details for the file mcpzero_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcpzero_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b95891eb4cd230dbee51fa0e717e2db9d1b459a5eb8a0f9722ad62971c7d0b3f
|
|
| MD5 |
235a3a5a0d54544f875bbe19201f35ea
|
|
| BLAKE2b-256 |
efe8f5908ffeb05c1d9a0b71fbdaa68b92719ed44e6431986dbbb01b17b41ed4
|