# Python Interpreter

Python Interpreter — an MCP server that runs Python snippets with stateful session memory. It retains imports, variables, and calculations across tool calls.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: akuadane
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/akuadane/mcp-code-interpreter
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/python-interpreter

## What it does

This server supplies an AI agent with the `execute_code` tool to run Python commands interactively. Instead of terminating after each snippet, the execution runtime mimics a Jupyter notebook. Every variable, imported library, and function stays in memory for subsequent steps. The agent can verify its logic before returning output to you.

Running it locally via `uv` executes commands directly on your machine. To isolate executions from the host system, the author recommends the Docker MCP Toolkit with a volume mapped to `/app/notebooks`.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- run Python snippets directly through model tool calls
- retain state, imports, and variables across separate prompts
- let the model test code output before writing the final solution
- isolate script execution inside a Docker container

## Example prompts
- Calculate 50 factorial using `execute_code` and store it in variable `n`
- Use the variable `n` from the previous step and convert it to string
- Define a data cleanup function and verify it with sample inputs

## Similar
- [python-uv](https://affpapa.org/en/nevibecode/skills/python-uv.md) — skill · 1000 installs
- [python-pro](https://affpapa.org/en/nevibecode/skills/python-pro.md) — skill · 399 installs
- [jupyter-notebook](https://affpapa.org/en/nevibecode/skills/jupyter-notebook.md) — skill · 6100 installs
- [modern-python](https://affpapa.org/en/nevibecode/skills/modern-python.md) — skill · 9700 installs
- [python-cursorrules-prompt-file-best-practices](https://affpapa.org/en/nevibecode/rules/python-cursorrules-prompt-file-best-practices.md) — rule · ★ 41178 repo stars
- [python-development](https://affpapa.org/en/nevibecode/skills/python-development.md) — skill · ★ 173 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
