Compiles multiple MCP servers and REST APIs into a single, optimized tool endpoint to reduce context usage and improve agent accuracy.
Also known as toolc-dev/toolc, @toolc/cli
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 0.1.1
- Last commit
- Sep 15, 2026
- License
- Apache-2.0
What is toolc MCP?
toolc compiles multiple MCP servers and REST APIs into a single, optimized tool endpoint to reduce context usage and improve agent accuracy.
Summary generated from the project's README
About toolc MCP server
toolc acts as an optimizing compiler for agent tool surfaces, designed to prevent context window bloat when connecting multiple MCP servers or REST APIs. Instead of dumping every tool definition into a model's context, this system compiles a federation of tools into a single, streamlined endpoint. Developers can point the engine at existing MCP servers, OpenAPI specifications, or even documentation pages to generate a smarter tool surface.
Users can run this locally via a CLI or use the hosted service at toolc.dev for managed HTTPS endpoints and a log explorer. The compilation process includes rewriting descriptions for better LLM understanding, consolidating near-duplicate tools into single facade tools, and compressing the entire catalog behind meta-tools like search_tools and call_tool. To perform rewrite and consolidate passes, the system requires an ANTHROPIC_API_KEY. The resulting surface can be served over stdio for use in clients like Claude or as a standard REST API.
What you can do with it
- 1Reduce token costsMinimize the expense of agent tasks by compressing tool definitions and summarizing oversized results.
- 2Integrate REST APIsAdd external web services to your agent's capabilities using an OpenAPI spec or documentation.
Written from the project's README. Every use case is checked against a quote from it.
How to install toolc MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall toolc MCP in Claude Code
$ claude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc -- npx -y @toolc/cliInstall toolc MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}Install toolc MCP in VS Code
.vscode/mcp.json
{
"servers": {
"toolc": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}Install toolc MCP in VS Code CLI
$ code --add-mcp '{"name":"toolc","type":"stdio","command":"npx","args":["-y","@toolc/cli"],"env":{"ANTHROPIC_API_KEY":"<YOUR_ANTHROPIC_API_KEY>"}}'Install toolc MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}Install toolc MCP in Codex
$ codex mcp add toolc --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' -- npx -y @toolc/cliInstall toolc MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.toolc] command = "npx" args = ["-y", "@toolc/cli"] [mcp_servers.toolc.env] ANTHROPIC_API_KEY = "<YOUR_ANTHROPIC_API_KEY>"
Install toolc MCP in Gemini CLI
$ gemini mcp add -s user -e 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc npx -- -y @toolc/cliInstall toolc MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}Configuration
ANTHROPIC_API_KEYSecretEnables the LLM-assisted compile passes (rewrite, consolidate). Without it, toolc serves a mirror of the original tool surface.
| Name | Description | |
|---|---|---|
| ANTHROPIC_API_KEY | Enables the LLM-assisted compile passes (rewrite, consolidate). Without it, toolc serves a mirror of the original tool surface. | Secret |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachabletoolc-dev/toolc is public and reachablegithub.com/toolc-dev/toolc ↗Pass
- Package names this repository as its source@toolc/cli names toolc-dev/toolc as sourcenpmjs.com/package/@toolc/cli ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-09-15github.com/toolc-dev/toolc ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @toolc/cliPass
- No critical advisory in the package or its dependencies102 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubtoolc
The optimizing compiler for agent tool surfaces. Point it at your MCP servers, or just a REST API's OpenAPI spec, or even a docs page, and get back one endpoint that serves a smaller, smarter tool surface: cheaper for every agent that connects, more accurate on every task, with every call logged.
Connecting N MCP servers dumps every tool definition into the model's context, degrades tool selection, and forces improvised multi-hop call chains. toolc compiles the federation instead:
- Rewrite: LLM-optimized descriptions with sibling disambiguation
- Consolidate: families of near-duplicate tools (
search_x/find_x/get_x) merge into single facade tools with deterministic routing - Selection: the whole catalog compresses behind two meta-tools
(
search_tools/call_tool) when you want maximum context savings - Compaction: oversized results are summarized at serve time, preserving identifiers and sourcing details
- Compose: REST APIs join the pool straight from an OpenAPI spec, or from a drafted spec synthesized from their documentation
- Observe: every call logged with arguments and results; recurring errors cluster into recommended fixes
Benchmark
131 tools across 5 live servers, 30 tasks × 3 trials, judged answers (full grid · consolidation run):
| condition | success | cost / completed task | tool-def context |
|---|---|---|---|
| raw (all 131 tools) | 96.7% | $0.2631 | ~24,360 tok |
| compiled + consolidate | 96.7% | $0.0411 (6.4× cheaper) | ~845 tok |
| consolidate, no selection | 100.0% | $0.1335 | ~14,506 tok |
Consolidation dominates both ends of the frontier: the selection surface is the cost lever, consolidation lifts accuracy everywhere. Every pass is a config toggle; pick the tradeoff per deployment.
Quick start
git clone https://github.com/toolc-dev/toolc && cd toolc
pnpm install && pnpm -r test
# describe your federation
cp toolc.config.example.jsonc toolc.config.jsonc
# introspect it
node packages/cli/bin/toolc.mjs -c toolc.config.jsonc inspect
# compile (set ANTHROPIC_API_KEY for the rewrite/consolidate passes)
node packages/cli/bin/toolc.mjs -c toolc.config.jsonc compile
# serve the compiled surface over stdio (add to Claude as an MCP server)
node packages/cli/bin/toolc.mjs -c toolc.config.jsonc serve --mode compiled
A downstream can be an MCP server or a bare REST API:
{
"downstream": [
{ "id": "gh", "transport": { "type": "http", "url": "https://api.githubcopilot.com/mcp/" } },
{ "id": "nws", "transport": { "type": "openapi", "spec": "https://api.weather.gov/openapi.json" } }
]
}
See SELF_HOSTING.md for Docker deployment.
Hosted
toolc.dev runs this same engine as a managed service: compiled HTTPS endpoints, a console with a playground and full-payload log explorer, docs-to-spec drafting, and error-driven fix recommendations.
Layout
packages/core: IR (Capability Graph), frontends (MCP, OpenAPI, docs synthesis), passes, emitpackages/gateway: runtime MCP server (mirror + compiled) with call logging and compactionpackages/cli: thetoolccommandpackages/harness: benchmark runner, grading, reportspackages/shared: config schema, errors
License
The engine (everything in this repository) is Apache-2.0, forever: anyone can compile and serve their own tool surfaces locally with the exact same compilation quality as the hosted product.
toolc MCP questions
How do I add toolc MCP to Claude Code?
Run claude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc -- npx -y @toolc/cli in your terminal. Add --scope user to make it available in every project.
How do I add toolc MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
Can I use my own REST APIs with toolc?
Yes, you can include REST APIs by providing an OpenAPI spec or by using a drafted spec synthesized from documentation.
Does toolc support local deployment?
Yes, the engine is Apache-2.0 licensed and allows you to compile and serve tool surfaces locally using the CLI.
How much can toolc reduce costs?
Benchmarks show that compiled and consolidated tool surfaces can be up to 6.4 times cheaper than using raw tools.