Python Runtime Interpreter

v1.0.0Developer Toolsstable

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.

agentsdockerfastmcpllmmcp
Share:
27
Stars
0
Downloads
0
Weekly
0/5

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

Execute Python code
Secure sandbox
Lightweight and open-source
hileamlakB

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedJan 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx python-runtime-interpreter-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-Server
2

Set 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/activate
3

Start 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.main
4

Alternative: 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.sh
5

Configure 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.

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.

Quick Config Preview

{ "mcpServers": { "python-runtime-interpreter-mcp-server": { "command": "npx", "args": ["-y", "python-runtime-interpreter-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides