activeing123/mcptoon

View on GitHub ↗

Token-efficient MCP CLI client. 97% less tokens on tool discovery, 40-60% on results. Zero deps. Cross-platform. Works with every AI agent.

172 ★5 forksPythonUpdated 18d ago

What you need to know

A zero-dependency CLI MCP client that sits between shell-capable AI agents and any number of MCP servers, keeping tool schemas out of context and returning results 30-97% smaller than JSON via TOON encoding.

Install

pip install mcptoon

Usage

  • Add servers one command each: mcptoon add fetch --stdio npx -y @modelcontextprotocol/server-fetch.
  • List tools without polluting context: mcptoon manifest --compact (or --slim / --toon).
  • Call a tool: mcptoon call fetch fetch '{"url":"https://example.com"}' --toon.
  • Agents share one config (~/.mcptoon/config.json) across all agents; use mcptoon quickstart for one-command onboarding.

Key features

  • Tool schemas never enter the agent context — compact mode is 98.5% smaller than JSON (tiktoken-verified).
  • One config file shared by every shell-capable agent; delete mcptoon and your servers keep running.
  • Built-in dangerous-op, prompt-injection, and credential-leak guards.
  • Zero third-party imports (~200KB), no telemetry, no credential storage.
  • Python API with a round-trip-safe TOON codec; auto-discovery via quickstart/init.

Best for

Users running many MCP servers across multiple shell-capable agents who want to stop context-window bloat.

Caveats

  • NOT an MCP server — it does not plug into mcpServers JSON and works only with shell-capable agents (Claude Code, Codex, Cursor, OpenCode, etc.).
  • Does not replace native MCP config in Cursor or Claude Desktop, and exposes no MCP JSON-RPC endpoint.
  • --fallback-json only catches encoding-level errors, not whether the LLM parsed the output correctly.
  • Destructive ops (delete/drop/purge) are blocked by default unless --destructive is passed.
Platforms: macOS · Linux · WindowsClients: Claude Code · Codex · Cursor · OpenCode

Reviewed 2026-08-18

Topics

agent-toolsaiai-agentclaudeclicodexcursordeveloper-toolsllmmcpmcp-climodel-context-protocolpythonstdiotoken-efficienttoken-optimizationzero-dependencies
Stars
172★
Forks
5
Language
Python
License
Apache-2.0
Created
2026-07-27
Last push
2026-08-18