Python Interpreter Mcp
@bimalpaudels
关于 Python Interpreter Mcp
A Model Context Server providing simple features to automate python script execution via LLMs.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"interpreter": {
"command": "uvx",
"args": [
"python-interpreter-mcp"
]
}
}
}工具
1Runs the given script with `uv run script.py`.
概览
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.
其他 分类下的更多 MCP 服务器
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Nginx UI
0xJackyYet another WebUI for Nginx

EverArt
modelcontextprotocolModel Context Protocol Servers
Blender
ahujasidOpen-source MCP to use Blender with any LLM
Codelf
unbugA search tool helps dev to solve the naming things problem.
评论