Skip to content

Use with MCP clients

codemode-mcp is itself an MCP server. Give your client one server, codemode, and keep your real servers in mcp.json. The client then sees run_code (plus search_tools for large catalogs), any hybrid tools, and every upstream prompt and resource.

The automatic way

codemode-mcp init --from claude --install

This:

  1. copies the client's servers into ./mcp.json (use -o to choose another path);
  2. backs up the client config to <file>.bak-YYYYMMDD-HHMMSS;
  3. replaces the client's server list with a single codemode entry pointing at that mcp.json.

Restart the client afterwards. Supported --from values: claude, cursor, vscode, windsurf, or a path to any JSON config with mcpServers / servers. Leave out --install to only import the servers and print the snippet.

Undo

Restore the .bak-… file next to the client config.

Manual configuration

Config file claude_desktop_config.json:

  • Windows: %APPDATA%\Claude\
  • macOS: ~/Library/Application Support/Claude/
  • Linux: ~/.config/Claude/
{
  "mcpServers": {
    "codemode": {"command": "codemode-mcp", "args": ["serve", "-c", "/absolute/path/to/mcp.json"]}
  }
}

.vscode/mcp.json in a workspace, or your user mcp.json:

{
  "servers": {
    "codemode": {
      "type": "stdio",
      "command": "codemode-mcp",
      "args": ["serve", "-c", "${workspaceFolder}/mcp.json"]
    }
  }
}

~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

{
  "mcpServers": {
    "codemode": {"command": "codemode-mcp", "args": ["serve", "-c", "/absolute/path/to/mcp.json"]}
  }
}

~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "codemode": {"command": "codemode-mcp", "args": ["serve", "-c", "/absolute/path/to/mcp.json"]}
  }
}
{
  "mcpServers": {
    "codemode": {"command": "uvx", "args": ["codemode-mcp", "serve", "-c", "/absolute/path/to/mcp.json"]}
  }
}

codemode-mcp serve -c mcp.json --transport http --port 8000
Point the client at http://127.0.0.1:8000/mcp. The dashboard is at http://127.0.0.1:8000/dashboard/. This listens on your own machine only. To reach it from another machine you must set an access token; see Running as a shared HTTP service.

Watching savings while the client runs

Add a dashboard port to the server arguments:

"args": ["serve", "-c", "/absolute/path/to/mcp.json", "--dashboard-port", "8765"]

Then open http://127.0.0.1:8765/. You can also run codemode-mcp dashboard or codemode-mcp usage from a terminal at any time. They read the same database.

What the client sees

Feature Behaviour through codemode-mcp
Tools run_code, search_tools (large catalogs), plus any tools listed in expose_tools
Prompts Passed through unchanged (prefixed server__name only if names collide)
Resources Listed and read through, including resource templates
Approvals require_approval tools trigger an elicitation dialog in clients that support it
Instructions A short hint telling the model to do the whole task in one script

Tips

  • Client can't find codemode-mcp: use the full path to the executable, or "command": "python", "args": ["-m", "codemode_mcp", "serve", ...]. This is what init writes, using the Python it was installed with.
  • Slow first call: the sandbox needs about 3 seconds to start, once per server process. Run codemode-mcp setup once beforehand so Pyodide is already downloaded.
  • Logs go to stderr, which most clients show in their MCP log panel. Add -v before serve for debug output: ["-v", "serve", ...].