Codebox AI

v1.0.0Developer Toolsstable

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.

codebox-aimcpai-integration
Share:
9
Stars
0
Downloads
0
Weekly
0/5

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

Execute Python code securely with a self-hosted code interpreter for Claude.
Perform data analysis and coding tasks with AI assistance.
tomconte

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedDec 5, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx codebox-ai

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Clone the repository

Clone the codebox-ai repository and enter the project directory.

git clone https://github.com/tomconte/codebox-ai.git
cd codebox-ai
2

Install dependencies with uv

Install all Python dependencies into the local virtual environment using uv sync.

uv sync
3

Configure 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.sock
4

Start 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.main
5

Add 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"
      }
    }
  }
}
6

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.

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.

Quick Config Preview

{ "mcpServers": { "codebox-ai": { "command": "npx", "args": ["-y", "codebox-ai"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides