Python REPL

Python REPL is an MCP server that provides an interactive Python Read-Eval-Print Loop with persistent session state and automatic dependency management via uv. It connects Model Context Protocol clients directly to a local Python execution runtime, allowing AI agents to evaluate code snippets iteratively while retaining defined variables and imported modules across calls. Developers, data analysts, and AI practitioners use it to execute multi-step calculations, test algorithms, and prototype scripts without losing runtime context between queries. In addition to running arbitrary Python scripts, the server enables language models to inspect currently active session variables and install new packages directly from PyPI on demand. By maintaining environment persistence, it avoids the overhead of reloading libraries or re-evaluating heavy code segments during conversational agent workflows. The server handles package resolutions through uv, requiring minimal setup and offering an environment for running Python execution tasks within supported MCP client configurations.

Category: AI & LLM Tooling

Tags: execution, python, repl, scripting, uv

Visit Python REPL

How to install and configure Python REPL

  1. Ensure uv is installed on your system to manage Python dependencies automatically. 2. Clone the repository to a local directory: https://github.com/hdresearch/mcp-python. 3. Open your Claude Desktop configuration file and add the server definition under mcpServers: json { "mcpServers": { "python-repl": { "command": "uv", "args": [ "--directory", "/absolute/path/to/python-repl-server", "run", "mcp_python" ] } } } 4. Replace /absolute/path/to/python-repl-server with your real directory path. 5. Save the configuration and restart Claude Desktop.

What you can do with Python REPL

  • Running iterative Python calculations where subsequent operations depend on variables and objects defined in previous execution steps. - Installing third-party libraries dynamically from PyPI to test specialized data transformations or mathematical packages. - Inspecting the active execution environment by retrieving a complete list of currently defined session variables. - Resetting the interactive Python runtime state on demand to start a fresh environment for independent scripting tasks.

Key facts

  • Open Source
  • https://github.com/hdresearch/mcp-python
  • AI & LLM Tooling, Developer Tools & Code Intelligence
  • execution, python, repl, scripting, uv

Part of MCP Servers

Related MCP servers

  • MCP LaTeX Server — MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through…
  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP Jupyter Complete — MCP Jupyter Complete is an MCP server that provides tools for manipulating Jupyter notebook files through position-based cell operations and…
  • MCP LSP Go — MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls,…
  • MCP Memory Dashboard — MCP Memory Dashboard is an MCP server desktop interface that connects to the MCP Memory Service to provide visual semantic…
  • MCP Manager — MCP Manager is an MCP server management tool that connects directly to your Claude Desktop environment, enabling users to discover,…

What can Python REPL do?

Python REPL provides a persistent Python runtime for MCP clients. It allows executing arbitrary Python code, preserving variables across multiple executions, listing all active session variables, resetting the execution session, and dynamically installing external packages from PyPI using uv.

How do I install Python REPL?

You can clone the repository from GitHub and configure your client to run it via uv. In your Claude Desktop config file, set the command to uv and pass the directory path, run command, and mcp_python argument to launch the server.

Which MCP clients work with Python REPL?

Python REPL works with Claude Desktop and any standard Model Context Protocol client capable of launching local command-line processes via standard input and output.

Is Python REPL open source?

Yes, Python REPL is open-source software available on GitHub under the hdresearch/mcp-python repository, where users can report issues, propose enhancements, or contribute code improvements.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories