# Python Code Interpreter

> Use this tool when you need to execute Python code, install packages, or run Python files in a secure and isolated environment. It solves problems related to data analysis, mathematical calculations, and package management by providing a controlled space for Python scripting tasks. With inputs of Python code or files and outputs of execution results and variable extracts, it is ideal for AI assistants requiring flexible and reliable Python execution capabilities.

Canonical page: https://skillsregistry.net/skills/shibing624-python-code-interpreter  
JSON: https://api.skillsregistry.net/v1/skills/shibing624-python-code-interpreter

## Description

A Python-based MCP server by XuMing that provides a secure code interpreter for executing Python code, installing packages via pip, and running Python files in isolated environments. Built using FastMCP with comprehensive error handling and variable return capabilities, it offers four core tools: direct code execution with optional variable extraction, file-based code saving and execution with overwrite protection, package installation management, and existing Python file execution. The implementation uses temporary directories for isolation and maintains persistent execution contexts, making it valuable for AI assistants that need to perform data analysis, mathematical calculations, package management, and general Python scripting tasks in a controlled environment.

## Trust

- **Trust score (0–1):** 0.88
- **Verification tier:** verified
- **Last scanned:** 2026-09-28

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** productivity
- **Updated:** 2026-09-28

## Source

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

## 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": "shibing624-python-code-interpreter"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/shibing624-python-code-interpreter` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/shibing624-python-code-interpreter/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
