Skip to main content
Glama
aazizisoufiane

mcp-python-repl

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
REPL_HOSTNoHTTP host (when using HTTP transport)127.0.0.1
REPL_PORTNoHTTP port (when using HTTP transport)8000
REPL_SANDBOXNoEnable sandboxing (true/false)false
REPL_TIMEOUTNoMax execution time in seconds30
REPL_WORKDIRNoWorking directory for executionscwd
REPL_TRANSPORTNoTransport: stdio or streamable-httpstdio
REPL_MAX_OUTPUTNoMax stdout/stderr capture (bytes)1048576
REPL_SESSION_TTLNoSession expiry in minutes120
REPL_MAX_SESSIONSNoMaximum concurrent sessions50

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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. my_data, df).

The result variable is ONLY for returning output to the caller. It does NOT persist between calls — use named variables instead.

Correct workflow::

Call 1: data = load_csv("input.csv"); result = f"loaded {len(data)} rows"
Call 2: filtered = [r for r in data if r["active"]]; result = len(filtered)

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. pandas, requests>=2.31).

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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aazizisoufiane/mcp-python-repl'

If you have feedback or need assistance with the MCP directory API, please join our Discord server