Run Python
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.
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
Maintainer
Works with
Installation
NPM
npx -y @pydantic/mcp-run-pythonPIP
pip install @pydantic/mcp-run-pythonManual Installation
npx -y @pydantic/mcp-run-pythonConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 | iexInstall 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-pythonConfigure your MCP client
Add the server to your MCP client configuration. The stdio transport mode is recommended for most clients.
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.
Run Python Alternatives — Similar Developer Tools Servers
Looking for alternatives to Run Python? 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 Run Python 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 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.