MCP Code Executor MCP Server

execute code

Local serverstdioPython

What is the MCP Code Executor MCP server?

execute code. Exposed over MCP by the mcp code executor mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

The MCP Code Executor is an MCP server that allows LLMs to execute Python code within a specified Python environment. This enables LLMs to run code with access to libraries and dependencies defined in the environment. It also supports incremental code generation for handling large code blocks that may exceed token limits.

  • Execute Python code from LLM prompts
  • Support for incremental code generation to overcome token limitations
  • Run code within a specified environment (Conda, virtualenv, or UV virtualenv)
  • Install dependencies when needed
  • Check if packages are already installed
  • Dynamically configure the environment at runtime

Configuration

You will need 5 environment variables: CODE_STORAGE_DIR, ENV_TYPE, CONDA_ENV_NAME, VENV_PATH, UV_VENV_PATH. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js installed - One of the following: - Conda installed with desired Conda environment created - Python virtualenv - UV virtualenv

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

When to reach for it

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. It is maintained by bazinga012; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against MCP Code Executor's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp code executor mcp server does with a few real requests.

How to install the MCP Code Executor MCP server

{
  "mcpServers": {
    "mcp-code-executor": {
      "command": "node",
      "args": [
        "/path/to/mcp_code_executor/build/index.js" 
      ],
      "env": {
        "CODE_STORAGE_DIR": "/path/to/code/storage",
        "ENV_TYPE": "conda",
        "CONDA_ENV_NAME": "your-conda-env"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js installed - One of the following: - Conda installed with desired Conda environment created - Python virtualenv - UV virtualenv
VariableDescriptionRequired
CODE_STORAGE_DIRFilesystem location the server is allowed to use.Optional
ENV_TYPEConfiguration value read at startup.Optional
CONDA_ENV_NAMEConfiguration value read at startup.Optional
VENV_PATHFilesystem location the server is allowed to use.Optional
UV_VENV_PATHFilesystem location the server is allowed to use.Optional

Frequently asked questions

It connects MCP Code Executor to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with MCP Code Executor directly.