Metadata-Version: 2.5
Name: mcp-switchboard-hub
Version: 0.2.0
Summary: Aggregating MCP gateway for outbound tunnels, with a web console, call log, and Prometheus/Loki export
Project-URL: Homepage, https://github.com/AkosPapp/mcp-switchboard
Project-URL: Repository, https://github.com/AkosPapp/mcp-switchboard
Author: Akos Papp
License: MIT
Keywords: gateway,mcp,model-context-protocol,n8n,reverse-proxy
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: aiosqlite>=0.20
Requires-Dist: fastapi>=0.115
Requires-Dist: httpx>=0.27
Requires-Dist: mcp<3,>=2.2
Requires-Dist: prometheus-client>=0.20
Requires-Dist: uvicorn>=0.30
Requires-Dist: websockets>=12
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# mcp-switchboard-hub

The server half of [mcp-switchboard](https://github.com/AkosPapp/mcp-switchboard).

It accepts outbound WebSocket tunnels from machines running local stdio MCP
servers, speaks MCP to each tunnelled server, and re-serves every tool from one
place:

- **`/mcp`** — Streamable HTTP MCP endpoint for consumers (n8n, agents), also
  available scoped per machine (`/mcp/host/{label}`) or per server
  (`/mcp/host/{label}/server/{server}`).
- **`/`** — a web console to browse connections, servers and tools, call any tool
  by hand, and read back every call.
- **`/api/*`** — the JSON API behind the console.
- **`/metrics`** — Prometheus.
- Loki export and a SQLite call log.

## Running

```sh
pip install mcp-switchboard-hub
MCP_SWITCHBOARD_TUNNEL_TOKEN=... mcp-switchboard-hub
```

It listens on two ports on purpose: the tunnel endpoint (default
`127.0.0.1:8097`) is the only thing meant to face the internet and always
requires a bearer token, while the console, API, `/mcp` and `/metrics` live on a
second listener (default `127.0.0.1:8099`) that binds loopback and is
unauthenticated by default.

Everything is configured through `MCP_SWITCHBOARD_*` environment variables, read
from the environment or a `.env` file. Any value that starts with `/` and points
at an existing regular file is replaced by that file's contents, so secrets can
be passed as paths without separate `*_FILE` variables.

See the [main README](../README.md) for the full picture, and
[docs/PROTOCOL.md](../docs/PROTOCOL.md) for the tunnel wire format.
