Run Python code, manage Python environments and work with files.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add python-interpreter --env MCP_ALLOW_SYSTEM_ACCESS='<MCP_ALLOW_SYSTEM_ACCESS>' -- uvx mcp-python-interpreter --dir /path/to/your/work/dir --python-path /path/to/your/python~/.codex/config.toml
[mcp_servers.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 = "<MCP_ALLOW_SYSTEM_ACCESS>" }
# codex mcp add python-interpreter --env MCP_ALLOW_SYSTEM_ACCESS='<MCP_ALLOW_SYSTEM_ACCESS>' -- uvx mcp-python-interpreter --dir /path/to/your/work/dir --python-path /path/to/your/python~/.cursor/mcp.json
{
"mcpServers": {
"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": "<MCP_ALLOW_SYSTEM_ACCESS>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"python-interpreter": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"/path/to/your/work/dir",
"--python-path",
"/path/to/your/python"
],
"env": {
"MCP_ALLOW_SYSTEM_ACCESS": "<MCP_ALLOW_SYSTEM_ACCESS>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"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": "<MCP_ALLOW_SYSTEM_ACCESS>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"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": "<MCP_ALLOW_SYSTEM_ACCESS>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"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": "<MCP_ALLOW_SYSTEM_ACCESS>"
}
}
}
}Environment variables
MCP_ALLOW_SYSTEM_ACCESS
Replace the placeholders with your own credentials and keep them out of version control.