mcpcodeserver is an MCP server that transforms Model Context Protocol tool calling into sandboxed TypeScript program generation and execution. Acting as a proxy client, it connects to one or more child MCP servers specified in a configuration file, discovers all available downstream tools, and provides unified TypeScript typings to the host language model. Software engineers and AI developers use it in clients such as Cursor, Claude Code, and VS Code to bypass repetitive, sequential JSON-RPC round-trips. Instead of invoking individual tools one by one and passing intermediate state back through context tokens, parent models can generate self-contained TypeScript scripts that run inside an isolated sandbox. This workflow lets the model perform data manipulation, conditional logic, arrays, and error handling via try-catch blocks directly across multiple connected tools. mcpcodeserver also provides dynamic tool discovery with 30-second polling intervals, server filtering via namespacing to preserve context window limits, and pass-through support for advanced MCP features like elicitation, roots, and sampling. By translating tool orchestration into standard programming idioms, it minimizes latency and reduces token consumption during complex multi-step operations.
Category: AI & LLM Tooling
Tags: code-generation, latency-optimization, orchestration, typescript
mcp.json configuration file defining your child MCP servers. 3. Register the server in your MCP client configuration (such as Cursor's ~/.cursor/mcp.json or VS Code MCP settings): json { "mcpServers": { "mcpcodeserver": { "command": "npx", "args": ["-y", "mcpcodeserver", "--config", "/path/to/your/mcp.json"] } } } 4. If using Claude Code, add the server directly via terminal: sh claude mcp add mcpcodeserver -- npx -y mcpcodeserver --config /path/to/your/mcp.json 5. Restart your client to enable tool discovery and code execution.Part of MCP Servers
You can run mcpcodeserver using npx without prior manual installation. Create an mcp.json file listing your target child MCP servers, then reference that config path in your MCP client configuration file or register it using the Claude Code command-line interface.
mcpcodeserver connects to child MCP servers, extracts their tool signatures into TypeScript interfaces, and allows LLMs to orchestrate multiple tools in a single step using loops, variables, and error handling inside a sandboxed execution environment.
mcpcodeserver works with standard MCP clients that support stdio or HTTP transport. Verified environments include Cursor, Claude Code, Visual Studio Code, Windsurf, Continue, Cline, RooCode, and Amp. It requires Node.js v18.0.0 or higher.
Yes, mcpcodeserver is open source software published under the MIT license. The full source code, package scripts, and issue tracker are available in the project repository on GitHub at https://github.com/zbowling/mcpcodeserver.