Codebox AI
A secure Python code execution service designed to integrate with LLMs like GPT and Claude, providing a self-hosted alternative to OpenAI's Code Interpreter. Now with MCP server.
What is Codebox AI?
Codebox AI is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to secure python code execution service designed to integrate with llms like gpt and claude, providing a self-hosted alternative to openai's code interpreter. now with mcp server.
A secure Python code execution service designed to integrate with LLMs like GPT and Claude, providing a self-hosted alternative to OpenAI's Code Interpreter. Now with MCP server.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A secure Python code execution service designed to integrate
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx codebox-aiConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codebox AI
Codebox AI is a self-hosted, Docker-backed Python code execution service that acts as a drop-in alternative to OpenAI's Code Interpreter. It now ships with an MCP server interface so Claude can execute arbitrary Python code in isolated Docker containers, manage long-lived sessions with pinned dependencies, and retrieve rich execution results including data frames and plots — without sending code to any third-party cloud sandbox.
Prerequisites
- Python 3.9 or later installed
- Docker Desktop (or Docker Engine) installed and running
- uv package manager installed (pip install uv)
- A Claude desktop client that supports MCP, or an Azure OpenAI deployment for the built-in chat interface
Clone the repository
Clone the codebox-ai repository and enter the project directory.
git clone https://github.com/tomconte/codebox-ai.git
cd codebox-aiInstall dependencies with uv
Install all Python dependencies into the local virtual environment using uv sync.
uv syncConfigure environment variables
Create a .env file with your Docker and optional Azure OpenAI settings. CODEBOX_MOUNT_PATH mounts a local directory into the container so code can read and write local files.
# .env
CODEBOX_MOUNT_PATH=/Users/you/codebox-data
# Optional: Azure OpenAI for built-in chat interface
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_DEPLOYMENT=gpt-4o
OPENAI_API_VERSION=2024-02-01
# Optional: macOS Docker socket
DOCKER_HOST=unix:///Users/you/.docker/run/docker.sockStart the Codebox AI service
Launch the REST API server. It will listen on port 8000 by default and spin up Docker containers on demand.
uv run -m codeboxai.mainAdd the MCP server to Claude Desktop config
Register the Codebox AI MCP server in claude_desktop_config.json. The MCP server wraps the local REST API.
{
"mcpServers": {
"codebox": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/codebox-ai", "run", "-m", "codeboxai.mcp"],
"env": {
"CODEBOX_MOUNT_PATH": "/Users/you/codebox-data"
}
}
}
}Test code execution through Claude
Ask Claude to execute a simple Python snippet to verify Docker containers are being created and results are returned correctly.
Codebox AI Examples
Client configuration
claude_desktop_config.json snippet for the Codebox AI MCP server with a mounted data directory.
{
"mcpServers": {
"codebox": {
"command": "uv",
"args": ["--directory", "/Users/you/codebox-ai", "run", "-m", "codeboxai.mcp"],
"env": {
"CODEBOX_MOUNT_PATH": "/Users/you/codebox-data",
"DOCKER_HOST": "unix:///Users/you/.docker/run/docker.sock"
}
}
}
}Prompts to try
Example requests that trigger Python code execution via the Codebox AI MCP server.
- "Write and run Python code to load /data/sales.csv with pandas and show summary statistics"
- "Execute a script that generates a matplotlib bar chart of monthly revenue and saves it to /data/chart.png"
- "Run code to train a simple scikit-learn linear regression model on the uploaded dataset"
- "Create a new code session with numpy and scipy installed, then compute the FFT of a sine wave"Troubleshooting Codebox AI
Docker connection refused or 'Cannot connect to the Docker daemon'
Ensure Docker Desktop is running. On macOS, the socket path may differ — set DOCKER_HOST=unix:///Users/you/.docker/run/docker.sock in your .env file to point at the correct socket location.
Session creation times out on first use
The first run pulls the base Docker image, which can take several minutes. Check docker pull progress with docker images. Once the image is cached, subsequent session creation is fast.
Files written in the container are not visible on the host
Ensure CODEBOX_MOUNT_PATH is set to a directory that exists on the host. Code should write to /data/ inside the container, which maps to CODEBOX_MOUNT_PATH on the host filesystem.
Frequently Asked Questions about Codebox AI
What is Codebox AI?
Codebox AI is a Model Context Protocol (MCP) server that secure python code execution service designed to integrate with llms like gpt and claude, providing a self-hosted alternative to openai's code interpreter. now with mcp server. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codebox AI?
Follow the installation instructions on the Codebox AI GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Codebox AI?
Codebox AI works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codebox AI free to use?
Yes, Codebox AI is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Codebox AI Alternatives — Similar Developer Tools Servers
Looking for alternatives to Codebox AI? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codebox AI 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 Codebox AI?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.