Codemesh
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation
What is Codemesh?
Codemesh is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to self-improving mcp server - agents write code to orchestrate multiple mcp servers with intelligent typescript execution and auto-augmentation
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- The Self-Improving MCP Server - Agents write code to orchest
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx codemeshConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codemesh
CodeMesh is a self-improving MCP server that lets AI agents write and execute TypeScript code to orchestrate multiple MCP servers simultaneously. Rather than exposing dozens of individual tools, it gives agents a code-first interface: discover available capabilities, fetch TypeScript APIs, and execute coordinated logic across servers in a sandboxed VM2 environment. It is particularly valuable for complex multi-step workflows where a single server cannot accomplish the task alone, and its auto-augmentation system means agent knowledge compounds over time.
Prerequisites
- Node.js 18 or later installed
- An MCP client such as Claude Desktop or Claude Code
- npx available on your PATH (bundled with Node.js)
- One or more MCP servers already configured that CodeMesh will orchestrate
- A .codemesh/config.json file listing the servers to connect to
Add CodeMesh to your MCP client
Register the CodeMesh server using the Claude Code CLI or by editing your client's config file directly. The npx command downloads and runs the latest version automatically.
claude mcp add codemesh npx -y codemeshCreate the CodeMesh configuration file
In your project root, create a .codemesh/config.json file that lists every MCP server CodeMesh should be able to orchestrate. Each entry needs a unique id, a human-readable name, and a type of stdio, http, or websocket.
{
"servers": [
{
"id": "weather",
"name": "Weather Server",
"type": "stdio",
"command": ["npx", "-y", "@modelcontextprotocol/server-weather"]
},
{
"id": "filesystem",
"name": "Filesystem Server",
"type": "stdio",
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
],
"logging": {
"enabled": true,
"level": "info",
"logDir": ".codemesh/logs"
}
}Understand the three core tools
CodeMesh exposes exactly three tools to the AI agent: discover-tools (get an overview of all capabilities across all connected servers), get-tool-apis (fetch TypeScript function signatures for specific tools), and execute-code (run a TypeScript block in a sandboxed VM2 environment with a 30-second timeout).
Configure environment variables for sub-servers
When a sub-server needs API keys or secrets, pass them in the env block within the server entry in .codemesh/config.json. You can reference system environment variables using ${VAR} or ${VAR:-default} syntax.
{
"servers": [
{
"id": "maps",
"name": "Maps Server",
"type": "stdio",
"command": ["npx", "-y", "@modelcontextprotocol/server-maps"],
"env": {
"GOOGLE_MAPS_API_KEY": "${GOOGLE_MAPS_API_KEY}"
}
}
]
}Verify the server is running
Restart your MCP client after saving the config. Ask the agent to call discover-tools to confirm CodeMesh can see and enumerate all configured sub-servers.
Codemesh Examples
Client configuration
Add CodeMesh to Claude Desktop's claude_desktop_config.json so it launches automatically on startup.
{
"mcpServers": {
"codemesh": {
"command": "npx",
"args": ["-y", "codemesh"]
}
}
}Prompts to try
Once CodeMesh is connected alongside other MCP servers, use these prompts to leverage its multi-server orchestration.
- "Discover all available tools across my connected servers and give me a summary"
- "Get the weather for New York and save the result to a file called weather.txt"
- "Search the filesystem for all .csv files and then read the first one to give me a summary"
- "Write TypeScript code that calls both the geocoding and weather APIs to get the forecast for my current city"Troubleshooting Codemesh
execute-code times out on complex operations
CodeMesh enforces a 30-second VM2 sandbox timeout. Break large workflows into smaller sequential TypeScript blocks rather than one monolithic script.
Sub-server not found in discover-tools output
Check that the server entry in .codemesh/config.json has a valid command array and that the underlying npx package is accessible. Run the sub-server command directly in a terminal to confirm it starts without errors.
Auto-augmentation documentation is not being saved
Ensure the .codemesh/ directory is writable by the process running CodeMesh. Check the logDir path in config and that logging is enabled so you can trace what the agent is recording.
Frequently Asked Questions about Codemesh
What is Codemesh?
Codemesh is a Model Context Protocol (MCP) server that self-improving mcp server - agents write code to orchestrate multiple mcp servers with intelligent typescript execution and auto-augmentation It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codemesh?
Follow the installation instructions on the Codemesh GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Codemesh?
Codemesh works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codemesh free to use?
Yes, Codemesh is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Codemesh Alternatives — Similar Coding Agents Servers
Looking for alternatives to Codemesh? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codemesh in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Codemesh?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.