Toolc

dev.toolc由 toolc.dev 發布v0.1.1更新於 Oct 24, 2026

Optimizing compiler for agent tools: many MCP servers or REST APIs in, one lean endpoint out.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

一個本機編譯器,把多個 MCP 伺服器或 REST API 整合成一個精簡、成本更低的工具介面,透過 stdio 提供給助理。

可以做什麼
把多個 MCP 伺服器、OpenAPI 規格或文件頁面編譯成一個更小的工具介面,每個處理環節都可設定開關(R1、R17)。改寫工具描述,並把近似重複的工具合併為具確定性路由的門面工具(R4、R5)。可選擇把整個目錄藏在 search_tools 和 call_tool 兩個中繼工具之後,以最大程度節省上下文(R6)。在服務時對過大的結果做摘要,同時保留識別碼和來源資訊(R7)。記錄每次呼叫的參數和結果,並把反覆出現的錯誤聚類為修正建議(R9)。
適用情境
當助理連接多個 MCP 伺服器或 REST API,合併後的工具定義佔滿上下文或降低工具選擇品質時適用(R2)。適合希望降低單一任務成本、提高工具選擇準確度,又不想逐一手動精簡伺服器的情境。
執行需求
以本機程序透過 stdio 執行,從 npm 套件 @toolc/cli 安裝;README 的快速開始使用 pnpm 從原始碼建置。需要 toolc.config.jsonc 描述下游伺服器或 OpenAPI 規格。環境變數 ANTHROPIC_API_KEY 啟用 LLM 輔助的 rewrite 和 consolidate 環節;未設定時,toolc 提供原始工具介面的鏡像。
安裝前請注意
ANTHROPIC_API_KEY 密鑰會傳送給 Anthropic 用於 LLM 輔助環節,會產生費用。每次呼叫都會連同參數和結果被記錄,敏感資料可能被本機保存。編譯後的描述和路由是自動產生的,編譯後應驗證工具行為。下游伺服器和 API 會收到 toolc 路由過去的呼叫。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Toolc,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

toolc

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):

conditionsuccesscost / completed tasktool-def context
raw (all 131 tools)96.7%$0.2631~24,360 tok
compiled + consolidate96.7%$0.0411 (6.4× cheaper)~845 tok
consolidate, no selection100.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

sh
git clone https://github.com/toolc-dev/toolc && cd toolcpnpm install && pnpm -r test
# describe your federationcp toolc.config.example.jsonc toolc.config.jsonc
# introspect itnode 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:

jsonc
{  "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, emit
  • packages/gateway: runtime MCP server (mirror + compiled) with call logging and compaction
  • packages/cli: the toolc command
  • packages/harness: benchmark runner, grading, reports
  • packages/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.

來源:README.md,提交 69f0bec

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分