Skip to main content

mcptoon

Install once — and every AI on your computer can use all of your AI tools.

It works like a power strip for AI tools: plug each tool in once, and Claude Code, Cursor, Codex — or any program that runs commands — can use them all. No config files, no plugins, no restarts. As a bonus, when an AI reads the tool list, it pays 99.8% fewer tokens than with raw JSON.

Technical version: mcptoon is a zero-dependency CLI that connects any agent to every Model Context Protocol server — whether or not the agent supports MCP.

PyPI Python CI Tests Dependencies License

English · 中文文档 · Changelog · Report an issue

mcptoon demo: install, add a server, sync to every agent, see the token savings

The part nobody else has: agents need zero setup

Native MCP means editing a JSON file for every agent, in every format, and restarting. Proxy tools mean running a service and pointing each agent at it.

mcptoon needs neither. It is a program your agent already knows how to run:

You:    "What tools do we have? Then fetch https://example.com and summarize."
Agent:  $ mcptoon manifest --compact        ← gets a name index, not schemas
Agent:  $ mcptoon call fetch fetch '{"url":"https://example.com"}'

No mcpServers entry. No plugin API. Nothing to register, nothing to restart. Want it automatic? One line in your agent's instruction file (CLAUDE.md / AGENTS.md / system prompt) is enough — that is prompting, not configuration.

This is also why mcptoon reaches where MCP cannot: shell scripts, CI pipelines, cron jobs, aider, terminal-only environments — anything that can execute a command.

Why mcptoon exists

How mcptoon works in one picture: before — one config per agent; install once; plug each tool in once; every AI can use them all

If you run more than one AI coding agent, you have both of these problems today:

1. Every agent keeps its own MCP config, in its own file, in its own format.

Agent Config file
Claude Desktop claude_desktop_config.json
Claude Code .claude.json
Cursor .cursor/mcp.json
Cline / Windsurf / VS Code Copilot various JSON, various shapes

Add a server in Cursor, forget Claude. Fix a path in Claude, break Cursor. Repeat weekly.

2. Tool discovery burns your context window before any work starts. A listing of 255 tools costs 71,929 tokens as raw JSON schemas (measured with tiktoken cl100k_base). On a 128K context, that is more than half the window spent on syntax — before the model has answered anything.

mcptoon fixes both with one file and one binary.

Try it in 60 seconds

pip install mcptoon        # pure stdlib, ~250KB, no deps

mcptoon quickstart         # finds servers you already configured, lists their tools
mcptoon demo               # live side-by-side: JSON vs mcptoon, real token counts

quickstart detects existing configs, imports them, and shows what you have. demo spins up a sample fetch server and prints the before/after numbers on your machine — no trust required, measure it yourself.

Runs on Windows, macOS and Linux. Being pure Python makes Windows a first-class citizen — no node-gyp builds, no POSIX-only scripts.

The three moves

1 · Configure once — sync

mcptoon add fetch --stdio npx -y @modelcontextprotocol/server-fetch
mcptoon sync               # writes native config to every detected agent

mcptoon merges instead of overwriting — servers you configured manually stay put. One command gives you cross-agent tool management: a single source of truth for MCP servers across every agent on the machine, no copy-pasting JSON between Cursor, Claude and friends.

mcptoon sync --dry           # preview the writes
mcptoon sync --agent cursor  # target one agent

2 · Pay for names, not schemas — manifest

Your agent asks "what tools exist?" mcptoon answers with a name index. Schemas stay on disk in ~/.mcptoon/config.json and never enter the context.

$ mcptoon manifest --compact
fetch: fetch(url) · github: search_repos(q), get_file(repo, path) · sqlite: query(sql) · ...
Tool listing (tiktoken cl100k_base) tokens vs raw JSON
Raw JSON schemas, 255 tools 71,929
--slim (names + parameter types) 8,282 −88.5%
--compact (names only) 123 −99.8%

In human terms: 71,929 tokens is roughly a 300-page book. 123 tokens is a sticky note.

Choosing between approaches? docs/comparison.md breaks down setup cost, token cost and safety, category by category.

It is a dial, not a switch: --json is always available when you want zero ambiguity, and call results default to plain text, security-checked.

3 · One door in front of every server — serve

Point your agent at a single entry instead of N servers:

"mcptoon": { "command": "mcptoon", "args": ["serve"] }
mcptoon serve                  # stdio — one agent
mcptoon serve --listen :8080   # HTTP — multiple agents, remote machines

Parallel manifest loading (20 workers, 100 servers ≈ 5s), a 5-minute schema cache, and a 30s timeout per call so one hung server cannot stall your session.

Everything else in the box

Command What it does
mcptoon call <server> <tool> '{…}' Call any tool on any server
mcptoon call --auto <tool> '{…}' Route by tool name, server found for you
mcptoon health Which servers are alive, dead, and how fast — exits 1 in CI if anything is dead
mcptoon install <name> --npm <pkg> Install a server, auto-discover tools
mcptoon search <query> Fuzzy search across every tool you have
mcptoon doctor Self-diagnose Python, config, connectivity

Why health matters: a 2026 community audit found 52% of published MCP servers unreachable. Configured ≠ alive.

── mcptoon health: 3/5 alive ──────────────
  ✓ fetch     [stdio]  1 tool     120ms  ok
  ✗ brave     [stdio]  0 tools  10002ms  timeout → Timed out after 10s
  ✓ github    [http]  12 tools    340ms  ok

Under the hood

  • Errors that agents can act on — every failure returns a structured envelope with a fix suggestion ("server fetchh not found — did you mean fetch?"), so your agent self-corrects instead of stalling until you rescue it.
  • Cross-server fuzzy searchmcptoon search star finds the right tool across every configured server, with relevance scoring.
  • call --auto — give just the tool name; mcptoon finds the server that provides it.
  • Shell completions — bash, zsh, fish and PowerShell.
  • JSON or TOML config — whichever reads better for you, both live in ~/.mcptoon/.
  • Local usage log — see which tools you called and when. The record never leaves your machine.

Security, applied to every call

Supply-chain safety comes free with zero dependencies: no npm subtree, no postinstall scripts, nothing to audit but ~6,800 lines of readable Python.

MCP servers run code on your machine and return arbitrary text into your agent's context. mcptoon inspects every result before it gets there:

Check Blocks
Prompt injection "ignore previous instructions" buried in tool output
Credential leak sk-…, AKIA…, ghp_… patterns in tool output
Dangerous operations delete / drop / purge tool names unless you pass --destructive

No telemetry. No analytics. No phone-home. API keys pass through from your config or environment and are never stored by mcptoon.

Works with

Claude Desktop · Claude Code · Cursor · Cline · Windsurf · VS Code Copilot · Codex · Gemini CLI · OpenCode — plus aider, shell scripts, CI jobs and anything else that executes commands, including environments with no MCP support at all. That is what being a CLI first means.

How is this different from raw configs or tool-search proxies?
Per-agent configs Tool-search proxies mcptoon
Agent-side setup edit JSON per agent + restart run a service, point agents at it none — it is just a command
Files to maintain one per agent one per agent one, synced everywhere
Discovery cost full schemas search first, load on demand name index, schemas never leave disk
Dead-server detection varies built-in, CI-friendly exit codes
Output inspection varies injection + leak checks on every call
To adopt native support run a service pip install mcptoon

They also compose: serve mode gives you the proxy shape when you want it.

Honest limitations

Honest limitations

  • --compact lists tool names only — no descriptions or parameter details. When the model needs signatures, use --slim. When it needs everything, use --json.
  • Token counts above were measured with tiktoken cl100k_base. Other tokenizers differ (typically ±10–25% on these payloads). The main saving — schemas not entering context at all — is tokenizer-independent.
  • Each stdio call spawns a process (~300 ms cold). Hot paths should use serve mode; the schema cache absorbs repeated listings for 5 minutes.
  • Terminal-first. There is no GUI.
FAQ

FAQ

Isn't this just compression? No. Compression ships the full payload into context and unpacks it later — the cost still lands in the window eventually. mcptoon keeps schemas on disk; they never enter the context at all. What the agent sees is a short index of names.

Claude Code already defers MCP tool loading — isn't this redundant? Deferred loading decides when definitions load. mcptoon decides how much a listing costs, in every agent at once, and adds sync, health, and security on top. They solve different layers and stack fine together.

Why a CLI instead of a library or proxy? Because the shell is the one interface every agent already speaks. No plugin API, no SDK, no per-agent config file, no service to keep alive — and agents that don't support MCP at all can still drive every MCP server through it. Prefer long-lived connections? mcptoon serve is the same tool in proxy form, stdio or HTTP.

Are the savings from tricks like replacing null with symbols? No — that misconception comes from earlier TOON-style experiments. The headline number comes from architecture: full schemas simply aren't sent. Optional --toon encoding of tool results saves a further ~30–40%, and it is off by default.

For developers

from mcptoon.client import MCPClient

with MCPClient(stdio=["npx", "-y", "@modelcontextprotocol/server-fetch"]) as c:
    tools = c.list_tools()
    result = c.call_tool("fetch", {"url": "https://example.com"})
git clone https://github.com/activeing123/mcptoon.git && cd mcptoon
pip install -e . --no-build-isolation && pip install pytest
python -m pytest tests/ -v          # 531 tests, green expected
docker run --rm -v ~/.mcptoon:/root/.mcptoon mcptoon manifest --compact

Zero third-party imports is a hard rule enforced in review. New features need tests. ~6,800 lines of Python across 14 modules — see CONTRIBUTING.md.

License

Apache 2.0 — see LICENSE and NOTICE.

Independent third-party client for the Model Context Protocol. Not affiliated with Anthropic, Cursor, or Microsoft.

If mcptoon saved you tokens today, a ⭐ helps other people find it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcptoon-0.5.5.tar.gz (129.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcptoon-0.5.5-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

Details for the file mcptoon-0.5.5.tar.gz.

File metadata

  • Download URL: mcptoon-0.5.5.tar.gz
  • Upload date:
  • Size: 129.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for mcptoon-0.5.5.tar.gz
Algorithm Hash digest
SHA256 d5f65219f734d017ecb04abec3e5aff612ad280ea613bda57c7d83cebf3f2d7c
MD5 5086c3cb61d03619dd85cfed84af1a35
BLAKE2b-256 2f9d7db206d118a2547e2755402365044b2dba9d8813fd8294ba77f40a7db3c1

See more details on using hashes here.

File details

Details for the file mcptoon-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: mcptoon-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 102.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for mcptoon-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 67bbda0b0dfb20360d3c1b2235994faec62981d1d826268cca26f5b82d767f42
MD5 f74cda6704e2c0be50bff8139123d682
BLAKE2b-256 be1601024c29a97e49dbd0650bfe5184926f00e675993ba2251af21f1edd4821

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.5 This release

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page