Runs Python code in the LocalPythonExecutor runtime from Hugging Face smolagents, which restricts allowed operations and imports.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add safe-local-python-executor -- uv --directory /path/to/mcp_local_python_executor/ run mcp_server.py~/.codex/config.toml
[mcp_servers.safe-local-python-executor]
command = "uv"
args = ["--directory", "/path/to/mcp_local_python_executor/", "run", "mcp_server.py"]
# codex mcp add safe-local-python-executor -- uv --directory /path/to/mcp_local_python_executor/ run mcp_server.py~/.cursor/mcp.json
{
"mcpServers": {
"safe-local-python-executor": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}.vscode/mcp.json
{
"servers": {
"safe-local-python-executor": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"safe-local-python-executor": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"safe-local-python-executor": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"safe-local-python-executor": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}