Python Executor MCP Server

Executes Python code and manages Python packages within a sandboxed environment.

Local serverstdioPython★ 3

What is the Python Executor MCP Server?

Executes Python code and manages Python packages within a sandboxed environment.

What the server does

A Model Context Protocol (MCP) server for executing Python code and managing Python packages.

  • Execute Python code with safety constraints
  • Install and manage Python packages
  • Pre-configure commonly used packages
  • Resource monitoring and limits
  • Health checks and metrics
  • Structured logging

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 Python Executor MCP Server

{
  "mcpServers": {
    "mcp-python-executor": {
      "command": "node",
      "args": ["path/to/python-executor/build/index.js"],
      "env": {
        "PREINSTALLED_PACKAGES": "numpy pandas matplotlib scikit-learn",
        "MAX_MEMORY_MB": "512",
        "EXECUTION_TIMEOUT_MS": "30000",
        "MAX_CONCURRENT_EXECUTIONS": "5",
        "LOG_LEVEL": "info",
        "LOG_FORMAT": "json"
      }
    }
  }
}

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

Configuration

VariableDescriptionRequired
PREINSTALLED_PACKAGESConfiguration value read at startup.Optional
MAX_MEMORY_MBConfiguration value read at startup.Optional
EXECUTION_TIMEOUT_MSConfiguration value read at startup.Optional
MAX_CONCURRENT_EXECUTIONSConfiguration value read at startup.Optional
LOG_LEVELConfiguration value read at startup.Optional
LOG_FORMATConfiguration value read at startup.Optional

Frequently asked questions

Key features include secure Python code execution with safety constraints, Python package installation and management, configurable resource limits (memory, timeout, concurrency), structured logging, and health checks & metrics.