Python Runtime Interpreter
PRIMS is a lightweight, open-source Model Context Protocol (MCP) server that lets LLM agents safely execute arbitrary Python code in a secure, throw-away sandbox.
What is Python Runtime Interpreter?
Python Runtime Interpreter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to prims is a lightweight, open-source model context protocol (mcp) server that lets llm agents safely execute arbitrary python code in a secure, throw-away sandbox.
PRIMS is a lightweight, open-source Model Context Protocol (MCP) server that lets LLM agents safely execute arbitrary Python code in a secure, throw-away sandbox.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- PRIMS is a lightweight, open-source Model Context Protocol (
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx python-runtime-interpreter-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Python Runtime Interpreter
PRIMS (Python Runtime Interpreter MCP Server) is a lightweight open-source MCP server that lets LLM agents safely execute arbitrary Python code inside a secure, throw-away sandbox powered by FastMCP. It exposes five tools — run_code, list_dir, preview_file, persist_artifact, and mount_file — giving agents a full code-execution environment with session-scoped workspaces, optional Docker isolation, and the ability to mount remote files or upload results to presigned S3 URLs. Data scientists and developers use it to give AI agents real computation capabilities, from running analyses to generating plots and returning file artifacts.
Prerequisites
- Python 3.10 or later installed
- Docker installed (recommended for full sandbox isolation)
- Git to clone the repository
- An MCP-compatible client such as Claude Desktop or Claude Code
- Optional: presigned S3 URLs for persisting file artifacts out of the sandbox
Clone the repository
Clone PRIMS from GitHub — it is not currently published to PyPI and must be run from source.
git clone https://github.com/hileamlakB/Python-Runtime-Interpreter-MCP-Server.git
cd Python-Runtime-Interpreter-MCP-ServerSet up the Python environment
Run the provided setup script which creates a virtual environment and installs all dependencies.
chmod +x scripts/setup_env.sh
./scripts/setup_env.sh
source .venv/bin/activateStart the MCP server
Launch the server, which binds to http://0.0.0.0:9000/mcp by default. Keep this terminal open while using the server.
python -m server.mainAlternative: run with Docker
For maximum sandbox isolation, use the provided Docker run script instead of the Python virtual environment.
chmod +x scripts/docker_run.sh
./scripts/docker_run.shConfigure your MCP client
Point Claude Desktop or another MCP client at the running PRIMS server using Streamable HTTP transport.
{
"mcpServers": {
"python-runtime": {
"type": "http",
"url": "http://localhost:9000/mcp"
}
}
}Python Runtime Interpreter Examples
Client configuration
Connect Claude Desktop to a locally running PRIMS server via HTTP transport.
{
"mcpServers": {
"python-runtime": {
"type": "http",
"url": "http://localhost:9000/mcp"
}
}
}Prompts to try
Example prompts that use the Python sandbox tools.
- "Write and run a Python script that reads a CSV file and plots a histogram of the 'revenue' column"
- "Execute this numpy code and show me the output: import numpy as np; print(np.linalg.eigvals([[1,2],[3,4]]))"
- "Mount the file at https://example.com/data.csv into the sandbox and compute its row count"
- "Run a data cleaning script and upload the result to my S3 presigned URL"Troubleshooting Python Runtime Interpreter
Server fails to start with import errors or missing dependencies
Make sure you have activated the virtual environment with 'source .venv/bin/activate' before running 'python -m server.main'. Re-run setup_env.sh if dependencies are missing.
Code execution times out or sandbox is not isolated
Use the Docker-based setup via docker_run.sh for proper process isolation. The Docker container enforces resource limits that the plain Python environment does not.
persist_artifact fails when uploading files
The persist_artifact tool requires a presigned URL provided at call time. Ensure the presigned URL has not expired and that the sandbox has outbound internet access to reach the upload endpoint.
Frequently Asked Questions about Python Runtime Interpreter
What is Python Runtime Interpreter?
Python Runtime Interpreter is a Model Context Protocol (MCP) server that prims is a lightweight, open-source model context protocol (mcp) server that lets llm agents safely execute arbitrary python code in a secure, throw-away sandbox. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Python Runtime Interpreter?
Follow the installation instructions on the Python Runtime Interpreter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Python Runtime Interpreter?
Python Runtime Interpreter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Python Runtime Interpreter free to use?
Yes, Python Runtime Interpreter is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Python Runtime Interpreter Alternatives — Similar Developer Tools Servers
Looking for alternatives to Python Runtime Interpreter? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Python Runtime Interpreter in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Python Runtime Interpreter?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.