MCP Python Interpreter
Runs Python code and manages Python environments and packages from an agent, inside a working folder.
Test results
No full client pass yetServer package tested: mcp-python-interpreter 1.2.3 (uv, Python 3.12.15; resolved 2026-10-22)
Direct and key dependencies as resolved: anyio 4.15.1 · fastmcp 4.1.3 · mcp 2.3.0 · pydantic 2.14.1 · pydantic-settings 2.16.1 · pydantic_core 2.50.1 · sse-starlette 3.5.0 · starlette 1.9.0 · typing_extensions 4.16.0 · uvicorn 0.54.0
All 69 resolved dependencies
aiofile==3.12.3
annotated-types==0.8.0
anyio==4.15.1
attrs==26.1.0
Authlib==1.9.1
beartype==0.23.1
cachetools==7.2.4
caio==0.12.9
certifi==2026.10.19
cffi==2.1.1
click==8.5.0
cryptography==50.0.2
cyclopts==5.3.0
dnspython==2.9.0
docstring_parser==0.18.0
email-validator==2.3.0
exceptiongroup==1.3.1
fastmcp==4.1.3
fastmcp-slim==4.1.3
griffelib==2.4.1
h11==0.16.0
httpcore2==2.16.0
httpx2==2.16.0
idna==3.20
jaraco.classes==3.4.0
jaraco.context==6.1.2
jaraco.functools==4.6.0
jeepney==0.9.0
joserfc==1.7.7
jsonref==1.1.0
jsonschema==4.26.0
jsonschema-path==0.5.0
jsonschema-specifications==2025.9.1
keyring==25.7.0
markdown-it-py==4.2.0
mcp==2.3.0
mcp-types==2.3.0
mdurl==0.1.2
more-itertools==11.2.1
openapi-pydantic==0.6.0
opentelemetry-api==1.45.1
packaging==26.3
pathable==0.6.0
platformdirs==4.13.5
py-key-value-aio==0.4.6
pycparser==3.12
pydantic==2.14.1
pydantic-settings==2.16.1
pydantic_core==2.50.1
Pygments==2.21.0
PyJWT==2.15.1
pyperclip==1.11.0
python-dotenv==1.2.4
python-multipart==0.0.32
PyYAML==6.0.3
referencing==0.37.0
rich==15.0.0
rich-rst==2.2.0
rpds-py==2026.9.1
SecretStorage==3.5.0
sse-starlette==3.5.0
starlette==1.9.0
truststore==0.10.5
typing-inspection==0.4.4
typing_extensions==4.16.0
uncalled-for==0.4.1
uvicorn==0.54.0
watchfiles==1.3.0
websockets==17.3Captured with: uvx --from mcp-python-interpreter python (importlib.metadata in the same uvx env; equivalent to uv pip freeze).
Full result per app: Does it work with Claude Code? · Does it work with Cursor? · Does it work with ChatGPT (Codex)?
Real test
FailedOne run from our records. When two runs share a date, we show a failure if there is one.
- Client
- Protocol check (no agent app) · mcp-python-interpreter 1.2.3
- Date
- Oct 22, 2026
- The task we gave
- details not recorded for this run
- What it promised
- details not recorded for this run
- What happened
Tool calls: details not recorded for this run
Error
Traceback (most recent call last): File "…/bin/mcp-python-interpreter", line 6, in <module> from mcp_python_interpreter.main import main File "…/lib/python3.12/site-packages/mcp_python_interpreter/__init__.py", line 11, in <module> from mcp_python_interpreter.server import mcp File "…/lib/python3.12/site-packages/mcp_python_interpreter/server.py", line 24, in <module> from mcp.server.fastmcp import FastMCP File "…/lib/python3.12/site-packages/mcp/server/fastmcp.py", line 16, in <module> raise ModuleNotFoundError(_MESSAGE, name=__name__) ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserver import MCPServer) and other APIs changed; see the migration guide at https://py.sdk.modelcontextprotocol.io/v2/migration/#fastmcp-renamed-to-mcpserver or pin 'mcp<2' to keep running v1 code.- Verdict
- Failed
server exited code 1
Install
claude mcp add mcp-python-interpreter -- uvx mcp-python-interpreter --dir /path/to/dir/pyinterpRun in your terminal. This exact command is what our harness runs in Claude Code; see the results above.
{
"mcpServers": {
"mcp-python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"/path/to/dir/pyinterp"
]
}
}
}Save as .cursor/mcp.json. This exact config is what our harness runs in Cursor; see the results above.
{
"mcpServers": {
"mcp-python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"/path/to/dir/pyinterp"
]
}
}
}Add to claude_desktop_config.json and restart Claude Desktop. Tested on the Linux beta; see the results above.
[mcp_servers.mcp-python-interpreter]
command = "uvx"
args = ["mcp-python-interpreter", "--dir", "/path/to/dir/pyinterp"]Add to ~/.codex/config.toml (shared by the ChatGPT (Codex) CLI and the ChatGPT desktop app; Codex runs inside the ChatGPT desktop app). Tested with the ChatGPT (Codex) CLI bundled in the ChatGPT desktop app; see the results above.
Not connecting? Troubleshooting: Claude Code · Cursor · Claude Desktop · ChatGPT (Codex)
Test history
| Date | Check | Result | Versions tested |
|---|---|---|---|
| 2026-10-22 | Protocol (direct stdio) | Protocol: failed | mcp-python-interpreter 1.2.3 |
| 2026-10-22 | ChatGPT (Codex) | Failed agent task failed (no successful call to this server's tools; answer missing ['42']; no tool result containing ['42']) | Codex CLI 0.162.0-alpha.17.2 · mcp-python-interpreter 1.2.3 |
| 2026-10-15 | Claude Code | Failed did not connect, so the agent task could not use it | Claude Code 2.1.296 · package version not recorded |
| 2026-10-15 | Cursor | Failed did not connect, so the agent task could not use it | Cursor CLI 2026.10.14-941492e · package version not recorded |
| 2026-10-15 | Protocol (direct stdio) | Protocol: failed server exited code 1 |