Code Mode Bridge MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add code-mode-bridge -- npx -y @ruifung/codemode-bridge
README.md

An MCP multiplexer that connects to upstream MCP servers

Code Mode Bridge

An MCP (Model Context Protocol) multiplexer that connects to upstream MCP servers and exposes all their tools through a single sandbox_eval_js tool for unified orchestration and execution. Runs on Node.js and Deno. Bun is not officially supported — if you need to use Bun, ensure a container runtime (Docker or Podman) or Deno is available in your PATH so the bridge can delegate code execution to a supported executor.

Key Features

  • Multi-server bridging: Connect to multiple upstream MCP servers simultaneously.
  • Tool aggregation: Exposes all upstream functions through a single sandbox_eval_js tool.
  • Dynamic discovery: Three built-in discovery tools let agents find and inspect available functions before writing code.
  • Multi-executor sandbox: Secure execution via Deno, isolated-vm, Docker/Podman containers, or vm2.
  • Automatic detection: Automatically selects the best available executor for your environment.
  • Live reload: Watches mcp.json for changes and hot-reloads upstream connections without restarting.
  • CLI management: Easy command-line interface for server configuration.

Quick Start

Installation & Run

# Run without installing
npx @ruifung/codemode-bridge

# Or install globally
npm install -g @ruifung/codemode-bridge
codemode-bridge run

Basic Usage

  1. Add a server:
    codemode-bridge config add kubernetes --type stdio --command "npx" --args "-y,kubernetes-mcp-server@latest"
    
  2. Start the bridge:
    codemode-bridge run
    
  3. Use in your client: Point your MCP client (Claude Desktop, VS Code, etc.) to npx @ruifung/codemode-bridge.

Discovery Tools

The bridge exposes three tools for discovering what's available before writing sandbox_eval_js code:

Tool Description
sandbox_get_functions List all available functions grouped by server. Accepts an optional server filter.
sandbox_get_function_schema Get the TypeScript type definition for a specific function by name.
sandbox_search_functions Keyword-search all function names and descriptions. Returns matching functions with their schemas.

Use these before calling sandbox_eval_js to find the correct function name and parameter types.

Using the `sandbox_eval_js` Tool

The sandbox_eval_js tool executes JavaScript in a sandboxed environment with access to all upstream functions via the codemode object. You can write either a function body or a complete async arrow function:

// Function body (auto-wrapped):
const result = await codemode.server_name__function_name({ param: "value" });
return result;

// Or as a complete async arrow function:
async () => {
  const result = await codemode.server_name__function_name({ param: "value" });
  return result;
}

Documentation Index

Tools (4)

sandbox_eval_jsExecutes JavaScript in a sandboxed environment with access to all upstream functions via the codemode object.
sandbox_get_functionsList all available functions grouped by server.
sandbox_get_function_schemaGet the TypeScript type definition for a specific function by name.
sandbox_search_functionsKeyword-search all function names and descriptions.

Configuration

claude_desktop_config.json
{"mcpServers": {"codemode-bridge": {"command": "npx", "args": ["-y", "@ruifung/codemode-bridge"]}}}

Try it

List all available functions from my connected MCP servers to see what I can automate.
Search for functions related to kubernetes in my connected servers.
Execute a script using the codemode object to call a function from my connected database server.
Get the schema for the kubernetes__list_pods function so I know how to call it correctly.

Frequently Asked Questions

What are the key features of Code Mode Bridge?

Aggregates multiple upstream MCP servers into a single interface. Provides a secure sandbox for executing JavaScript code. Dynamic discovery tools to inspect available functions and schemas. Supports multiple execution backends including Deno, isolated-vm, and Docker. Live reloading of upstream connections without restarting the server.

What can I use Code Mode Bridge for?

Orchestrating complex workflows across multiple different MCP servers. Running untrusted code safely within a sandboxed environment. Building unified AI agents that can interact with disparate tools through a single bridge. Rapidly prototyping and testing tool calls using the CLI discovery tools.

How do I install Code Mode Bridge?

Install Code Mode Bridge by running: npx @ruifung/codemode-bridge

What MCP clients work with Code Mode Bridge?

Code Mode Bridge works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Code Mode Bridge docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare