Skip to main content
Glama

toolc

CI Playground

Live playground — type a task, watch 42 tools collapse into 3.

MCP Context Compiler — turn a fat tool catalog into three tools the model can actually use.

search_tools · describe_tool · call_tool

toolc demo

42 tools → 3 meta-tools. 11.0x fewer tokens. Hit rate still 8/8. Cursor MCP handshake: PASS.

Install

npm install
npm run benchmark
npm run verify:cursor

Related MCP server: anygpt-discovery

Before / After

Mode

Tools exposed

Token estimate

Hit rate

Raw

42

2174

8/8

Compiled

3 meta-tools

198

8/8

The model stops swallowing every schema up front. It discovers on demand, expands only what it needs, and calls through a compiled facade.

Why toolc

Agent stacks keep hitting the same wall:

  • too many tools

  • too much schema

  • sibling-tool confusion

  • context burned before the task starts

Raw MCP is fine with a handful of tools. It gets expensive and noisy with dozens of servers.

toolc treats that as a compiler problem, not a prompt problem.

What it does

  1. Collect tools from mocks or live MCP (stdio / http / sse)

  2. Select task-relevant tools with domain + action ranking

  3. Rewrite descriptions to cut ambiguity

  4. Consolidate near-duplicates into families

  5. Facade as search_tools / describe_tool / call_tool

  6. Serve over MCP stdio for Cursor and other hosts

  7. Benchmark raw vs compiled tokens and hit rate

Use with Cursor

  1. Merge examples/mcp.cursor.json into ~/.cursor/mcp.json (set cwd to this repo).

  2. Reload MCP / restart Cursor.

  3. Confirm the host only sees three tools: search_tools, describe_tool, call_tool.

{
  "mcpServers": {
    "toolc": {
      "command": "npx",
      "args": [
        "tsx",
        "src/cli.ts",
        "serve",
        "--config",
        "examples/config.example.json"
      ],
      "cwd": "/absolute/path/to/toolc"
    }
  }
}

Verify without opening the IDE:

npm run verify:cursor

Expected:

tools/list: call_tool, describe_tool, search_tools
search_tools: hit filesystem.read_file
describe_tool: schema ok
call_tool: mock dispatch ok
Cursor-equivalent MCP handshake: PASS

Quick start

npm install
npm run benchmark
npm run serve

Compile one query:

npx tsx src/cli.ts compile --config examples/config.example.json --query "Find and read the repository README file."

Live upstream collect + call:

npm run collect:live
npm run serve:live

CLI

toolc collect   --config <path> [--live]
toolc compile   --config <path> --query <text> [--limit <n>] [--live]
toolc serve     --config <path> [--query <seed>] [--demo <query>] [--jsonl] [--live]
toolc benchmark --config <path> --tasks <path> [--limit <n>] [--live]
  • servers with mockTools stay offline-friendly by default

  • --live collects from real MCP servers and forwards call_tool

  • serve defaults to MCP stdio

  • --demo prints a one-shot search → describe → call walkthrough

Not another router

toolc is not just semantic search, lazy loading, or dynamic discovery.

Those stop at retrieval. toolc compiles the interface:

  • rewrites descriptions

  • merges duplicate families

  • emits facade tools

  • measures the before/after tradeoff

Who this is for

  • MCP-heavy agent builders

  • framework authors

  • local-model hackers

  • teams whose tool catalogs grow faster than their context windows

Skip it if you only have a few tiny tools, or your provider's built-in tool search is already enough.

Layout

src/
  catalog/     collect + normalize
  compile/     select → rewrite → consolidate → facade
  runtime/     MCP server + upstream pool
  benchmark/   raw vs compiled reports
examples/      mock catalog, live echo, Cursor config
bench/tasks/   example suite
tests/
.github/       CI

Status

MVP end-to-end:

  • collect from mocks or live MCP

  • compile with clean selection

  • serve three meta-tools over MCP stdio

  • forward live call_tool to upstream servers

  • publishable numbers: 42 → 3 tools, 11.0x, 8/8

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A context-efficient proxy that replaces individual tool schemas with three meta-tools for semantic search, schema retrieval, and tool routing. It enables agents to manage hundreds of backend tools while maintaining a constant context footprint of approximately 500 tokens.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      A context-aware MCP proxy that reduces token usage by exposing only 3 tools (mcp_search, mcp_call, mcp_schema) to LLMs, with on-demand tool loading and BM25 search.
      149 npm
      2
      MIT