# pydantic/pydantic-ai/mcp-run-python [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/pydantic/pydantic-ai/tree/main/mcp-run-python  
**GitHub Stars:** 20903  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pydantic-pydantic-ai-mcp-run-python

## Description
Run Python code in a secure sandbox via MCP tool calls

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What pydantic/pydantic-ai/mcp-run-python does

pydantic/pydantic-ai/mcp-run-python exposes Python code execution through the Model Context Protocol. Its defining capability is running Python inside a secure sandbox, allowing an MCP client or agent to request execution through tool calls rather than handling Python directly in the surrounding application.

The server belongs to the Code Execution category and is intended for workflows where an agent needs to run Python as part of its reasoning or task handling. The repository is located within the PydanticAI project under `mcp-run-python`.

## How it works

An MCP client connects to the server and invokes its Python execution capability through MCP tool calls. The requested Python code runs in the server's secure sandbox. This separates code execution from the client-side agent workflow and provides an MCP-compatible interface for applications that support tool use.

The server is therefore most relevant when Python execution needs to be exposed as an agent tool. It can be considered wherever an MCP-based application needs to submit Python code for sandboxed execution.

## Tools and capabilities

- Execute Python code through MCP tool calls.
- Run code inside a secure sandbox.
- Provide Python execution to MCP-compatible agent workflows.

## Limitations and notes

The security boundary described for this server is its sandboxed execution environment. Use it for workflows that need Python execution through MCP; the server's defining scope is code execution rather than a general-purpose collection of external service integrations.

The server should be evaluated alongside the MCP client and deployment environment used by the agent. Its role is to provide the execution endpoint, while the client is responsible for initiating MCP tool calls.

_Full upstream README: https://allmcps.com/mcp/pydantic-pydantic-ai-mcp-run-python/readme_

