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 分