The restricted import list is the whole design: arithmetic, dates, regex and statistics work, while file access and everything else does not. That makes it right for calculations and one-off scripting, and wrong for anything that needs to read your disk or hit the network — for those, a VM is still the honest answer.
A stdio server that wraps Hugging Face's LocalPythonExecutor from smolagents — a restricted Python runtime built for running code an LLM produced.
- run_python — one tool that executes a snippet and returns the result
- No file I/O: the executor refuses filesystem operations outright
- Imports limited to a fixed list — collections, datetime, itertools, math, queue, random, re, stat, statistics, time, unicodedata
- Runs locally under uv in a project venv, so there is no container to build and no remote runtime to sign up for
Uv, and a clone of the repository. The server starts with uv run mcp_server.py, which creates the venv and pulls smolagents and mcp on first launch. No account, no API key.
One command — npx -y @smithery/cli install @maxim-saplin/mcp_safe_local_python_executor --client claude
