Python Local MCP Server

Runs Python code locally within an interactive REPL environment.

Local serverstdioPython 55

What is the Python Local MCP server?

Most developer tooling work still happens through a UI a human drives. Python Local MCP server moves it into the conversation instead. Runs Python code locally within an interactive REPL environment.

The short version

An MCP Server that provides an interactive Python REPL (Read-Eval-Print Loop) environment.

The tools it exposes

The server publishes 4 tools. What each one is for:

  • python_repl — Executes Python code in a persistent session
  • Resources — The server provides access to REPL session history: - Custom repl:// URI scheme for accessing session history - Each session's history can be viewed
  • Tools — The server implements one tool: - python_repl: Executes Python code in a persistent session - Takes code (Python code to execute) and session_id as
  • Debugging — Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the [MCP

Getting it running

The server ships on npm as @modelcontextprotocol/inspector, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What it needs from you

Configuration is passed through the environment: UV_PUBLISH_TOKEN. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Python Local's toolset — python_repl, Resources, Tools and 1 more — is a fair guide to whether it matches your workflow. It is maintained by Alec2435; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • 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.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
python_replExecutes Python code in a persistent session
ResourcesThe server provides access to REPL session history: - Custom repl:// URI scheme for accessing session history - Each session's history can be viewed as a text/plain resource - History shows input code and corresponding o
ToolsThe server implements one tool: - python_repl: Executes Python code in a persistent session - Takes code (Python code to execute) and session_id as required arguments - Maintains separate state for each session - Support
DebuggingSince MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).

How to install the Python Local MCP server

"mcpServers": {
    "python_local": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/python_local",
        "run",
        "python_local"
      ]
    }
  }

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
UV_PUBLISH_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • Use Python Local to python repl.
  • Use Python Local to Resources.
  • Use Python Local to Tools.

Frequently asked questions

Python Local is an MCP server that provides an interactive Python REPL (Read-Eval-Print Loop) environment. It allows you to run Python code locally and interact with it in real-time.