Python Code Interpreter

Provides a secure Python code interpreter for executing code, installing packages, and running files in isolated environments with

shibing624 8 ↓ 1.5k
Claude CodeClaude DesktopGeneric
View source ↗

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.

Source

Repository: https://github.com/shibing624/mcp-run-python-code

Maintain Python Code Interpreter?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Python Code Interpreter on getagentictools](https://getagentictools.com/mcp/shibing624-mcp-run-python-code?ref=badge)