Skip to main content
Glama
Python REPL MCP Server

Python REPL MCP Server

by hdresearch

Servidor MCP de Python REPL

Este servidor MCP proporciona un REPL (bucle de lectura-evaluación-impresión) de Python como herramienta. Permite la ejecución de código Python mediante el protocolo MCP con una sesión persistente.

Configuración

¡No requiere configuración! El proyecto utiliza uv para la gestión de dependencias.

Related MCP server: Python REPL MCP Server

Ejecución del servidor

Simplemente ejecute:

uv run src/python_repl/server.py

Uso con Claude Desktop

Agregue esta configuración a su archivo de configuración de Claude Desktop:

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

El servidor proporciona tres herramientas:

  1. execute_python : ejecuta código Python con variables persistentes

    • code : El código Python a ejecutar

    • reset : booleano opcional para restablecer la sesión

  2. list_variables : Mostrar todas las variables en la sesión actual

  3. install_package : Instalar un paquete desde pypi

Ejemplos

Establecer una variable:

a = 42

Utilice la variable:

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

Enumere todas las variables:

# Use the list_variables tool

Restablecer la sesión:

# Use execute_python with reset=true

Contribuyendo

¡Agradecemos sus contribuciones! No dude en enviar una solicitud de incorporación de cambios. Aquí tiene algunas maneras de contribuir:

  • Informar errores

  • Sugerir nuevas funciones

  • Mejorar la documentación

  • Agregar casos de prueba

  • Enviar mejoras de código

Antes de enviar una solicitud de relaciones públicas, asegúrese de:

  1. Su código sigue el estilo existente

  2. Ha actualizado la documentación según sea necesario

  3. ¿Tal vez escribir algunas pruebas?

Para realizar cambios importantes, primero abra un problema para discutir lo que le gustaría cambiar.

Available Tools

3 tools
execute_pythonB

Execute Python code and return the output. Variables persist between executions.

Inputs: code (required), reset.

install_packageB

Install a Python package using uv

Inputs: package (required).

list_variablesB

List all variables in the current session

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: execute_python runs code, install_package manages dependencies, and list_variables inspects the session state. An agent can easily tell them apart as they target different aspects of the Python REPL workflow.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (execute_python, install_package, list_variables) with clear, descriptive names. The naming convention is uniform throughout the set, making it predictable and easy to understand.

    Tool Count3/5

    With only 3 tools, the set feels thin for a Python REPL server, as it lacks operations like uninstalling packages, clearing variables, or handling errors. While the core functions are covered, the count is borderline low for the domain's typical scope.

    Completeness3/5

    The tools cover basic execution, package installation, and variable listing, but there are notable gaps: no way to update or remove packages, delete variables, or manage session state beyond listing. This could cause agent failures in more complex workflows.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A Python-based MCP server implementation that can be easily installed via pip or directly from GitHub, providing a simple way to deploy and run MCP server functionality.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides a persistent Python REPL session as a tool for executing code, managing files, installing packages, and initializing projects via the MCP protocol.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A production-grade MCP server providing a persistent Python REPL with multi-session support, sandboxing, and timeout protection, enabling LLM agents to execute Python code across multiple turns with variables that persist between calls.
      12
      21 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Async Python REPL + Shell execution for MCP. Provides persistent state, background jobs, interactive input() bridging, and crash isolation in a single server.
      1
      Apache 2.0