# What do your MCP tools cost your agent before it starts?

> Source: <https://github.com/Egoushka/switchboard>
> Published: 2026-12-02 01:59:55+00:00

**Key takeaway:** Fronting many MCP servers with a 5-tool search/describe/read/write/more gateway cut tokens 82.9% on 10 recorded tasks, and a run(code) scope that chains read tools and returns only the final value saves further context.

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.

``` php
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 add`run(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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/measurement.md) ).
- **Config decides what reads.** A tool is`read` only if the config says so. A server with no entry is all`write` , and a`destructiveHint` always forces`write` .
- **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 JMESPath`query` 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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/index.md#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](https://docs.astral.sh/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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/quickstart.md) 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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/how-it-works.md) 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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/status.md) | 
| 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](https://github.com/Egoushka/switchboard/blob/main/docs/guide/measurement.md); `--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%)
```

- [Overview](https://github.com/Egoushka/switchboard/blob/main/docs/guide/index.md) : who it is for, the tools, limits, status
- [Quickstart](https://github.com/Egoushka/switchboard/blob/main/docs/guide/quickstart.md) : the smoke stack, step by step
- [Deploy](https://github.com/Egoushka/switchboard/blob/main/docs/guide/deploy.md) : config, environment, container, routing clients, measuring the savings
- [Approvals](https://github.com/Egoushka/switchboard/blob/main/docs/guide/approvals.md) : what the approver sees, what the agent gets back, the audit log
- [How it works](https://github.com/Egoushka/switchboard/blob/main/docs/guide/how-it-works.md) ·[Reference](https://github.com/Egoushka/switchboard/blob/main/docs/guide/reference.md) ·[Status and evidence](https://github.com/Egoushka/switchboard/blob/main/docs/guide/status.md)
- [Changelog](https://github.com/Egoushka/switchboard/blob/main/CHANGELOG.md)

<sub>Made by [Yehor Hrabovskyi](https://hrabovskyi.online) · [MIT licence](https://github.com/Egoushka/switchboard/blob/main/LICENSE).</sub>
