Python Interpreter Mcp
@bimalpaudels
About Python Interpreter Mcp
A Model Context Server providing simple features to automate python script execution via LLMs.
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"interpreter": {
"command": "uvx",
"args": [
"python-interpreter-mcp"
]
}
}
}Tools
1Runs the given script with `uv run script.py`.
Overview
What is Python Interpreter Mcp?
Python Interpreter Mcp is a lightweight, experimental MCP server designed to execute arbitrary Python scripts in a structured and reproducible environment. It leverages uv to run isolated code snippets through subprocesses.
How to use Python Interpreter Mcp?
Install via uvx and configure in your MCP client. For example, add {"command": "uvx", "args": ["python-interpreter-mcp"]} to your Claude Desktop config, or use the MCPServerStdio class with the OpenAI Agents SDK. The server exposes a single tool run_script that takes a code string and returns the script’s stdout.
Key features of Python Interpreter Mcp
- Executes arbitrary Python scripts with
uv runfor dependency isolation - Saves scripts to a hidden folder in the current working directory
- Lightweight, single-tool interface (
run_script) - Designed for structured and reproducible execution
- Experimental – use only in trusted, sandboxed environments
Use cases of Python Interpreter Mcp
- Running user-provided Python snippets via an LLM or MCP client
- Safely testing short scripts inside an isolated subprocess
- Integrating code execution into AI workflows (e.g., OpenAI Agents SDK)
- Prototyping a sandboxed Python interpreter for development or education
FAQ from Python Interpreter Mcp
How does Python Interpreter Mcp run scripts?
It receives a script string, saves it as a .py file inside a hidden folder in the current working directory, then executes it with uv run to ensure dependency isolation. The stdout is captured and returned.
What tool does Python Interpreter Mcp provide?
It provides a single MCP tool named run_script which takes a code (string) input and returns the script’s stdout.
Are there any security concerns?
Yes – the server executes arbitrary Python code, which can run anything including malicious commands. It should only be used in trusted, sandboxed environments, and inputs must be validated and guardrailed when used with an LLM.
What runtime dependencies does Python Interpreter Mcp require?
It requires uv (the Python package installer from Astral) to run scripts via subprocesses.
Is Python Interpreter Mcp production‑ready?
No – this project is in a very early stage of development and is experimental.
More Other MCP servers
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
🪟 Windows-MCP
CursorTouchMCP Server for Computer Use in Windows
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
Awesome Mlops
visengerA curated list of references for MLOps
Comments