mcp-diet
Can proxy an existing GitHub MCP server, lazily indexing and exposing its tools for search, describe, and call operations while trimming large GitHub responses and caching oversized payloads for JSON path reads.
Can proxy an existing Sentry MCP server, enabling lazy tool discovery and invocation with response trimming and spillover cache reads for large Sentry outputs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-diet search tools for listing GitHub issues and show the latest 5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Lazy MCP meta-proxy, response trimmer with spillover cache, and token-tax auditor.
Works with Claude Code, Cursor, Windsurf, Codex CLI, and Antigravity.
Every MCP server you enable dumps its full tool schemas into the prompt before turn one. Connect three or four servers (GitHub, Postgres, browser automation, Sentry) and an agent starts the session with 10,000 to 35,000 tokens already spent on JSON parameter definitions it may never call. Then one list_issues or SQL dump adds another 10,000 tokens of raw JSON.
mcp-diet sits in front of your existing stdio MCP servers and exposes four small tools costing 516 tokens total: search_tools, describe_tool, call_tool, and read_cached_output. Upstream servers stay stopped until an agent actually calls one of their tools, and oversized outputs are trimmed into a local LRU spillover cache that supports JSON dot/bracket path reads.
Measured benchmark
Reproduce these numbers on your machine with node ./bin/mcp-diet.mjs benchmark --markdown (3 mock stdio servers exposing 60 realistic tools, estimated at bytes / 3.8 chars per token):
Server | Tools | Startup Tokens | Status |
| 20 | 3,824 tok | ok |
| 20 | 3,083 tok | ok |
| 20 | 3,015 tok | ok |
Direct total (3 servers) | 60 | 9,922 tok | zero-turn context cost |
With mcp-diet | 4 | 516 tok | -94.8% saved |
Measurement | Before | After | Reduction |
Startup schemas (60 tools across 3 MCPs) | 9,922 tok | 516 tok | -94.8% |
Large tool output ( | 9,576 tok | 609 tok | -93.6% |
Related MCP server: veriloop
Quick start
Requires Node.js >= 22.5.0 with zero npm packages to install.
1. Audit your current MCP token tax
mcp-diet audit discovers MCP configs from mcp-diet.json, .mcp.json, .cursor/mcp.json, Antigravity, Codex, and Claude Desktop, then measures the schema cost of every server:
npx -y github:keenfolk1-lgtm/mcp-diet audit2. Wrap your config
Generate a standalone mcp-diet.json backend file and a wrapped editor config pointing to mcp-diet:
npx -y github:keenfolk1-lgtm/mcp-diet wrap --from ./.mcp.json --writeOr run mcp-diet directly in any client (claude mcp add mcp-diet -- npx -y github:keenfolk1-lgtm/mcp-diet serve --config ./mcp-diet.json) or with mcp.json:
{
"mcpServers": {
"mcp-diet": {
"command": "npx",
"args": ["-y", "github:keenfolk1-lgtm/mcp-diet", "serve", "--config", "./mcp-diet.json"]
}
}
}3. Verify the local setup
node ./bin/mcp-diet.mjs doctorProxy tools
Tool | Purpose |
| BM25 search across upstream tool names, descriptions, and argument keys. |
| Returns the full |
| Spawns the target upstream server lazily, executes the call, and trims large payloads. |
| Reads a specific JSON path (such as |
Protocol and config details
mcp-diet supports both newline-delimited JSON-RPC and Content-Length framed stdio servers, expanding ${ENV_VAR} placeholders in configured server env blocks at spawn time. Responses above trimThresholdChars (default 6000 characters) are stored in an in-memory 50-slot LRU cache and summarized in place (JSON arrays collapse to total count, item keys, first 2 items, and last item). Pass raw: true to call_tool when you need an untrimmed response.
Limitations
mcp-diet manages stdio MCP servers (command + args) and skips remote SSE or Streamable HTTP server entries during config discovery. The spillover cache lives in process memory for the lifetime of the proxy session, so cacheId handles expire when the proxy restarts. Indexing upstream catalogs on the first search_tools call starts each enabled server once to fetch tools/list, then closes idle connections until call_tool invokes one.
License
Related tools: skill-guard · blast-radius-mcp · flight-recorder-mcp · agent-undo · dotagents
Available Tools
4 toolscall_toolB
Execute an upstream MCP tool lazily and trim oversized JSON or log payloads with an automatic spillover cacheId.
Inputs: tool (required), raw, arguments.
describe_toolA
Return the exact parameter schema for one upstream tool (pass 'server:tool' or a unique tool name) before calling it.
Inputs: tool (required).
read_cached_outputA
Inspect a trimmed upstream payload stored in the spillover cache by JSON dot/bracket path or character slice.
Inputs: cacheId (required), path, limit, offset.
search_toolsA
Search configured upstream MCP tools by keyword or capability without loading every full JSON schema into context.
Inputs: query (required), limit, server.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool occupies a distinct stage of the lazy-invocation workflow: discovery (search_tools), inspection (describe_tool), execution (call_tool), and post-execution inspection (read_cached_output). The descriptions make the handoff between stages explicit, so an agent can tell exactly which tool to reach for.
All four names follow a clean snake_case verb_noun pattern (search_tools, describe_tool, call_tool, read_cached_output) with no convention mixing. The one two-word noun (cached_output) is still readable and unambiguous.
Four tools is exactly the right scope for a context-saving proxy: one per workflow stage, with no redundancy or filler. Nothing here feels like it could be collapsed into another tool without losing clarity.
The search → describe → call → read-cache loop is closed and covers the core purpose of lazily invoking upstream tools. Minor gaps remain: no way to enumerate configured upstream servers or manage/clear the spillover cache (list or evict cacheIds), which agents may need when a cacheId is lost or the cache grows.
Maintenance
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Hosted MCP runtime where your agent publishes its own tools by tool call and keeps working.
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceConsolidates multiple upstream MCP servers behind a single STDIO interface, exposing search_tools and run_tool to avoid context bloat.380 npm20MIT- AlicenseAqualityDmaintenanceExposes a verified tool registry (calculator, sandboxed file read, web fetch) over MCP stdio, enabling any MCP-capable client to reuse the same tools from the inspectable ReAct loop.3MIT
- FlicenseNot gradedqualityDmaintenanceLets you run a lightweight stdio MCP server in front of an upstream MCP server, exposing only a configured subset of its tools with compact schemas while keeping the full catalog reachable via discover, describe, and call meta-tools.-
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to discover and execute operational tools such as database mutations and system diagnostics over stdio, with deterministic structured outputs and Langfuse observability.ISC