MCP Run Python logo

MCP Run Python

by pydantic/pydantic-ai

Runs Python code in a secure sandbox through MCP tool calls.

Install MCP Run Python

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for pydantic/pydantic-ai/mcp-run-python, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

pydantic/pydantic-ai/mcp-run-python is an MCP server for executing Python code inside a secure sandbox. MCP clients invoke the server through tool calls to request Python execution. It fits agents that need to run Python while keeping execution isolated from the surrounding environment.

Use cases

  • Run generated Python during an agent workflow
  • Evaluate Python calculations in an isolated environment
  • Delegate code execution from an MCP client
  • Test Python snippets without running them in the host process

Key features

  • Python code execution over MCP
  • Secure sandboxed runtime
  • Agent-accessible tool calls
  • Focused code execution capability

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

50/53 checks healthy over the last 92d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 10/6/2026 via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars21kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Run Python works

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

pydantic/pydantic-ai/mcp-run-python exposes Python execution through the Model Context Protocol. An MCP-compatible client can use tool calls to ask the server to run Python code in a secure sandbox.

The repository is part of the Pydantic AI project and is located under the mcp-run-python directory. Its focused role is code execution rather than general-purpose access to an external service or data system.

This makes it suitable for agent workflows where generated Python needs to be evaluated separately from the host process. The sandbox boundary is the defining property: Python runs within the execution environment provided by the server instead of directly in the client’s ordinary runtime.

How it works

An MCP client connects to the server and sends a tool call containing Python code for execution. The server handles that request in its secure sandbox. The client can then use the execution outcome as part of the agent’s workflow.

The MCP interface allows the code-running capability to be exposed to agents using the same tool-call model as other MCP servers. Applications should treat the server as an execution component and decide when generated or user-supplied Python should be sent to it.

Tools and capabilities

  • Execute Python code through MCP tool calls.
  • Run code inside a secure sandbox.
  • Provide Python execution as an agent-accessible MCP capability.

The server is a focused option for the Code Execution category. Reach for it when an agent needs Python evaluation and the execution should occur in a sandbox rather than directly in the host application.

Limitations and notes

The server’s scope is limited to Python execution through MCP. It should not be selected as a substitute for an MCP server that provides database access, web browsing, file management, or another specialized capability.

Sandboxed execution does not by itself describe which Python packages, filesystem locations, network operations, resource limits, or persistence behavior are available. Workflows that depend on those details should verify that the runtime environment matches their requirements before adopting it.

Because the server executes code supplied through agent tool calls, client applications should control which workflows can invoke it and should apply their own review or policy requirements to code execution.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Run Python

pydantic/pydantic-ai/mcp-run-python is an MCP server that connects MCP clients to a secure Python execution sandbox through tool calls. It lets agents request Python code execution as part of their workflows, keeping the execution capability separate from the client’s ordinary runtime.

It runs Python code submitted by an MCP client through a tool call. The requested code is handled inside the server’s secure sandbox, allowing an agent workflow to delegate Python execution rather than evaluating it directly in the host process.

Use it when an agent needs to execute Python in a secure sandbox. It is intended for Python code execution through MCP and is not a general-purpose server for databases, browsing, files, or other specialized integrations.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Run Python AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pydantic-pydantic-ai-mcp-run-python?style=directory)](https://allmcps.com/mcp/pydantic-pydantic-ai-mcp-run-python)
HTML Embed
<a href="https://allmcps.com/mcp/pydantic-pydantic-ai-mcp-run-python"><img src="https://allmcps.com/api/badge/pydantic-pydantic-ai-mcp-run-python?style=directory" alt="MCP Run Python on AllMCPs" /></a>