One MCP front door to every tool behind your gateway: agents see five tools instead of hundreds, and every write waits for a tap on your phone.

Parked. It works; I am not changing it now and may come back.

flowchart LR
  agent[AI agent] -- "search · describe · read · write · more" --> sb[switchboard]
  sb -- one session per scope --> gw[agentgateway]
  gw --> s1[GitHub MCP]
  gw --> s2[Telegram MCP]
  gw --> s3[... every other MCP server]
  sb -- "write? show every argument" --> tg[Telegram bot]
  tg -- Approve / Deny --> sb

An agent connected to every MCP server I run reads hundreds of tool definitions before it reads the task, and any one of those tools can change something. I wanted the agent to look tools up instead of carrying them all, and I wanted a person, not the tool's own description of itself, to decide what may write.

  • Five tools instead of hundreds.search finds a tool,describe returns its arguments,read runs it,write runs it after approval,more pages a long result. A scope can addrun(code) : a script chains read tools

and only its final value reaches the agent's context: 82.9% fewer tokens on 10 recorded tasks (how it was measured, and its limits ).

  • Config decides what reads. A tool isread only if the config says so. A server with no entry is allwrite , and adestructiveHint always forceswrite .
  • Approvals you can trust. Each write shows every argument on Telegram, with zero-width and bidi characters

printed as visible escapes. Approvals are single-use, bound to exactly the arguments shown, denied on timeout and refused when Telegram is unreachable.

  • Small results. Nulls dropped, an optional JMESPathquery applied, the first page capped at 6,000 characters.
  • An audit line per write , before and after the call, with a hash of the arguments, never the arguments.

Not here: client keys and allow-lists (the gateway owns them), stdio transport, more than one approver, anything on disk. What it does not do has the full list.

Warning

pip install switchboard installs an unrelated PyPI project. Use the container image or a clone.

Runs the smoke test CI runs: switchboard between a real agentgateway and a fake MCP server, with a fake Telegram approver. Needs Docker with Compose and uv.

git clone https://github.com/Egoushka/switchboard.git && cd switchboard
uv sync && uv run pytest
docker build -t switchboard:dev .
docker compose -f tests/smoke/compose.yaml up -d
uv run python tests/smoke/check.py

The quickstart guide explains each step and what the output means.

Each scope in the config is an MCP endpoint at /mcp/<scope> holding one long-lived session to a gateway route. search ranks that route's tools with BM25 over server name, description and tool name. write sends the tool, its arguments and the agent's reason to Telegram and runs the call once if Approve arrives before the timeout (50 s by default). An approved call runs to the end even if the client gives up. How it works follows one request through every part.

| | Value | Source | |---|---|---| | Tools an agent sees | 5 (4 in a read-only scope) | test_integration.py checks both lists | | Tests | 91, all offline, plus a smoke test against a real agentgateway | status | | Users | 1, me | counted |

uv run switchboard measure [config.json] reads your MCP client config (Claude Code, Claude Desktop, Cursor, OpenCode or a plain mcpServers file), connects to every server and prints what its tools cost an agent before it does anything, against the same tools behind switchboard. Tokens are characters / 4 of name, description and input schema, the estimate of measurement; --json prints the same as JSON. A server that cannot be reached is listed with its reason and does not fail the run; header values and secrets in env vars never print. Sample, on the author's own setup:

server            tools    tokens
homelab-infra        60    15,793
context7              2     1,279
roslyn                0         0
homelab-memory       47    17,781
homelab-langfuse     53    12,657
prompts-chat         17     5,051
switchboard           5     1,346
total               184    53,908

Heaviest tools:
    2,252  hindsight_create_mental_model (homelab-memory)
    2,109  hindsight_create_page (homelab-memory)
    2,057  hindsight_update_page_node (homelab-memory)
    2,040  hindsight_update_mental_model (homelab-memory)
    1,521  langfuse_listObservations (homelab-langfuse)

Behind switchboard:
  5 tool definitions (search, describe, read, write, more) with your server list: 564 tokens
  a typical search result: 215 tokens
  before the first call: 779 tokens, against 53,908 now (saving 98.6%)

<sub>Made by Yehor Hrabovskyi · MIT licence.</sub>

原文来源:github.com