Code Mode
π Plug-and-play library to enable agents to call MCP and UTCP tools via code execution.
What is Code Mode?
Code Mode is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to π plug-and-play library to enable agents to call mcp and utcp tools via code execution.
π Plug-and-play library to enable agents to call MCP and UTCP tools via code execution.
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- π Plug-and-play library to enable agents to call MCP and UTC
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx code-modeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Code Mode
Code Mode is a plug-and-play library from the Universal Tool Calling Protocol (UTCP) project that enables AI agents to call MCP and UTCP tools by executing TypeScript code in an isolated VM sandbox. Rather than routing tool calls through a fixed dispatcher, agents write actual TypeScript that chains multiple tools togetherβfetching a GitHub PR, reading its comments, and summarizing them in one code block. It supports multi-protocol orchestration across MCP, HTTP, File, and CLI tool sources with full console log capture and configurable execution timeouts.
Prerequisites
- Node.js 18 or later installed
- npm or npx available
- An MCP-compatible client such as Claude Desktop
- A UTCP config file (.utcp_config.json) listing the tools/servers to expose
- Optional: GitHub personal access token if using GitHub MCP tools
Install the core library
Install the @utcp/code-mode package and the MCP protocol adapter into your project.
npm install @utcp/code-mode
npm install @utcp/mcpCreate a UTCP configuration file
Define which MCP servers or UTCP tool providers are available to agents in a JSON config file. This file maps tool providers to their connection details.
{
"providers": [
{
"name": "github",
"call_template_type": "mcp",
"config": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token" }
}
}
]
}Configure Claude Desktop to use the Code Mode MCP server
Add the Code Mode MCP server to your claude_desktop_config.json, pointing it at your UTCP config file.
{
"mcpServers": {
"code-mode": {
"command": "npx",
"args": ["@utcp/code-mode-mcp"],
"env": {
"UTCP_CONFIG_FILE": "/absolute/path/to/.utcp_config.json"
}
}
}
}Use programmatically in TypeScript
For direct integration, create a CodeModeUtcpClient, register tool providers, and call callToolChain() with TypeScript code that orchestrates tools.
import { CodeModeUtcpClient } from '@utcp/code-mode';
const client = await CodeModeUtcpClient.create();
await client.registerManual({
name: 'github',
call_template_type: 'mcp',
config: {}
});
const { result, logs } = await client.callToolChain(`
const pr = await github.get_pull_request({ owner: 'microsoft', repo: 'vscode', pull_number: 1234 });
return { title: pr.title };
`);Inspect available tools at runtime
Use the built-in introspection helpers to discover what tools are registered and examine their interfaces before writing tool-chain code.
// Inside a callToolChain() code block:
const tools = await __interfaces();
const githubTools = await __getToolInterface('github.get_pull_request');Code Mode Examples
Client configuration
Claude Desktop configuration for the Code Mode MCP server with a UTCP config file path.
{
"mcpServers": {
"code-mode": {
"command": "npx",
"args": ["@utcp/code-mode-mcp"],
"env": {
"UTCP_CONFIG_FILE": "/Users/yourname/.utcp_config.json"
}
}
}
}Prompts to try
With Code Mode connected and GitHub tools configured, try these multi-step orchestration prompts.
- "Get pull request #1234 from microsoft/vscode and count its comments"
- "List all tools available in the current Code Mode session"
- "Fetch the README from a repo and summarize its installation steps"
- "Chain together a file read and a GitHub issue create in one step"Troubleshooting Code Mode
UTCP_CONFIG_FILE is set but tools are not found
Use an absolute path for UTCP_CONFIG_FILE. Relative paths resolve differently when Claude Desktop launches the subprocess. Verify the file exists and is valid JSON with `cat /absolute/path/to/.utcp_config.json`.
Tool chain execution times out
The default execution timeout is 30 seconds. For long-running chains, configure a higher timeout when creating the CodeModeUtcpClient. Also check that the underlying MCP server (e.g. GitHub) responds within the window.
TypeScript code in callToolChain fails with syntax errors
The VM sandbox executes TypeScript but does not transpile all modern syntax. Stick to async/await patterns, avoid top-level import statements inside the chain code, and use the registered tool namespace directly (e.g., `github.tool_name()`).
Frequently Asked Questions about Code Mode
What is Code Mode?
Code Mode is a Model Context Protocol (MCP) server that π plug-and-play library to enable agents to call mcp and utcp tools via code execution. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Code Mode?
Follow the installation instructions on the Code Mode GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Code Mode?
Code Mode works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Code Mode free to use?
Yes, Code Mode is open source and available under the MPL-2.0 license. You can use it freely in both personal and commercial projects.
Code Mode Alternatives β Similar Coding Agents Servers
Looking for alternatives to Code Mode? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
β 142.2kProduction-ready platform for agentic workflow development.
Ruflo
β 54.0kπ The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
β 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
β 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
β 25.5kBuild and run agents you can see, understand and trust.
Serena
β 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up Code Mode in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Code Mode?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.