CodeBox 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

Remote serverstreamable-httpPython

What is the CodeBox 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. Exposed over MCP by the codebox mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

A secure Python code execution service that provides a self-hosted alternative to OpenAI's Code Interpreter or Anthropic's Claude analysis tool. Built with FastAPI and IPython kernels, it supports session-based code execution and integrates with LLM function calling.

  • Session-based Python code execution in Docker containers
  • IPython kernel for rich output support
  • Dynamic package installation with security controls
  • Package allowlist/blocklist system
  • Version control for security vulnerabilities
  • Support for pip and conda installations

Configuration

You will need 5 environment variables: DOCKER_HOST, CODEBOX_MOUNT_PATH, AZURE_OPENAI_API_KEY, YOUR_SESSION_ID, YOUR_REQUEST_ID. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Python 3.9+ - Docker - uv - Fast Python package installer and resolver

Adding it to your client

Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.

When to reach for it

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. It is maintained by tomconte; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Caveats

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the codebox mcp server does with a few real requests.

Configuration

  • Python 3.9+ - Docker - uv - Fast Python package installer and resolver
VariableDescriptionRequired
DOCKER_HOSTEndpoint or connection string the server talks to.Optional
CODEBOX_MOUNT_PATHFilesystem location the server is allowed to use.Optional
AZURE_OPENAI_API_KEYCredential the server authenticates with.Yes
YOUR_SESSION_IDConfiguration value read at startup.Optional
YOUR_REQUEST_IDConfiguration value read at startup.Optional

Frequently asked questions

Python 3.9+, Docker, and [uv](https://github.com/astral-sh/uv) (fast package installer and resolver). For MCP or Claude Desktop integration, `uv` must be installed and configured.