# Python Code Execution

> Use this tool when you need to execute Python code securely in a sandboxed environment, performing tasks such as data analysis or mathematical computations without risking the host system. It solves problems of secure code execution, dependency management, and error handling, accepting Python code as input and producing stdout/stderr and return values as output. Ideal for AI assistants requiring Python scripting capabilities, it provides a secure and isolated environment for code execution via stdio or HTTP transports.

Canonical page: https://skillsregistry.net/skills/run-python  
JSON: https://api.skillsregistry.net/v1/skills/run-python

## Description

MCP server implementation by Pydantic that provides secure Python code execution in a sandboxed environment using Pyodide running in Deno. The server offers a single `run_python_code` tool that executes Python code with dependency installation support, capturing stdout/stderr and return values while maintaining isolation from the host system. Built with TypeScript for the Deno runtime and Python for the client interface, it supports both stdio and HTTP transports, automatic dependency management through micropip, and includes comprehensive error handling for installation and runtime failures. Designed for AI assistants that need to perform data analysis, mathematical computations, or general Python scripting tasks without security risks to the underlying system.

## Trust

- **Trust score (0–1):** 0.50
- **Verification tier:** unverified

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** security
- **Updated:** 2026-04-29

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/run-python)
- **Repository:** <https://github.com/pydantic/mcp-run-python>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "run-python"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/run-python` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/run-python/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
