MCP Token Optimization · Tool Discovery · Context Compression

Install 1,000 Tools & Skills.
Cut MCP Token Waste by 99.2%.

Zero config across 103+ coding agents. No resident background daemons.
mcptoon is a zero-dependency MCP CLI and MCP client for token optimization — tool discovery through a compact name index plus context compression, shrinking MCP tool context by 99.2% (72k → 581 tokens) and skill context by 99.9% (926k → 39 tokens), keeping tool schemas out of your context window.

−99.2%
MCP Tool Tokens (71,929 → 581)
−99.9%
Skills Resident Memory (926k → 39)
103+
Agents Out-of-the-Box (Zero Config)
$ pip install mcptoon && mcptoon quickstart
Calculate Your Savings Why a CLI, Not a Proxy? ↓

Why mcptoon is a CLI, Not Another Daemon Proxy

MCP was designed under the assumption that every capability must be a running daemon server that every agent explicitly mounts. That creates painful configuration drift.

Zero Overhead Architecture

The Resident Proxy Trap

  • Must hand-craft separate JSON configurations for Claude, Cursor, Windsurf, Cline...
  • Every agent launch requires restarting background proxies or fighting port conflicts
  • Dumps full parameter definitions into context before you even type your prompt
  • Adding a new tool means manually updating multiple config files all over again

The mcptoon CLI Architecture

  • Zero Config for 42 CLI/IDE Agents: Claude Code, Cursor, Codex, Zed just execute mcptoon call
  • One Single Config File: Add a tool or skill once via mcptoon; all agents immediately share it
  • No Daemons, No Memory Footprint: Pure Python standard library CLI (565KB). Executes and exits
  • Universal Fallback (61 GUI Apps): Non-shell GUI clients connect via a single lightweight mcptoon serve bridge
🛠️ MCP Tools Governance
On-Demand Schema Discovery

Instead of forcing 255 complete JSON schemas into prompt context before conversation starts, mcptoon indexes tools into names-only pointers.

Native vs mcptoon 71,929 → 581
−99.2%
Lossless Retrieval
🧠 Agent Skills Governance
Single Pointer & Offline BM25

Stop dumping hundreds of full SKILL.md files into agent memory. A single resident pointer plus an offline router resolves tasks in <5ms.

All Skills vs Resident Pointer 926,232 → 39
−99.9%
<5ms BM25 Match

Two Ways In — Zero Memorization

Whether you just chat with coding agents or script automation pipelines, mcptoon handles the plumbing.

🤖 Just Talk to Your Agent

When installed, mcptoon automatically injects its official skill (/mcptoon) into Cursor, Claude Code, Windsurf & DSH. You never need to remember CLI arguments — just talk directly:

• "Load /mcptoon and list all my active MCP tools."
• "Find an MCP tool that converts HTML to PDF."
• "How many tokens did mcptoon save for me today?"
Cursor Claude Code Windsurf Cline Codex Zed Roo Code +96 More

⚡ Terminal & Pipeline Power

Scriptable headless CLI with stable JSON output and an mcptoon serve bridge endpoint for local CI, containerized tasks, and air-gapped runtimes:

$ mcptoon manifest --format json
$ mcptoon skills resolve "write git commit" --k 5
$ mcptoon docs resolve "release gating"
$ mcptoon call everything echo '{"msg":"hi"}'
100% Python Standard Library 565KB Footprint No Daemon

Full-Spectrum Agent Governance

Everything your AI development workflow needs to stay fast, cost-efficient, and cleanly synchronized.

💰

Token & Context

  • -99.2% Schema Index: 72k tokens → 581 tokens name index
  • Lossless CCR Compression: Reversible truncation with handle retrieval
  • Session Output Deduplication: Blocks duplicate tool payloads
  • Real tiktoken Accounting: Measured with mcptoon bench
🛠️

Universal MCP

  • 17,000+ Registry Discovery: one search covers Smithery and the official MCP registry — 17,000+ servers behind a single command
  • Uniform CLI Execution: headless call from any language; the same catalog costs 71,929 tokens as full schemas and 581 as a name index (−99.2%, measured with tiktoken cl100k_base)
  • On-Demand Inspection: pull one schema instead of all of them — inspect <server> <tool> returns that tool only, so the other 70,000-plus tokens never enter the window
  • Diagnostic Doctor: self-heals stdio pipes and configs; every number above is reproducible on your own catalog with mcptoon bench, using the OpenAI tokeniser rather than a chars/4 guess
🧠

Skills Governance

  • Multi-Agent Sync: Claude, Cursor, Roo, OpenCode share one view
  • Resident Pointer: 926k tokens → 39 tokens pointer
  • Offline BM25 Router: <5ms matching, zero model API costs
  • Strict Version Gate: Blocks unversioned skill content drift
📚

Docs Routing Shield

  • Markdown Tree Indexing: Indexes large project guidelines
  • Targeted Chapter Feeding: Feeds 1 chapter instead of 19 chapters
  • Zero Vector DB Overhead: Pure local BM25 keyword engine
  • Context Tax Shield: Drops 40k doc tokens to 17k per lookup

What's New — Up to v0.8.30

Recent releases added a self-updating CLI, a background server, a zero-config demo, and a full set of lifecycle commands.

⬆️

Update & Serve

  • mcptoon upgrade: updates the installed CLI in place. upgrade --check is scriptable (exit 1 = a newer version exists), so updating the 565KB wheel needs no package manager at all.
  • serve --background: an HTTP bridge that outlives the terminal, with --status / --stop. This is the delivery mode that makes savings real — on a measured catalog the gateway path costs 640,606 → 905 tokens.
  • --install-autostart: opt-in logon start via a per-user Scheduled Task or a systemd user unit. Opt-in is deliberate: nothing runs in the background until you ask for it, which is why there is no daemon to babysit.
🎬

See It Instantly

  • mcptoon demo: spins up its own 11-tool server and shows before/after in ~10s, zero config
  • First-run card: leads with demo on an empty machine, so there is no dead end
  • Real-world proof: mcptoon bench measures your own catalog
🔌

More Protocols

  • openapi list|call: drives any REST / Swagger API as commands, on the same name-index discipline as MCP — the spec stays on disk and one operation is fetched at a time.
  • graphql list|call: the same shape for GraphQL endpoints; the schema is read once and cached, rather than re-sent on every turn.
  • auth login|creds|status: OAuth (PKCE, client-credentials and DCR) with tokens kept in the OS credential store, never in a config file that ships.
  • bake: saves reusable connections with secrets by reference only — the reason no credential is ever written into a generated file.
📊

Live Savings

  • statusline: a one-line savings badge, safe to run on every prompt — it reports the same 71,929 → 581 token cut the tables above measure, not a projection
  • activity / session: an honest log of what routed and how long it took, so any savings claim can be traced back to a real call
  • savings / credit / mode: milestones and the real delivery mode — mode exists because a fresh install sits in direct mode and saves 0% until the gateway is wired in
  • exec / kb: code sandbox and search inside docs — no daemon and no background process; the 565KB wheel runs and exits

Up and Running in 30 Seconds

Zero intrusive configuration rewrites. Instantly discover and synchronize across all installed agents.

01

Install mcptoon (565KB)

Pure pip install with standard library. Ready instantly on macOS, Linux, and Windows.

pip install mcptoon
02

Auto-Scan & Self-Install Skill

Discovers MCP configs and auto-distributes the official /mcptoon skill into all detected agents.

mcptoon quickstart
03

View Compact Tool Catalog (-99.2%)

Inspect your ultra-slim catalog. Schemas remain cached on disk until invoked.

mcptoon manifest
04

Route Skills or Guidelines (<5ms)

Pinpoint relevant skill playbooks or project docs without context flooding.

mcptoon skills resolve "write commit"

Independently Corroborated Findings

The MCP token & skill bloat problem is proven by third-party benchmark data.

−99.2%
Tool manifest tokens (71,929 → 581)
−99.9%
Skills context footprint (926k → 39)
103+
Supported Desktop & CLI Agents
0
External runtime dependencies

Skeptical of a synthetic 255-tool sample? The same ~99.9% saving holds on 7 real public MCP servers (209 tools) measured on a real machine — 640,606 → 905 tokens. Reproduce it with mcptoon bench on your own catalog.

Technical Specifications

CI-enforced guarantees. No hand-waved performance marketing.

Attribute mcptoon Standard Verification Method
Runtime Dependencies Zero (Standard library only, 565KB package) scripts/check_zero_deps.py enforced in CI
Token Measurement Standard OpenAI tiktoken cl100k_base Public benchmark fixtures in benchmark_data.json
Skill Routing Latency < 5 ms (Offline BM25 keyword matching) Local benchmark assertions in tests/test_skills.py
Agent Host Compatibility 103+ Clients (Claude Code, Cursor, Windsurf, Zed, Cline, Codex...) Automated end-to-end integration test matrix (42 CLI + 61 serve)
Result Compression TOON Compact Notation (~5.7% to 48.6% extra cut) Lossless round-trip assertion test suite
Supported Operating Systems Windows 10/11, macOS (Apple Silicon / Intel), Linux (glibc/musl) GitHub Actions cross-platform test runners

Frequently Asked Questions

Why is a CLI better than running a background proxy?

A background proxy still requires each AI agent to be manually configured with hostnames, ports, and headers. A CLI leverages the universal capability every coding agent already possesses: terminal execution. Agents call mcptoon call directly without any per-agent JSON setup, avoiding background memory leaks and port collisions entirely.

How does mcptoon handle both MCP tools and Agent skills?

mcptoon provides unified governance for both: for MCP tools, it indexes schemas into names-only pointers (cutting token cost 99.2%) and pulls parameters on-demand. For skills, instead of dumping hundreds of SKILL.md files into agent prompt memory, it installs a 39-token resident pointer and uses an ultra-fast offline BM25 router to pull only the matching skill playbook when needed.

Do I have to re-configure all my AI agents?

No. mcptoon quickstart automatically detects your installed agents (Cursor, Claude Code, Windsurf, Cline, etc.) and MCP servers, creating a single unified configuration and distributing the official /mcptoon skill into all of them. Add or remove tools in one place, and all agents immediately sync.

Does mcptoon send any telemetry or code to remote servers?

Never. mcptoon is 100% local, open-source under Apache-2.0, and contains zero dependencies. All indexing, token counting, and routing run entirely on your local machine.