mcp-python-repl
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| REPL_HOST | No | HTTP host (when using HTTP transport) | 127.0.0.1 |
| REPL_PORT | No | HTTP port (when using HTTP transport) | 8000 |
| REPL_SANDBOX | No | Enable sandboxing (true/false) | false |
| REPL_TIMEOUT | No | Max execution time in seconds | 30 |
| REPL_WORKDIR | No | Working directory for executions | cwd |
| REPL_TRANSPORT | No | Transport: stdio or streamable-http | stdio |
| REPL_MAX_OUTPUT | No | Max stdout/stderr capture (bytes) | 1048576 |
| REPL_SESSION_TTL | No | Session expiry in minutes | 120 |
| REPL_MAX_SESSIONS | No | Maximum concurrent sessions | 50 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| repl_run_codeA | Execute Python code with a PERSISTENT namespace. Variables you assign are STORED and available in subsequent calls.
Access them DIRECTLY by name (e.g. The Correct workflow:: Returns: JSON with execution result, new/modified variables, and namespace summary. |
| repl_run_fileA | Execute a Python file inside the persistent session. Variables defined in the file become available for later use. Args: params: File path, optional session ID, and optional CLI args. Returns: JSON with execution result, file metadata, and namespace summary. |
| repl_install_packageA | Install a Python package using pip (or uv if available). The package becomes importable in all sessions immediately. Args:
params: Package specifier (e.g. Returns: JSON with installation status and output. |
| repl_list_namespaceB | List all variables stored in a session's namespace. Returns: JSON with variable names, types, and preview values. |
| repl_get_variableA | Retrieve the full value of a variable from a session. Returns: JSON with the variable name, type, and serialized value. |
| repl_set_variableA | Set a variable in a session from a JSON string. Useful for injecting data from external sources. Returns: Confirmation with variable type and preview. |
| repl_delete_variableA | Delete a specific variable from a session's namespace. Returns: Confirmation with remaining variables. |
| repl_clear_namespaceA | Clear ALL variables from a session. Cannot be undone. Returns: Confirmation with list of cleared variables. |
| repl_list_sessionsA | List all active REPL sessions. Returns: JSON array of sessions with IDs, timestamps, and variable counts. |
| repl_delete_sessionB | Delete a session and all its data. Returns: Confirmation message. |
| repl_get_historyA | Get the last N execution records for a session. Useful for debugging what happened in previous calls. Returns: JSON array of execution records. |
| repl_server_statusA | Get current server status and configuration. Returns: JSON with Python version, session count, configuration, and limits. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 12 tools
Each tool targets a distinct operation: running code vs. running files, managing variables (list/get/set/delete/clear), managing sessions (list/delete), plus package installation, history, and server status. There is no overlap between tools; even run_code vs. run_file is clearly separated by input type.
All tools follow a 'repl_' prefix and mostly use verb_noun naming (run_code, list_namespace, get_variable, delete_session). The only deviation is 'repl_server_status', which uses noun_noun instead of verb_noun, but this is a minor inconsistency in an otherwise uniform pattern.
With 12 tools, the server is well-scoped for a Python REPL session manager. Each tool addresses a distinct need—execution, package management, namespace introspection, session lifecycle, history, and status—without redundancy or bloat, fitting comfortably in the ideal 3-15 range.
The tool surface covers core REPL workflows: running code, running files, installing packages, managing namespace variables, listing/deleting sessions, retrieving history, and server status. Minor gaps exist, such as no explicit 'create session' tool (though sessions appear to be implicit) and no batch execution or session renaming, but these are not critical for typical usage.