Loading...

Executes Python code snippets locally within a restricted environment, offering a safer alternative to direct evaluation for LLM-generated code.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
Executes Python code snippets locally within a restricted environment, offering a safer alternative to direct evaluation for LLM-generated code.
This executor provides a balance between convenience and security. It's safer than direct Python execution but less secure than containerized solutions. Use with caution, especially with untrusted code sources.
Performance is limited by the LocalPythonExecutor's overhead and the restricted environment. Complex or long-running code may be slow.
No direct cost, but excessive use can consume local resources.
npx -y @smithery/cli install @maxim-saplin/mcp_safe_local_python_executor --client claude{
"mcpServers": {
"safe-local-python-executor": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp_local_python_executor/",
"run",
"mcp_server.py"
]
}
}
}run_pythonExecutes a Python code snippet and returns the output.
Executes arbitrary code, even within a sandbox.
None
hybrid
This executor provides a balance between convenience and security. It's safer than direct Python execution but less secure than containerized solutions. Use with caution, especially with untrusted code sources.
The level of autonomy depends on how the 'run_python' tool is integrated into the agent's workflow and how prompts are constructed.
Production Tip
Implement timeouts and resource limits to prevent runaway code from consuming excessive resources.
Only a restricted set of standard libraries are available, preventing access to potentially dangerous functions.
It provides a degree of sandboxing, but it's not a substitute for full isolation like a VM or container.
While possible, it's strongly discouraged due to the inherent risks of executing untrusted code.
The execution will continue until manually stopped or a resource limit is reached, potentially freezing the application.
No, the execution environment is single-threaded.
No, only the pre-approved standard libraries are available.
The timeout is not configurable. You may need to implement your own timeout logic within the code.