Codemesh

v1.0.0Coding Agentsstable

The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation

agentaicodemeshllmmcp
Share:
25
Stars
0
Downloads
0
Weekly
0/5

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

Multi-server orchestration
TypeScript code execution
Self-improving agent system
kiliman

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx codemesh

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 codemesh
2

Create 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"
  }
}
3

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).

4

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}"
      }
    }
  ]
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "codemesh": { "command": "npx", "args": ["-y", "codemesh"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides