Skip to main content
Glama
aazizisoufiane

mcp-python-repl

🐍 mcp-python-repl

A production-grade MCP server providing a persistent Python REPL with multi-session support, sandboxing, and timeout protection.

Built for LLM agents that need to execute Python code across multiple turns with variables that persist between calls.

✨ Features

Feature

Description

Multi-session

Isolated sessions with unique IDs β€” run parallel workflows

Persistent namespace

Variables survive across calls within a session

Timeout protection

Configurable execution timeout (SIGALRM on Unix)

Sandboxing

Optional mode blocks dangerous modules (subprocess, socket, etc.)

Package install

Install pip packages on-the-fly (prefers uv for speed)

File execution

Run .py files inside the persistent session

Dual transport

stdio (local) and streamable-http (remote)

Full introspection

List variables, get history, check server status

Env-based config

All settings via REPL_* environment variables

Related MCP server: production-grade-mcp-agentic-system

πŸš€ Quick Start

With Claude Desktop / Cursor (stdio)

Add to your MCP config:

{
  "mcpServers": {
    "python-repl": {
      "command": "uvx",
      "args": ["mcp-python-repl"]
    }
  }
}

With uv (local dev)

# Clone and run
git clone https://github.com/soufiane-aazizi/mcp-python-repl.git
cd mcp-python-repl
uv run mcp-python-repl

HTTP transport (remote / multi-client)

REPL_TRANSPORT=streamable-http REPL_PORT=8000 uv run mcp-python-repl

πŸ› οΈ Tools

Code Execution

Tool

Description

repl_run_code

Execute Python code with persistent namespace

repl_run_file

Execute a .py file in the session

repl_install_package

Install a pip package (uses uv if available)

Namespace Management

Tool

Description

repl_list_namespace

List all variables in a session

repl_get_variable

Get the full value of a variable

repl_set_variable

Inject a variable from JSON

repl_delete_variable

Delete a specific variable

repl_clear_namespace

Clear all variables in a session

Session Management

Tool

Description

repl_list_sessions

List all active sessions

repl_delete_session

Delete a session and its data

Debugging

Tool

Description

repl_get_history

Get execution history for a session

repl_server_status

Server config, Python version, session count

πŸ”„ How Persistence Works

Call 1:  repl_run_code(code="data = [1,2,3]; total = sum(data); result = total")
         β†’ returns: {"result": 6, "session_id": "a1b2c3d4e5f6", "new_variables": ["data", "total"]}

Call 2:  repl_run_code(code="doubled = [x*2 for x in data]; result = doubled", session_id="a1b2c3d4e5f6")
         β†’ returns: {"result": [2,4,6], "new_variables": ["doubled"]}

Important: The result variable is for returning output to the caller. It does NOT persist. Use named variables instead.

βš™οΈ Configuration

All settings are configurable via environment variables:

Variable

Default

Description

REPL_TIMEOUT

30

Max execution time in seconds

REPL_MAX_SESSIONS

50

Maximum concurrent sessions

REPL_SESSION_TTL

120

Session expiry in minutes

REPL_MAX_OUTPUT

1048576

Max stdout/stderr capture (bytes)

REPL_SANDBOX

false

Enable sandboxing (true/false)

REPL_TRANSPORT

stdio

Transport: stdio or streamable-http

REPL_HOST

127.0.0.1

HTTP host (when using HTTP transport)

REPL_PORT

8000

HTTP port (when using HTTP transport)

REPL_WORKDIR

cwd

Working directory for executions

Sandbox Mode

When REPL_SANDBOX=true, the following modules are blocked:

subprocess, shutil, ctypes, socket, http.server, xmlrpc, ftplib, smtplib, telnetlib, webbrowser

And the following builtins are removed: exec, eval, compile, __import__ (replaced with a restricted version).

πŸ§ͺ Development

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest -v

# Lint
uv run ruff check src/ tests/

# Test with MCP Inspector
npx @modelcontextprotocol/inspector uv run mcp-python-repl

πŸ“¦ Project Structure

mcp-python-repl/
β”œβ”€β”€ src/mcp_python_repl/
β”‚   β”œβ”€β”€ __init__.py       # Package metadata
β”‚   β”œβ”€β”€ config.py         # Env-based configuration
β”‚   β”œβ”€β”€ session.py        # Multi-session manager with TTL
β”‚   β”œβ”€β”€ executor.py       # Python code executor (timeout + sandbox)
β”‚   └── server.py         # MCP server with all tools
β”œβ”€β”€ tests/
β”‚   └── test_core.py      # Unit + integration tests
β”œβ”€β”€ pyproject.toml        # uv/hatch project config
β”œβ”€β”€ LICENSE               # MIT
└── README.md

πŸ“„ License

MIT β€” See LICENSE.

Available Tools

12 tools
repl_clear_namespaceA
DestructiveIdempotent

Clear ALL variables from a session. Cannot be undone.

Returns: Confirmation with list of cleared variables.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description explicitly warns 'Cannot be undone,' which reinforces the destructiveHint annotation and discloses irreversibility. It also states the return value (confirmation with list of cleared variables), adding useful behavioral context beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action and a critical warning. There is no filler, and the return value is clearly stated in a structured format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple destructive tool, the description covers what is cleared, irreversibility, and the return format. It lacks an explicit mention that the operation targets the specified session_id, but this is inferable from the schema and tool name.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention session_id or provide any additional parameter-level semantics. The input schema's 'Target session ID' is the only guidance, and with schema description coverage reported as 0%, the description fails to compensate for parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Clear' with the resource 'ALL variables from a session,' clearly distinguishing it from sibling tools like repl_delete_variable (single variable) and repl_list_namespace (listing). This is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the use caseβ€”clearing the entire session namespaceβ€”but does not explicitly state when to prefer this tool over alternatives such as repl_delete_variable for individual variables. It also does not mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_delete_sessionB
DestructiveIdempotent

Delete a session and all its data.

Returns: Confirmation message.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description adds value by specifying 'all its data' as the deletion scope. However, it does not disclose other behavioral traits like irreversibility or any prerequisites, which would be useful for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, comprising just two short sentences with no redundant information. It is front-loaded with the core action and includes a brief return-value note, every word earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple destructive tool with one parameter, the description adequately states what it does and the return type, while annotations cover the safety profile. However, it lacks usage guidance and any warning about consequences, making it minimally sufficient but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% per the context signal, and the tool description does not mention the session_id parameter at all. Although the param name is self-explanatory given the tool name, the description fails to compensate for the low coverage, so the agent must rely on the schema's minimal 'Target session ID' description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'delete' with a clear resource 'session' and scope 'all its data', effectively distinguishing it from sibling tools like repl_delete_variable and repl_clear_namespace. The purpose is unambiguous and directly actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as repl_clear_namespace or repl_delete_variable. There are no exclusions, prerequisites, or contextual recommendations, leaving the agent to infer usage solely from the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_delete_variableA
DestructiveIdempotent

Delete a specific variable from a session's namespace.

Returns: Confirmation with remaining variables.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and idempotentHint=true. The description adds that it returns confirmation with remaining variables, which is useful context beyond annotations. However, it does not disclose other behaviors such as error handling or side effects beyond the annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two sentences long, front-loads the action, and includes the return value. Every sentence adds value with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, and the annotations (destructiveHint, idempotentHint) plus the output schema cover much of the behavioral context. The description adequately states the result (confirmation with remaining variables). It lacks only parameter details, but the schema provides the required arguments. The description is complete enough for selecting and invoking the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention the parameters session_id or var_name, and the schema description coverage is 0%. The schema provides minimal descriptions ('Variable name.' and 'Session ID.'), but the tool description adds no additional semantic meaning. Since coverage is low, the description was expected to compensate but did not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Delete' with a clear resource ('a specific variable from a session's namespace'). This clearly distinguishes it from sibling tools like repl_get_variable, repl_set_variable, and repl_clear_namespace.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus alternatives. It does not mention, for example, that repl_clear_namespace should be used to delete all variables, or any other usage context. The purpose is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_get_historyA
Read-onlyIdempotent

Get the last N execution records for a session.

Useful for debugging what happened in previous calls.

Returns: JSON array of execution records.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds behavioral context by stating the return format ('JSON array of execution records') and session scoping. This goes beyond the annotation hints and clarifies what the agent can expect, though it could mention limits like last_n maximum.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise: three brief sections that state what it does, when to use it, and what it returns. Every sentence adds value and the structure is front-loaded with the primary purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only retrieval tool, the description provides sufficient context: it names the action, the use case, and the return format. The annotations cover safety, and the schema covers parameters. It could mention that session_id is required or that last_n has a maximum, but these are not essential given the schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description conceptually refers to 'last N' and 'session', aligning with the parameters last_n and session_id. However, it does not specify required vs optional, defaults, or minimum/maximum values. With schema description coverage at 0%, the description only partially compensates for the lack of parameter detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get the last N execution records for a session', which specifies the action (get), resource (execution records), and scope (session). This distinguishes it from sibling tools like repl_run_code or repl_get_variable, making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes 'Useful for debugging what happened in previous calls', giving a clear context for when to use the tool. It does not explicitly mention when not to use it or alternative tools, but the intended scenario is well conveyed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_get_variableA
Read-onlyIdempotent

Retrieve the full value of a variable from a session.

Returns: JSON with the variable name, type, and serialized value.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds behavioral context by stating the return format: 'JSON with the variable name, type, and serialized value.' This goes beyond the annotations (readOnlyHint, idempotentHint, destructiveHint) and helps the agent understand what to expect. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise: one sentence stating the action and a brief 'Returns:' line. It is front-loaded with the purpose, contains no fluff, and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple nature of the tool, the description is sufficiently complete. It states the purpose, return format, and the annotations cover safety (read-only, idempotent, non-destructive). It does not mention error cases or session validity, but these are not critical for a basic get by ID operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for the top-level parameter, but the nested schema provides descriptions for var_name and session_id. The description mentions 'variable' and 'session' which adds some semantic context, but it does not explicitly explain the params object or the relationship between the two fields. Description partially compensates for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Retrieve the full value of a variable from a session.' It uses a specific verb ('retrieve') and resource ('variable from a session'), which distinguishes it from related tools like repl_set_variable or repl_delete_variable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. While the verb 'retrieve' implies reading, there is no mention of use cases, exclusions, or comparisons to sibling tools like repl_list_namespace. The description lacks context for choosing this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_install_packageA
Idempotent

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, idempotentHint=true, and destructiveHint=false. The description adds useful behavior beyond annotations: the package is importable in all sessions immediately and uses pip or uv if available. That is meaningful behavioral context for a simple install tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences plus a minimal Args/Returns structure, all front-loaded and free of filler. Every sentence adds value, and the structure is clean.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but the parameter mismatch is a critical gap. The description does not explain the actual input wrapper, and while an output schema exists, the description's wrong parameter documentation makes the tool incomplete and error-prone to invoke.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description says 'Args: params: Package specifier', but the input schema requires 'params' to be an object containing a nested 'package' field. This is misleading and would cause an agent to pass the package string directly as {'params': 'pandas'} instead of {'params': {'package': 'pandas'}}, leading to validation failures.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Install a Python package using pip (or uv if available)', which is a specific verb+resource. It distinguishes this tool from sibling tools that manage code execution, files, and namespace variables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context: 'The package becomes importable in all sessions immediately', which conveys when to use it. It does not explicitly mention alternatives or exclusions, but the purpose is unambiguous, earning a 4.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_list_namespaceB
Read-onlyIdempotent

List all variables stored in a session's namespace.

Returns: JSON with variable names, types, and preview values.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the agent knows this is a safe read. The description adds the return format ('JSON with variable names, types, and preview values'), which is helpful but partially redundant given the output schema. No additional context about session-not-found behavior, pagination, or preview truncation is provided.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action, and includes a clear return summary. There is no fluff, and every word adds value. It is appropriately concise for a simple listing tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, and the description covers the core operation and return format. However, it leaves out the session_id parameter explanation and any caveats about empty namespaces or invalid sessions. Given that schema coverage is 0% and output schema exists, the description should have at least mentioned the input requirement. It is adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention the required session_id parameter at all. Schema description coverage is 0%, so the tool description was expected to compensate, but it completely omits parameter semantics. The agent receives no guidance on how to specify the target session, which is critical for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all variables stored in a session's namespace.' This specific verb+resource combination distinguishes it from siblings like repl_get_variable (singular) and repl_clear_namespace (delete). It is unambiguous and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for enumerating namespace variables but does not explicitly say when to use it versus alternatives. It does not mention that repl_get_variable should be used for a single variable or provide exclusions. The context of 'all variables' gives some guidance, but it stops short of explicit comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_list_sessionsA
Read-onlyIdempotent

List all active REPL sessions.

Returns: JSON array of sessions with IDs, timestamps, and variable counts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds context beyond those by specifying the return format (JSON array) and contents (IDs, timestamps, variable counts) and that only active sessions are listed. This provides useful behavioral detail not present in the schema or annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences pack the purpose and the return structure. It is front-loaded with the core action and immediately provides the expected output. No filler or repetition of schema/annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, parameterless list operation with a rich annotation set and an output schema, the description fully conveys what the tool does and what it returns. It is complete enough for an agent to select and invoke it without missing critical details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema is empty. A baseline of 4 is appropriate for no-parameter tools because there is nothing to document. The description does not attempt to add parameter semantics, correctly avoiding redundancy.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'List' and clearly identifies the resource as 'all active REPL sessions.' This distinguishes it from sibling tools like repl_delete_session (which removes sessions) and repl_get_variable (which retrieves specific variables within a session).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use this tool: to see all active sessions. However, it provides no explicit guidance on when NOT to use it or which alternative to choose for related tasks (e.g., repl_list_namespace for namespaces). The usage context is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes beyond annotations to disclose essential stateful behavior: variables persist across calls, the 'result' variable does not persist, and the tool returns a JSON summary. This is critical context that annotations (readOnlyHint=false, idempotentHint=false) do not provide, and it is explained with a concrete example to prevent misuse.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded: it states the core purpose first, then explains the persistence model, illustrates a correct workflow, and ends with return value info. Every sentence contributes to understanding the tool's behavior without unnecessary fluff or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a stateful code-execution tool, the description covers the essential mechanics: persistence, result variable semantics, and return format. It omits session_id handling (covered by schema) and does not discuss error scenarios, but with the provided output schema and workflow example, the overall picture is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool description adds significant meaning to the 'code' parameter by explaining the persistent namespace and result-variable contract, complementing the schema's brief descriptions. However, it does not mention 'session_id' at all, leaving that parameter's semantics entirely to the schema. The description enriches the main parameter but not the secondary one.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes Python code with a persistent namespace, immediately distinguishing it from siblings like repl_run_file (runs files) and repl_install_package (installs packages). The verb 'Execute' plus the resource 'Python code' and the key behavior 'persistent namespace' make the purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on how to use the persistent namespace: assign variables to persist them, use named variables, and reserve 'result' for returning output. It even includes a correct workflow example. However, it does not explicitly mention when to use this tool over alternatives (e.g., repl_run_file) or state exclusions, though sibling names make the distinction obvious.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnly=false and openWorld=true, but the description adds meaningful context beyond that: execution occurs in a persistent session, variables persist for later use, and the return payload includes execution result, file metadata, and namespace summary. These are behavioral details not captured by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well-structured. It opens with a clear purpose sentence, followed by a note on side effects, then concise Args and Returns summaries. Every sentence adds value with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists and annotations provide safety hints, the description covers essential behavioral aspects: persistent session, variable persistence, and return structure. It does not mention error handling or edge cases, but those are not required given the richness of schema and annotations. The description is sufficiently complete for an AI agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides detailed descriptions for file_path, session_id, and args (path type, session ID to resume, space-separated CLI args). The tool description's 'Args' line only restates the parameter names without adding new semantics. Since schema coverage is effectively complete, a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses the specific verb 'Execute' with the resource 'Python file', and clarifies the context 'persistent session'. It also notes a key side effect ('Variables defined in the file become available for later use'), which distinguishes it from sibling repl_run_code that likely runs inline code. This is a clear, specific statement of purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for running files rather than ad-hoc code, but it does not explicitly name alternatives or state when to use this tool over repl_run_code. There is no exclusion or comparison, so usage guidance remains implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_server_statusA
Read-onlyIdempotent

Get current server status and configuration.

Returns: JSON with Python version, session count, configuration, and limits.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish read-only, idempotent, non-destructive behavior. The description adds valuable details about the response payload, specifying exactly what fields the JSON will contain (Python version, session count, configuration, limits), which helps the agent set expectations beyond the safety hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no redundant wording. The first sentence states the action and target; the second lists expected return contents, making every sentence informative and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no parameters, a rich output schema, and annotations covering safety, the description sufficiently covers the tool's behavior. It explicitly lists the response fields, so the agent knows what to expect without needing further elaboration.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the input schema provides no burden. The description appropriately omits parameter details, as there are none to explain, matching the baseline for no-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get current server status and configuration,' specifying the verb and resource. It also enumerates the return fields (Python version, session count, configuration, limits), distinguishing it from sibling tools that focus on code execution or session management.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context that this tool is for retrieving server-level status and configuration, which implies the appropriate use case. While it doesn't explicitly name alternatives or exclusions, the tool's purpose is sufficiently distinct from siblings like list_sessions or run_code, so an agent can readily determine when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

repl_set_variableA
Idempotent

Set a variable in a session from a JSON string.

Useful for injecting data from external sources.

Returns: Confirmation with variable type and preview.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the operation as idempotent and non-destructive. The description adds the return behavior ('Confirmation with variable type and preview') and emphasizes JSON parsing, which goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a one-sentence purpose, a brief usage note, and a clear Returns section. No filler or redundant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple three-parameter setter with idempotent and non-destructive annotations, the description plus schema adequately covers input, purpose, and return behavior. It could mention session existence prerequisites, but that is not essential for correct tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the context signal reports 0% schema coverage, the actual input schema contains short descriptions for session_id, var_name, and json_value. The tool description reinforces that json_value must be a JSON string but does not add substantially new semantic meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action ('Set a variable in a session from a JSON string') that clearly identifies the tool's resource and input format. This distinguishes it from sibling tools like repl_get_variable and repl_delete_variable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'Useful for injecting data from external sources' provides a clear use case. It does not explicitly list exclusions or alternatives, but the context is sufficient to guide tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 12 tool updatesv0.1.1
    • First observedrepl_clear_namespace
    • First observedrepl_delete_session
    • First observedrepl_delete_variable
    • First observedrepl_get_history
    • First observedrepl_get_variable
    • First observedrepl_install_package
    • First observedrepl_list_namespace
    • First observedrepl_list_sessions
    • First observedrepl_run_code
    • First observedrepl_run_file
    • First observedrepl_server_status
    • First observedrepl_set_variable

TDQS

A4/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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