MCP Safe Local Python Executor MCP Server

Be careful with execution of code produced by LLM on your machine, stay away from MCP servers that run Python via command line or using `eval()`. The

Local serverstdioPython

What is the MCP Safe Local Python Executor MCP server?

If you already use MCP Safe Local Python Executor, the mcp safe local python executor mcp server is the piece that lets your assistant work with it directly. Be careful with execution of code produced by LLM on your machine, stay away from MCP servers that run Python via command line or using eval(). The safest option is using a VM or a docker container, though it requires some effort to.

What the server does

  • Exposes run_python tool
  • Safer execution of Python code compared to direct use of Python eva()l
  • Ran via uv in Python venv
  • No file I/O ops are allowed
  • Restricted list of imports

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • collections — datetime
  • itertools — math
  • queue — random
  • stat — statistics
  • time — unicodedata
  • macOS — ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows — %APPDATA%\Claude\claude_desktop_config.json

Installation

Installation goes through your MCP client rather than a global install: point it at @smithery/cli on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Where it fits

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. MCP Safe Local Python Executor's toolset — collections, itertools, queue and 4 more — is a fair guide to whether it matches your workflow. It is maintained by maxim-saplin; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
collectionsdatetime
itertoolsmath
queuerandom
statstatistics
timeunicodedata
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

How to install the MCP Safe Local Python Executor MCP server

{
  "mcpServers": {
    "safe-local-python-executor": {
      "command": "npx",
      "args": ["-y", "@smithery/cli"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Example prompts to try

  • Use MCP Safe Local Python Executor to collections.
  • Use MCP Safe Local Python Executor to itertools.
  • Use MCP Safe Local Python Executor to queue.

Frequently asked questions

It connects MCP Safe Local Python Executor to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (collections, itertools, queue, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP Safe Local Python Executor directly.