MCP Server Code Execution Mode
M

MCP Server Code Execution Mode

This is a server that implements the MCP code execution mode. Through a single-tool bridge and zero-context discovery mechanism, it reduces the overhead of MCP tool calls from tens of thousands of tokens to about 200 tokens and securely executes Python code in the root container, supporting data science and secure isolation.
3.5 points
8.5K

What is the MCP Code Execution Server?

This is an innovative MCP (Model Context Protocol) server that changes the way AI assistants use tools. Traditional methods require loading descriptions of all tools into the AI's context (possibly consuming over 30,000 tokens), while this server only exposes one core tool: `run_python`. The AI assistant writes Python code to discover, call, and combine other MCP tools, greatly reducing context overhead.

How to use the MCP Code Execution Server?

You only need to configure this server in your AI assistant (such as Claude Desktop), and the AI assistant can use various MCP tools by writing Python code. The server will automatically discover all MCP tools you've configured and execute the code in a secure container sandbox to ensure system security.

Applicable Scenarios

Suitable for complex workflows that require using multiple MCP tools simultaneously, such as data science analysis, file processing, cross-system integration, automation scripts, etc. Especially suitable for users who want AI assistants to write code to combine multiple tools to complete complex tasks.

Main Features

Zero-Context Discovery
AI assistants can dynamically discover available MCP tools without pre-loading descriptions of all tools, reducing context token consumption by over 90%.
Code-First Execution
AI assistants write Python code to call tools, supporting complex logic, loops, and conditional judgments, which is more powerful than simple tool calls.
Secure Sandbox
All code is executed in a container with no network access, a read-only file system, and unprivileged users to ensure system security.
Persistent State
The code execution environment remains persistent, and variables, imports, and function definitions are retained between multiple calls, supporting complex workflows.
Multi-Server Support
Automatically discovers and proxies any standard MCP server, supporting seamless integration of over 100 tools.
Intelligent Tool Search
Provides a fuzzy search function. AI assistants can search for tools by keywords without remembering specific tool names.
Advantages
Significantly reduce context overhead: from over 30,000 tokens to about 200 tokens
More powerful tool combination ability: AI can write complex logic to combine multiple tools
Better security: code is executed in a strictly isolated container
More flexible tool discovery: dynamically discover tools without pre-configuring all tools
Support for complex workflows: support loops, conditional judgments, error handling, etc.
Compatible with the existing MCP ecosystem: can proxy any standard MCP server
Limitations
Requires the AI assistant to have the ability to write code
Initial setup requires configuring the container runtime (Podman/Docker)
Code execution has resource limitations (memory, CPU, time)
Does not support network access (for security reasons)
Requires Python 3.14 or higher

How to Use

Install Dependencies
Ensure that Python 3.14+ and the container runtime (Podman or Docker) are installed on the system.
Install the Server
Use the uv tool to install the MCP Code Execution Server.
Configure the AI Assistant
Add this server to the MCP configuration file of the AI assistant.
Configure MCP Tools
Create a JSON file in the ~/MCPs directory to configure the MCP tools you need.
Start Using
Start the AI assistant. Now it can write Python code to use the configured MCP tools.

Usage Examples

File Processing Workflow
The AI assistant discovers the file system tool, lists files, and searches for files containing specific content.
Cross-System Integration
The AI assistant combines Jira and GitHub tools to automatically create GitHub issues from bugs in Jira.
Data Analysis Task
The AI assistant uses data science tools to process and analyze data files.

Frequently Asked Questions

Is this server secure?
Do I need to learn Python to use it?
Which MCP tools are supported?
Is there a time limit for code execution?
How to add new MCP tools?
What's the difference from the traditional MCP usage method?

Related Resources

GitHub Repository
Project source code and latest updates
Anthropic Official Documentation
Anthropic's official article on code execution and MCP
MCP Protocol Documentation
Official documentation of the Model Context Protocol
Docker MCP Gateway
Docker's blog post on dynamic MCPs
Apple CodeAct Research
Apple's research on code execution AI agents

Installation

Copy the following command to your Client for configuration
{
  "mcpServers": {
    "mcp-server-code-execution-mode": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/elusznik/mcp-server-code-execution-mode",
        "mcp-server-code-execution-mode",
        "run"
      ],
      "env": {
        "MCP_BRIDGE_RUNTIME": "podman"
      }
    }
  }
}
Note: Your key is sensitive information, do not share it with anyone.

Alternatives

R
Rsdoctor
Rsdoctor is a build analysis tool specifically designed for the Rspack ecosystem, fully compatible with webpack. It provides visual build analysis, multi - dimensional performance diagnosis, and intelligent optimization suggestions to help developers improve build efficiency and engineering quality.
TypeScript
8.5K
5 points
N
Next Devtools MCP
The Next.js development tools MCP server provides Next.js development tools and utilities for AI programming assistants such as Claude and Cursor, including runtime diagnostics, development automation, and document access functions.
TypeScript
8.2K
5 points
T
Testkube
Testkube is a test orchestration and execution framework for cloud-native applications, providing a unified platform to define, run, and analyze tests. It supports existing testing tools and Kubernetes infrastructure.
Go
6.0K
5 points
M
MCP Windbg
An MCP server that integrates AI models with WinDbg/CDB for analyzing Windows crash dump files and remote debugging, supporting natural language interaction to execute debugging commands.
Python
8.4K
5 points
R
Runno
Runno is a collection of JavaScript toolkits for securely running code in multiple programming languages in environments such as browsers and Node.js. It achieves sandboxed execution through WebAssembly and WASI, supports languages such as Python, Ruby, JavaScript, SQLite, C/C++, and provides integration methods such as web components and MCP servers.
TypeScript
7.3K
5 points
P
Praisonai
PraisonAI is a production-ready multi-AI agent framework with self-reflection capabilities, designed to create AI agents to automate the solution of various problems from simple tasks to complex challenges. It simplifies the construction and management of multi-agent LLM systems by integrating PraisonAI agents, AG2, and CrewAI into a low-code solution, emphasizing simplicity, customization, and effective human-machine collaboration.
Python
7.0K
5 points
N
Netdata
Netdata is an open-source real-time infrastructure monitoring platform that provides second-level metric collection, visualization, machine learning-driven anomaly detection, and automated alerts. It can achieve full-stack monitoring without complex configuration.
Go
8.4K
5 points
M
MCP Server
The Mapbox MCP Server is a model context protocol server implemented in Node.js, providing AI applications with access to Mapbox geospatial APIs, including functions such as geocoding, point - of - interest search, route planning, isochrone analysis, and static map generation.
TypeScript
6.6K
4 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
31.7K
5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
21.4K
4.3 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
18.8K
4.5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
61.2K
4.3 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
56.8K
4.5 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
27.7K
5 points
C
Context7
Context7 MCP is a service that provides real-time, version-specific documentation and code examples for AI programming assistants. It is directly integrated into prompts through the Model Context Protocol to solve the problem of LLMs using outdated information.
TypeScript
85.3K
4.7 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
41.4K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2026AIBase