mcpfold logomcpfold

← All comparisons

How to reduce MCP token usage

Reducing MCP token usage means cutting the tool-schema JSON that every connected MCP server loads into the model’s context on each turn — whether the agent uses those tools or not. The main approaches are native tool-search (the model loads tools on demand), schema/response compression, code execution, and deterministic per-client curation. mcpfold takes the curation approach: from one canonical config it loads only the tools each client needs, so the reduction is explicit, reproducible, and works on every client — including Cursor, Windsurf, and Zed, which have no native tool-search.

Native tool-searchSchema / response compressionCode executionmcpfold
What it doesThe model searches the tool catalog and loads a few tools on demandA proxy shrinks tool schemas and/or trims tool outputsThe agent writes code that calls tools, processing data before returning itYou curate which servers and tools each client loads, from one config
Deterministic (same tools every run)No — selection is model-driven and can varyYes — the same transform each runPartly — depends on the generated codeYes — an explicit allow / deny list
Works across every clientNo — only clients and models that ship itVaries by proxyNo — needs a code-execution runtimeYes — folds to every MCP client from one config
Ties you to a model or platformYes — specific models / clientsNoSomewhat — needs a sandboxNo — client- and model-agnostic
Extra service to runNo — built inYes — a proxyYes — a sandboxNo — a local CLI already in the launch path
Open sourceNo — a vendor featureOftenVariesYes — MIT
Best forOne supported client where model-driven selection is fineLarge tool schemas or noisy tool outputsData-heavy, multi-step tool pipelinesMultiple clients, or when you want deterministic, auditable tool sets

The cost is real: a handful of busy MCP servers can spend thousands of tokens on tool definitions before the agent does any work. Anthropic measured an ~85% token reduction when Claude loads tools on demand instead of loading every definition up front — a figure that shows how large the untrimmed baseline is. mcpfold’s own reproducible benchmark trims a representative 45-tool setup down to the 9 tools actually needed and cuts tool-schema tokens by ~80%, with no extra configuration because the shim already in the launch path does the filtering.

Which approach to pick: if you use a single client whose model ships native tool-search and you are comfortable with model-driven selection, that built-in feature is the simplest path. If you run more than one client — or use Cursor, Windsurf, or Zed, which have no native tool-search — deterministic per-client curation with mcpfold is the option that works everywhere from one source of truth. If your problem is giant tool outputs rather than too many tools, add a response-filtering proxy; if you run data-heavy multi-step pipelines, code execution goes furthest. These approaches stack.

mcpfold’s wedge is determinism and reach. Native tool-search searches the catalog and loads tools by inference, which is convenient but non-deterministic and can miss a tool; mcpfold curates an explicit allow / deny set, so the toolset is the same on every run and is auditable in a code review or CI gate. And it curates from one canonical config across every MCP client, rather than being a per-platform feature.

mcpfold composes with native tool-search rather than replacing it: mcpfold decides which servers and tools reach a client at all, and any native tool-search then operates on a smaller, cleaner set. It is deliberately not a schema-compression proxy or a code-execution runtime — for those jobs, the tools built for them fit better, and mcpfold sits happily in front of them.

Related

mcpfold is an independent, open-source project and is not affiliated with or endorsed by the MCP project or any other tool named here. Comparisons describe categories factually.