Skip to main content

Python REPL MCP Server

This MCP server provides a Python REPL (Read-Eval-Print Loop) as a tool. It allows execution of Python code through the MCP protocol with a persistent session.

Setup

No setup needed! The project uses uv for dependency management.

Running the Server

Simply run:

uv run src/python_repl/server.py

Usage with Claude Desktop

Add this configuration to your Claude Desktop config file:

{
  "mcpServers": {
    "python-repl": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/python-repl-server",
        "run",
        "mcp_python"
      ]
    }
  }
}

The server provides three tools:

  1. execute_python: Execute Python code with persistent variables

    • code: The Python code to execute
    • reset: Optional boolean to reset the session
  2. list_variables: Show all variables in the current session

  3. install_package: Install a package from pypi

Examples

Set a variable:

a = 42

Use the variable:

print(f"The value is {a}")

List all variables:

# Use the list_variables tool

Reset the session:

# Use execute_python with reset=true

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:

  • Report bugs
  • Suggest new features
  • Improve documentation
  • Add test cases
  • Submit code improvements

Before submitting a PR, please ensure:

  1. Your code follows the existing style
  2. You've updated documentation as needed
  3. Maybe write some tests?

For major changes, please open an issue first to discuss what you would like to change.

Metadata

Release files for iflow-mcp_mcp-python 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_mcp-python 0.1.3
File Size Uploaded
iflow_mcp_mcp_python-0.1.3.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_mcp-python 0.1.3
File Interpreter ABI Platform
iflow_mcp_mcp_python-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / iflow_mcp_mcp_python-0.1.3.tar.gz

Download URL iflow_mcp_mcp_python-0.1.3.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad3833361fd406dc05eadac122c8d6bd975573b67f9fb13f66e0d9cd211ca2cf
BLAKE2b-256 checksum
How to use checksums
07b83adb521514bd57f6a8eeb9be01faf446ef8da18a44787c1ab101182f7259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / iflow_mcp_mcp_python-0.1.3-py3-none-any.whl

Download URL iflow_mcp_mcp_python-0.1.3-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6197731f2d59c5d7dcbc970b0b842a200eac23e6fbcd79dc12a3f7bf776451ff
BLAKE2b-256 checksum
How to use checksums
d8eba1226f4cc1035d5233e9daa711f0eabcc4aa30a3982a07011c6c73fdfcd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page