home / mcp / code mode mcp server

Code Mode MCP Server

An implementation of the Codemode workflow detailed by Cloudflare.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jx-codes-codemode-mcp": {
      "url": "http://localhost:3001/mcp",
      "headers": {
        "NONE": "<NONE>"
      }
    }
  }
}

Code Mode MCP Server enables an LLM-driven workflow where you write TypeScript/JavaScript code that talks to a single HTTP proxy to access your MCP servers. The LLM generates code that uses fetch to reach the MCP proxy, which transparently forwards requests to your real MCP endpoints. This approach simplifies tool orchestration and makes it easier to compose multiple operations in sequence.

How to use

You interact with the Code Mode MCP Server through an MCP client by sending code-driven requests. The LLM writes code that calls a single tool, execute_code, which runs in a Deno sandbox with network access. Your code uses fetch to talk to the MCP proxy at the configured URL, and the proxy forwards requests to your actual MCP servers. You can list available servers, inspect each server’s tools, and call specific tools to perform actions. You can also chain multiple operations in a single code flow and process results within your code.

How to install

Prerequisites: you need Bun (latest version) and Deno for code execution sandboxing. You also need an MCP-compatible client to interact with the server.

1. Clone the project and navigate into the directory.

2. Install dependencies.

3. Create a codemode-config.json to configure the proxy and where to look for MCP server definitions.

4. Add your MCP server configurations by creating .mcp.json files in the specified directories.

Configuration details you’ll use

Proxy configuration example you’ll place in codemode-config.json.

Add your MCP server definitions in .mcp.json files in the configured directories. An example filesystem server config is shown below.

Available tools

execute_code

Executes TypeScript/JavaScript code with network access to the MCP proxy.

check_deno_version

Check Deno installation status.

list_servers_with_tools

Get a comprehensive overview of all available MCP servers and their tools, including complete tool schemas and server status.