codemesh
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation
claude mcp add --transport stdio kiliman-codemesh npx -y codemesh
How to use
CodeMesh is a framework that lets AI agents write TypeScript code to orchestrate MCP servers. For CodeMesh, the primary capability is to interact with a collection of MCP servers through three core tools: discover-tools to see what a server can do, get-tool-apis to retrieve TypeScript APIs for specific tools, and execute-code to write and run code that calls multiple tools in a coordinated fashion. In practice, you add the CodeMesh MCP server to your environment, configure it, and then prompt the system to discover tools, fetch their APIs, and execute code that utilizes those tools. The flow encourages documentation of tool outputs when outputs are unclear, which drives improved intelligence for subsequent runs. The result is a shared, self-improving surface where agents document outputs and augment tool descriptions for faster, more reliable future interactions.
How to install
Prerequisites:
- Node.js installed on your machine (npx is available with Node.js).
- Access to install npm packages from the command line.
Step 1: Install CodeMesh as an MCP server via npx
- If you are configuring via Claude Desktop or your environment, run:
claude mcp add codemesh npx -y codemesh
This registers the Codemesh MCP server using npx to install the package on demand.
Step 2: Verify the configuration snippet (optional) You can manually add Codemesh to your MCP settings as shown below. This example uses the same npx command as Step 1.
{
"mcpServers": {
"codemesh": {
"command": "npx",
"args": ["-y", "codemesh"]
}
}
}
Step 3: (Optional) Local configuration file for CodeMesh usage Create a .codemesh/config.json in your project to specify how CodeMesh connects to other MCP servers. This mirrors the in-app examples and can be customized for your environment.
{
"logging": {
"enabled": true,
"level": "info",
"logDir": ".codemesh/logs"
},
"servers": []
}
Note: The essential installation for running CodeMesh via MCP is ensuring the npx-based server definition is present in your MCP configuration, as shown above. If you prefer a different runtime (e.g., npm package installation, Docker), adapt the mcp_config accordingly (e.g., node or docker commands).
Additional notes
Tips and common considerations:
- Tools are surfaced as discover-tools, get-tool-apis, and execute-code. Use discover-tools first to understand what capabilities are available from a given server.
- When outputs are ambiguous, CodeMesh prompts the agent to document augmentation data. This helps future runs parse results reliably.
- Environment variables for tool configuration can be provided via the env field in your servers array when you use the .codemesh/config.json approach.
- Logging is supported to capture tool calls, code execution, and responses; enable it to aid debugging.
- If you switch to a different package manager or runtime, adjust the mcp_config to use the appropriate command and arguments (node, python, docker, etc.).
Related MCP Servers
markdownify
A Model Context Protocol server for converting almost anything to Markdown
Remote
A type-safe solution to remote MCP communication, enabling effortless integration for centralized management of Model Context.
mcp-frontend
Frontend for MCP (Model Context Protocol) Kit for Go - A Complete MCP solutions for ready to use
mcp-reporter
mcp-reporter is a streamlined utility that generates comprehensive capability reports for Model Context Protocol servers, empowering developers to easily understand available functionality across their MCP servers ecosystem for both documentation and integration into other tools.
vscode-context
MCP Server to Connect with VS Code IDE
agentmesh
🤖🕸️ Production-grade multi-agent orchestration framework powered by Pregel BSP. Build sophisticated AI workflows with parallel execution, state management, and observability.