複数のMCP serverとREST APIを単一の最適化されたツールエンドポイントにコンパイルし、コンテキストの使用量を削減してエージェントの精度を向上させます。
別名 toolc-dev/toolc, @toolc/cli
- スター
- 0
- ツール
- —
- ダウンロード数(30日間)
- —
- 最新バージョン
- 0.1.1
- 最終コミット
- 2026年9月15日
- ライセンス
- Apache-2.0
toolc MCPとは
toolcはMCPサーバーです。 複数のMCP serverとREST APIを単一の最適化されたツールエンドポイントにコンパイルし、コンテキストの使用量を削減してエージェントの精度を向上させます。.
プロジェクトのREADMEから生成された概要
toolc MCP server について
toolcは、エージェントのツールサーフェスを最適化するコンパイラとして機能し、複数のMCP serverやREST APIを接続する際のコンテキストウィンドウの肥大化を防ぐように設計されています。すべてのツール定義をモデルのコンテキストに投入するのではなく、このシステムはツールの連合を単一の合理化されたエンドポイントにコンパイルします。開発者は、既存のMCP server、OpenAPI仕様書、あるいはドキュメントページをエンジンに指定することで、よりスマートなツールサーフェスを生成できます。
ユーザーは、CLIを介してローカルで実行するか、マネージドHTTPSエンドポイントとログエクスプローラーを提供するtoolc.devのホストサービスを利用できます。コンパイルプロセスには、LLMの理解を深めるための説明文の書き換え、類似ツールの単一のファサードツールへの統合、およびsearch_toolsやcall_toolのようなメタツールの背後へのカタログ全体の圧縮が含まれます。書き換えおよび統合パスを実行するには、システムにANTHROPIC_API_KEYが必要です。生成されたサーフェスは、Claudeなどのクライアントで使用するためにstdio経由で提供するか、標準的なREST APIとして提供できます。
できること
- 1トークンコストの削減ツール定義を圧縮し、肥大化した結果を要約することで、エージェントタスクの費用を最小限に抑えます。
- 2REST APIの統合OpenAPI仕様書やドキュメントを使用して、外部Webサービスをエージェントの機能に追加します。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
toolc MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude Codeにtoolc MCPをインストール
$ claude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc -- npx -y @toolc/cliCursorにtoolc MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}VS Codeにtoolc MCPをインストール
.vscode/mcp.json
{
"servers": {
"toolc": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}VS Code CLIにtoolc MCPをインストール
$ code --add-mcp '{"name":"toolc","type":"stdio","command":"npx","args":["-y","@toolc/cli"],"env":{"ANTHROPIC_API_KEY":"<YOUR_ANTHROPIC_API_KEY>"}}'Claude Desktopにtoolc MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}Codexにtoolc MCPをインストール
$ codex mcp add toolc --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' -- npx -y @toolc/cliCodex config.tomlにtoolc MCPをインストール
~/.codex/config.toml
[mcp_servers.toolc] command = "npx" args = ["-y", "@toolc/cli"] [mcp_servers.toolc.env] ANTHROPIC_API_KEY = "<YOUR_ANTHROPIC_API_KEY>"
Gemini CLIにtoolc MCPをインストール
$ gemini mcp add -s user -e 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc npx -- -y @toolc/cliGemini settings.jsonにtoolc MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"toolc": {
"command": "npx",
"args": [
"-y",
"@toolc/cli"
],
"env": {
"ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
}
}
}
}設定
ANTHROPIC_API_KEYシークレットEnables the LLM-assisted compile passes (rewrite, consolidate). Without it, toolc serves a mirror of the original tool surface.
| 名前 | 説明 | 種類 |
|---|---|---|
| ANTHROPIC_API_KEY | Enables the LLM-assisted compile passes (rewrite, consolidate). Without it, toolc serves a mirror of the original tool surface. | シークレット |
自動チェック
実行日 2026年11月14日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能toolc-dev/toolc is public and reachablegithub.com/toolc-dev/toolc ↗合格
- パッケージがこのリポジトリをソースとして指定@toolc/cli names toolc-dev/toolc as sourcenpmjs.com/package/@toolc/cli ↗合格
- ビルドの来歴 (Sigstore 証明)No build attestation published for this release未チェック
- オープンソースライセンス (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-09-15github.com/toolc-dev/toolc ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from @toolc/cli合格
- パッケージおよびその依存関係に重大な勧告なし102 resolved dependencies checked; no critical advisoryosv.dev ↗合格
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見る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):
| 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のよくある質問
toolc MCPをClaude Codeに追加するには
ターミナルでclaude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' toolc -- npx -y @toolc/cliを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
toolc MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
toolcで独自のREST APIを使用できますか?
はい、OpenAPI仕様書を提供するか、ドキュメントから合成したドラフト仕様書を使用することで、REST APIを含めることができます。
toolcはローカルデプロイをサポートしていますか?
はい、エンジンはApache-2.0ライセンスであり、CLIを使用してツールサーフェスをローカルでコンパイルおよび提供できます。
toolcでどの程度コストを削減できますか?
ベンチマークによると、コンパイルおよび統合されたツールサーフェスは、生のツールを使用する場合と比較して最大6.4倍安価になります。