MCP Code Executor MCP Server

execute code

Local serverstdioPython

What is the MCP Code Executor MCP Server?

execute code

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

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

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

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Node.js installed - One of the following: - Conda installed with desired Conda environment created - Python virtualenv - UV virtualenv
VariableDescriptionRequired
CODE_STORAGE_DIRDeclared in the maintainer’s client configuration.Check documentation
ENV_TYPEDeclared in the maintainer’s client configuration.Check documentation
CONDA_ENV_NAMEDeclared in the maintainer’s client configuration.Check documentation

Frequently asked questions

execute code Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.