云中江树/mcp-python-interpreter
Built by Metorial, the integration platform for agentic AI.
云中江树/mcp-python-interpreter
Server Summary
Execute Python code
Manage Python environments
List installed packages
Install new packages
Read text and binary files
Write text and binary files
Create Python functions
Debugging Python code
A Model Context Protocol (MCP) server that allows LLMs to interact with Python environments, read and write files, execute Python code, and manage development workflows.
You can install the MCP Python Interpreter using pip:
pip install mcp-python-interpreter
Or with uv:
uv install mcp-python-interpreter
claude_desktop_config.json
:{
"mcpServers": {
"mcp-python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"/path/to/your/work/dir",
"--python-path",
"/path/to/your/python"
],
"env": {
"MCP_ALLOW_SYSTEM_ACCESS": 0
},
}
}
}
For Windows:
{
"mcpServers": {
"python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"C:\\path\\to\\your\\working\\directory",
"--python-path",
"/path/to/your/python"
],
"env": {
"MCP_ALLOW_SYSTEM_ACCESS": 0
}
}
}
}
The --dir
parameter is required and specifies where all files will be saved and executed. This helps maintain security by isolating the MCP server to a specific directory.
uv
installed. If not, install it using:
curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy Bypass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"
The Python Interpreter provides the following tools:
Here are some examples of what you can ask Claude to do with this MCP server:
The MCP Python Interpreter now supports comprehensive file operations:
This MCP server has access to your Python environments and file system. Key security features include:
Always be cautious about running code or file operations that you don't fully understand.
MIT