toolc — Claude Code MCP server: compile your agent tool surface
Turns a pile of MCP servers and REST APIs into one endpoint with a smaller tool surface. Useful when tool definitions eat your context.
claude mcp add toolc -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- npx -y @toolc/cliWhat toolc does
toolc points at your MCP servers, an OpenAPI spec, or a docs page and serves back a single endpoint. Inside, tool descriptions get rewritten, near-duplicate tools (search_x, find_x, get_x) collapse into facade tools with deterministic routing, and oversized results are summarized at serve time. Every call is logged with its arguments and results.
It runs as a CLI: a config file describes the downstreams, then inspect, compile and serve --mode compiled do the work. The rewrite and consolidate passes need ANTHROPIC_API_KEY, so compilation stops without it. Each pass is a config toggle, which lets you pick the tradeoff per deployment.
Install is npx -y @toolc/cli, added to Claude as an MCP server. There is a Docker path for self-hosting and a managed service at toolc.dev with a console and log explorer. The engine is Apache-2.0, and local compilation matches the hosted quality.
What it helps with
- shrink a catalog of dozens of tools to two meta-tools
- merge duplicate tools like
search_xandfind_x - attach a REST API to an agent from its OpenAPI spec
- cut the cost of every agent call
- find out which calls keep failing
Example prompts for the agent
- Compile the federation in
toolc.config.jsoncand show me the result - Run toolc in
compiledmode and wire it up as an MCP server - Draft a spec from this API's docs and add it to the tool pool
How to install toolc
Platform CLI
claude mcp add toolc -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- npx -y @toolc/cliReplace <…> with your own values
Platform CLI
codex mcp add toolc --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- npx -y @toolc/cliReplace <…> with your own values
Config file
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"toolc": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> toolc npx -y @toolc/cliReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about toolc
How do I install toolc in Claude Code?
Run claude mcp add toolc -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- npx -y @toolc/cli. The key is required for the rewrite and consolidate passes.
What does toolc do?
It compiles a set of MCP servers and REST APIs into one endpoint with fewer tools. Descriptions get rewritten, duplicates merged, and large results compacted.
What does toolc need to run?
Node.js with pnpm to build from the repository, plus ANTHROPIC_API_KEY for compilation. Downstream servers go in toolc.config.jsonc.