Python Interpreter MCP Server

A Model Context Protocol (MCP) server that provides Python code execution capabilities through a REST API interface.

Local serverstdioPython

What is the Python Interpreter MCP Server?

A Model Context Protocol (MCP) server that provides Python code execution capabilities through a REST API interface.

What you get

This MCP server exposes a single tool execute_python_code that allows AI assistants and other MCP clients to execute Python code remotely. The server acts as a bridge between MCP clients and a Python interpreter REST API service.

  • Execute arbitrary Python code through MCP
  • Returns complete execution results including stdout, stderr, exit codes, and file outputs
  • Built with FastMCP for easy MCP server development
  • Async HTTP client for reliable communication with the Python interpreter service

Configuration and credentials

  • Python 3.11 or higher - A Python interpreter REST API service running on localhost:50081 (such as BeeAI Code Interpreter)

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.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
stdoutStandard output from the Python execution
stderrStandard error output (if any)
exit_codeExit code of the Python process
filesAny files generated during execution

How to install the Python Interpreter MCP Server

{
  "mcpServers": {
    "python-interpreter": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/python-interpreter-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

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

Configuration

  • Python 3.11 or higher - A Python interpreter REST API service running on localhost:50081 (such as BeeAI Code Interpreter)

Frequently asked questions

A Model Context Protocol (MCP) server that provides Python code execution capabilities through a REST API interface. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.