An MCP proxy server that adds "code mode" capability to any MCP server. This lets AI models write JavaScript code that can call multiple tools in a single execution, instead of calling tools one at a time.
┌─────────────────┐ ┌──────────────────┐ ┌────────────────────┐
│ MCP Client │────▶│ codemoder │────▶│ Downstream MCP │
│ (Claude, etc) │ │ │ │ Server │
└─────────────────┘ └──────────────────┘ └────────────────────┘
The proxy:
- Spawns and connects to a downstream MCP server
- Intercepts
list_toolsand adds anexecute_toolstool - Generates TypeScript interface definitions for all tools
- When
execute_toolsis called, runs JavaScript code that can call tools - Proxies regular tool calls through to the downstream server
# Proxy any MCP server (simple form)
codemoder ./my-mcp-server
# With options, use -- to separate codemoder args from the command
codemoder --mode replace -- ./my-mcp-server
# Custom tool name
codemoder --tool-name "run_script" -- ./my-mcp-server
# Only include specific tools
codemoder --include-tools "move_items,get_footprints" -- ./my-mcp-server| Option | Description | Default |
|---|---|---|
--mode |
add exposes both execute_tools and original tools; replace only exposes execute_tools |
add |
--tool-name |
Name of the code execution tool | execute_tools |
--include-tools |
Comma-separated list of tools to include | all tools |
When connected through the proxy, the model can write:
// Get all items and sum their values
var items = tools.get_items({}).items;
var total = 0;
for (var i = 0; i < items.length; i++) {
total += items[i].value;
}
({count: items.length, total: total})cargo build --releaseThe binary will be at target/release/codemoder.