MCP Directory

How to add PRIMS – Python Runtime Interpreter MCP Server to Cursor

Run arbitrary Python in a secure, throw-away sandbox from your LLM agent via a single run_code MCP tool. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 28 · http · no auth

Cursor config for PRIMS – Python Runtime Interpreter MCP Server

./scripts/setup_env.sh
{
  "mcpServers": {
    "prims-python-runtime-interpreter-mcp-server": {
      "url": "http://localhost:9000/mcp",
      "type": "streamable-http"
    }
  }
}

Remote server — no local install needed. Restart the client after saving the config.

Setup steps

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the PRIMS – Python Runtime Interpreter MCP Server config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of PRIMS – Python Runtime Interpreter MCP Server's tools to confirm it's connected.

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 Cursor

run_code

Execute user-supplied Python in an isolated, throw-away sandbox with optional pip dependencies and file mounts; streams back stdout/stderr.

list_dir

List files and directories inside your session workspace.

preview_file

Return up to 8 KB of a text file from your session workspace for quick inspection.

persist_artifact

Upload a file from your output/ directory to a client-provided presigned URL for permanent storage.

mount_file

Download 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 + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.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 Cursor?

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.

View repo Full PRIMS – Python Runtime Interpreter MCP Server page