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¶
This:
- copies the client's servers into
./mcp.json(use-oto choose another path); - backs up the client config to
<file>.bak-YYYYMMDD-HHMMSS; - replaces the client's server list with a single
codemodeentry pointing at thatmcp.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/
.vscode/mcp.json in a workspace, or your user mcp.json:
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
~/.codeium/windsurf/mcp_config.json:
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:
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 whatinitwrites, 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 setuponce beforehand so Pyodide is already downloaded. - Logs go to stderr, which most clients show in their MCP log panel. Add
-vbeforeservefor debug output:["-v", "serve", ...].