by yzfly
MCP Python Interpreter: run python code. Python-mcp-server, mcp-python-server, Code Executor
# Add to your Claude Code skills
git clone https://github.com/yzfly/mcp-python-interpreterGuides for using mcp servers skills like mcp-python-interpreter.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
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