
How to add PRIMS – Python Runtime Interpreter MCP Server to Claude Desktop
Run arbitrary Python in a secure, throw-away sandbox from your LLM agent via a single run_code MCP tool. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 · 28★ · http · no auth
Claude Desktop config for PRIMS – Python Runtime Interpreter MCP Server
./scripts/setup_env.sh{
"mcpServers": {
"prims-python-runtime-interpreter-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:9000/mcp"
]
}
}
}Claude Desktop connects to remote servers through the `mcp-remote` proxy (installed on first run via npx). Restart Claude Desktop after saving.
Setup steps
- 1Open Claude Desktop → Settings → Developer → Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the PRIMS – Python Runtime Interpreter MCP Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm PRIMS – Python Runtime Interpreter MCP Server's tools appear under the 🔌 tools menu.
Before you start
- Python
- A virtual environment created via scripts/setup_env.sh (or Docker)
What PRIMS – Python Runtime Interpreter MCP Server can do in Claude Desktop
run_codeExecute user-supplied Python in an isolated, throw-away sandbox with optional pip dependencies and file mounts; streams back stdout/stderr.
list_dirList files and directories inside your session workspace.
preview_fileReturn up to 8 KB of a text file from your session workspace for quick inspection.
persist_artifactUpload a file from your output/ directory to a client-provided presigned URL for permanent storage.
mount_fileDownload a remote file once per session into mounts/<path> so it can be reused across run_code calls without re-supplying the URL.
Security
Executes arbitrary user-supplied Python code. Each invocation runs in an isolated, throw-away virtual environment that is deleted after the call, but the server itself is alpha-stage and binds to 0.0.0.0:9000 by default — restrict network exposure accordingly. The persist_artifact tool uploads files to a client-provided presigned URL.
PRIMS – Python Runtime Interpreter MCP Server + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the PRIMS – Python Runtime Interpreter MCP Server config there under the "mcpServers" key and restart the client.
Is PRIMS – Python Runtime Interpreter MCP Server safe to use with Claude Desktop?
Executes arbitrary user-supplied Python code. Each invocation runs in an isolated, throw-away virtual environment that is deleted after the call, but the server itself is alpha-stage and binds to 0.0.0.0:9000 by default — restrict network exposure accordingly. The persist_artifact tool uploads files to a client-provided presigned URL.
How is code execution isolated?
Each run_code call spins up a fresh virtual environment, installs any requested pip packages, optionally mounts read-only files, runs the code, and then deletes the workspace.
What transport does it use?
MCP over streamable HTTP. Running python -m server.main binds the MCP endpoint at http://0.0.0.0:9000/mcp (clients connect to http://localhost:9000/mcp).
Can I run it in Docker?
Yes. The repo ships a Dockerfile and a scripts/docker_run.sh helper that builds and runs the server, printing the MCP URL when ready.