Runs LLM-generated Python locally through a restricted executor exposed as an MCP tool, without Docker or a VM.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Safe Local Python Executor.
The maxim-saplin/mcp_safe_local_python_executor MCP server makes a restricted Python runtime available to MCP-compatible applications. It wraps Hugging Face Smolagents' LocalPythonExecutor rather than invoking the regular Python interpreter directly. The exposed run_python tool is intended for code generated by an LLM and supports tasks such as calculations, generating number sequences, and solving equations.
The project is designed for local use. It does not depend on Docker or a virtual machine, and it can add a Python execution tool to clients such as Claude Desktop and Cursor. The maxim-saplin/mcp_safe_local_python_executor MCP server is therefore relevant when an agent needs an embedded code interpreter for straightforward computation without sending code to a third-party runtime.
The server communicates over MCP's stdio transport. When started, it uses LocalPythonExecutor from the Smolagents framework to process Python supplied through the MCP tool. This executor is intended to provide more control than directly evaluating arbitrary Python code.
Execution disallows file I/O operations. Imports are limited to the following modules: collections, datetime, itertools, math, queue, random, re, stat, statistics, time, and unicodedata. This restriction makes the runtime more constrained than a normal local Python environment, so scripts that depend on other packages, filesystem access, or broader operating-system functionality are not suitable.
The restrictions should not be treated as equivalent to a VM or container boundary. The project documentation describes the local executor as a security and convenience compromise, and recommends stronger isolation approaches when the risk of running generated code warrants them.
Install uv, clone the repository, and change into the project directory. Running uv run mcp_server.py creates the virtual environment as needed and installs the listed dependencies, including Smolagents and MCP. The same command starts the stdio server.
For Claude Desktop, add an MCP server entry whose command is uv, with arguments that select the cloned project directory and run mcp_server.py. The directory value must point to the local checkout; the example path in the project documentation is a placeholder. Restart Claude Desktop after saving the configuration. The Python executor should then appear as an available tool.
The maxim-saplin/mcp_safe_local_python_executor MCP server does not document API keys, OAuth credentials, or required environment variables. It is operated from the local Python environment created by uv.
run_python.This is not a general-purpose Python environment. The import allowlist and disabled file operations prevent many scripts from running, and the documentation does not claim complete security isolation. Generated code still runs on the user's machine, so users should assess the risks of allowing an agent to execute code locally. A Docker container or VM may be a better choice when stronger separation is required, although those approaches add setup and resource costs.
The maxim-saplin/mcp_safe_local_python_executor MCP server is provided as a local stdio process rather than a hosted execution service. Its documented installation flow requires the repository and uv; no hosted endpoint or external execution account is described.
Always refer to the official documentation for the most accurate and up-to-date information.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/maxim-saplin-mcp-safe-local-python-executor)<a href="https://allmcps.com/mcp/maxim-saplin-mcp-safe-local-python-executor"><img src="https://allmcps.com/api/badge/maxim-saplin-mcp-safe-local-python-executor?style=directory" alt="MCP Safe Local Python Executor on AllMCPs" /></a>