Run Python

v1.0.0Developer Toolsstable

Enables secure execution of Python code in a sandboxed WebAssembly environment using Pyodide and Deno. Automatically handles package management and captures complete execution results including stdout, stderr, and return values.

mcp-run-pythonmcpai-integration
Share:
192
Stars
0
Downloads
0
Weekly
0/5

What is Run Python?

Run Python is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables secure execution of python code in a sandboxed webassembly environment using pyodide and deno. automatically handles package management and captures complete execution results including stdout...

Enables secure execution of Python code in a sandboxed WebAssembly environment using Pyodide and Deno. Automatically handles package management and captures complete execution results including stdout, stderr, and return values.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables secure execution of Python code in a sandboxed WebAs

Use Cases

Execute Python code in a secure WebAssembly sandbox.
Auto-handle package management with Pyodide.
Capture complete execution results including stdout and errors.
pydantic

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @pydantic/mcp-run-python

PIP

pip install @pydantic/mcp-run-python

Manual Installation

npx -y @pydantic/mcp-run-python

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 Run Python

MCP Run Python enables AI assistants to execute Python code safely inside a WebAssembly sandbox powered by Pyodide running under Deno. It automatically detects and installs required packages, captures stdout, stderr, and return values, and supports async code execution — all without any risk of the sandboxed code affecting the host system. It is the standard execution backend used by Pydantic AI agents that need reliable, isolated Python evaluation as part of agentic workflows.

Prerequisites

  • Deno runtime installed — download from https://deno.com/
  • Python is NOT required on the host — Pyodide ships Python inside the WebAssembly sandbox
  • uvx (the uv toolchain) for the recommended installation method — install via `pip install uv`
  • An MCP-compatible client such as Claude Desktop, Claude Code, or a Pydantic AI agent
1

Install Deno

Deno is the runtime that hosts the Pyodide WebAssembly environment. Install it using the official installer.

# macOS / Linux
curl -fsSL https://deno.land/install.sh | sh

# Windows (PowerShell)
irm https://deno.land/install.ps1 | iex
2

Install mcp-run-python

Install the package via pip or uv. You can also run it ephemerally via uvx without installing.

# Install with pip
pip install mcp-run-python

# Or install with uv
uv add mcp-run-python
3

Configure your MCP client

Add the server to your MCP client configuration. The stdio transport mode is recommended for most clients.

4

Test code execution

Ask your AI assistant to run a simple Python snippet. A successful response shows the captured output.

Run Python Examples

Client configuration

MCP configuration using uvx to run the server in stdio mode. Deno must be installed and on your PATH.

{
  "mcpServers": {
    "mcp-run-python": {
      "command": "uvx",
      "args": ["mcp-run-python@latest", "stdio"]
    }
  }
}

Prompts to try

Example prompts for running Python code through the MCP sandboxed executor.

- "Run this Python snippet and show me the output: import math; print(math.pi ** 2)"
- "Execute the following data analysis code using pandas and numpy, then summarize the results"
- "Write and run a Python function that computes the Fibonacci sequence up to n=20"
- "Run this async Python code and capture any errors: import asyncio; await asyncio.sleep(1); print('done')"
- "Install the 'requests' package inside the sandbox and fetch the title of https://example.com"

Troubleshooting Run Python

Server fails to start with 'deno: command not found'

Deno is a required runtime dependency. Install it from https://deno.com/ and ensure the `deno` binary is in your PATH. Run `deno --version` to verify.

Package installation inside the sandbox fails

Pyodide only supports packages available in its curated package list or pure-Python packages from PyPI. Packages with C extensions that are not pre-compiled for Pyodide (e.g., some ML libraries) may not install. Check the Pyodide package list at https://pyodide.org/en/stable/usage/packages-in-pyodide.html.

Code execution times out for long-running scripts

The server has a default execution timeout. For scripts that need more time, configure the timeout using the `--port` flag when running in HTTP mode. For Pydantic AI integration, set the `timeout` parameter in the MCPServerStdio constructor.

Frequently Asked Questions about Run Python

What is Run Python?

Run Python is a Model Context Protocol (MCP) server that enables secure execution of python code in a sandboxed webassembly environment using pyodide and deno. automatically handles package management and captures complete execution results including stdout, stderr, and return values. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Run Python?

Install via npm with the command: npx -y @pydantic/mcp-run-python. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Run Python?

Run Python works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Run Python free to use?

Yes, Run Python is open source and available under the MIT License 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": { "mcp-run-python": { "command": "npx", "args": ["-y", "@pydantic/mcp-run-python"] } } }

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

Read the full setup guide →

Ready to use Run Python?

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