
assimelha/cmcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Code Mode MCP — aggregate all your MCP servers behind search() + execute()
概要
Stop registering dozens of MCP servers. Register that aggregates them all behind just . Your AI agent writes TypeScript to discover and call tools across every connected server — with full type safety, sandboxed execution, and automatic response truncation. Inspired by Cloudflare's approach to code-mode MCP. The MCP tool explosion is real. Every new server adds 5-30 tools to your agent's context. With 6 servers that's potentially 180 tool definitions the model has to parse on every turn. cmcp flips the model: instead of N tools, you get : The agent writes code to interact with tools, not JSON blobs. This means: - in context (2 vs hundreds) - — add servers without restarting Claude or Codex - — chain multiple tool calls in a single execution - — auto-generated TypeScript declarations from JSON Schema - — code runs in a QuickJS engine with a 64 MB memory limit That's it. Restart Claude and you'll see code-mode-mcp with the search and execute tools.
README
以下は原文 README の抜粋です。原文を見る。
cmcp — Code Mode MCP
Stop registering dozens of MCP servers. Register one proxy that aggregates them all behind just 2 tools.
Your AI agent writes TypeScript to discover and call tools across every connected server — with full type safety, sandboxed execution, and automatic response truncation.
Inspired by Cloudflare’s approach to code-mode MCP.
Why
The MCP tool explosion is real. Every new server adds 5-30 tools to your agent’s context. With 6 servers that’s potentially 180 tool definitions the model has to parse on every turn.
cmcp flips the model: instead of N tools, you get 2:
| Tool | Purpose |
|---|---|
search() |
Discover tools by writing TypeScript filter code |
execute() |
Call tools across any server with typed async code |
The agent writes code to interact with tools, not JSON blobs. This means:
- 99% fewer tool definitions in context (2 vs hundreds)
- Hot-reload — add servers without restarting Claude or Codex
- Composable — chain multiple tool calls in a single execution
- Type-safe — auto-generated TypeScript declarations from JSON Schema
- Sandboxed — code runs in a QuickJS engine with a 64 MB memory limit
Quick start
# Install
cargo install --path .
# Add servers (same syntax you already know)
cmcp add canva https://mcp.canva.com/mcp
cmcp add --transport stdio github -- npx -y @modelcontextprotocol/server-github
# Register the proxy with Claude
cmcp install
That’s it. Restart Claude and you’ll see code-mode-mcp with the search and execute tools.
Copy-paste from any MCP README
Most MCP server docs give you a claude mcp add or codex mcp add command. Just prepend cmcp:
# Claude syntax — just prepend cmcp
cmcp claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest
cmcp claude mcp add --transport http canva https://mcp.canva.com/mcp
# Codex syntax — same idea
cmcp codex mcp add my-server -- npx docs-server@latest
cmcp codex mcp add api-server --url https://api.example.com --bearer-token-env-var API_TOKEN
How it works
search — discover tools
The agent writes TypeScript to filter the tool catalog:
// Find screenshot-related tools
return tools.filter(t => t.name.includes("screenshot"));
// Find all tools from a specific server
return tools.filter(t => t.server === "chrome-devtools");
// Get a summary of available servers
const servers = [...new Set(tools.map(t => t.server))];
return servers.map(s => ({
server: s,
tools: tools.filter(t => t.server === s).map(t => t.name)
}));
execute — call tools
Each server is a typed global object. The agent calls tools with await:
// Navigate and take a screenshot
await chrome_devtools.navigate_page({ url: "https://example.com" });
const screenshot = await chrome_devtools.take_screenshot({ format: "png" });
return screenshot;
// Chain multiple servers in one call
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →