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
10.1K

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

V
Vestige
Vestige is an AI memory engine based on cognitive science. By implementing 29 neuroscience modules such as prediction error gating, FSRS - 6 spaced repetition, and memory dreaming, it provides long - term memory capabilities for AI. It includes a 3D visualization dashboard and 21 MCP tools, runs completely locally, and does not require the cloud.
Rust
9.4K
4.5 points
M
Moltbrain
MoltBrain is a long-term memory layer plugin designed for OpenClaw, MoltBook, and Claude Code, capable of automatically learning and recalling project context, providing intelligent search, observation recording, analysis statistics, and persistent storage functions.
TypeScript
9.0K
4.5 points
B
Bm.md
A feature-rich Markdown typesetting tool that supports multiple style themes and platform adaptation, providing real-time editing preview, image export, and API integration capabilities
TypeScript
15.8K
5 points
S
Security Detections MCP
Security Detections MCP is a server based on the Model Context Protocol that allows LLMs to query a unified security detection rule database covering Sigma, Splunk ESCU, Elastic, and KQL formats. The latest version 3.0 is upgraded to an autonomous detection engineering platform that can automatically extract TTPs from threat intelligence, analyze coverage gaps, generate SIEM-native format detection rules, run tests, and verify. The project includes over 71 tools, 11 pre-built workflow prompts, and a knowledge graph system, supporting multiple SIEM platforms.
TypeScript
6.7K
4 points
P
Paperbanana
Python
8.9K
5 points
B
Better Icons
An MCP server and CLI tool that provides search and retrieval of over 200,000 icons, supports more than 150 icon libraries, and helps AI assistants and developers quickly obtain and use icons.
TypeScript
10.7K
4.5 points
A
Assistant Ui
assistant - ui is an open - source TypeScript/React library for quickly building production - grade AI chat interfaces, providing composable UI components, streaming responses, accessibility, etc., and supporting multiple AI backends and models.
TypeScript
9.9K
5 points
A
Apify MCP Server
The Apify MCP Server is a tool based on the Model Context Protocol (MCP) that allows AI assistants to extract data from websites such as social media, search engines, and e-commerce through thousands of ready-to-use crawlers, scrapers, and automation tools (Apify Actors). It supports OAuth and Skyfire proxy payment and can be integrated into MCP clients such as Claude and VS Code through HTTPS endpoints or local stdio.
TypeScript
9.7K
5 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
39.0K
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
27.2K
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
24.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
80.0K
4.3 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#
37.3K
5 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
70.4K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
24.9K
4.5 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
56.2K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2026AIBase