MCP Python Interpreter
Intérprete de Python MCP
Un servidor de Protocolo de Contexto de Modelo (MCP) que permite a los LLM interactuar con entornos Python, leer y escribir archivos, ejecutar código Python y administrar flujos de trabajo de desarrollo.
Características
Gestión del entorno : enumerar y utilizar diferentes entornos de Python (sistema y conda)
Ejecución de código : ejecute código o scripts de Python en cualquier entorno disponible
Gestión de paquetes : enumera los paquetes instalados e instala los nuevos
Operaciones de archivo :
Leer archivos de cualquier tipo (texto, código fuente, binario)
Escribir archivos de texto y binarios
Indicaciones de Python : plantillas para tareas comunes de Python, como creación y depuración de funciones
Related MCP server: MCP Python Toolbox
Instalación
Puede instalar el intérprete de Python de MCP usando pip:
pip install mcp-python-interpreterO con uv:
uv install mcp-python-interpreterUso con Claude Desktop
Instalar Claude Desktop
Abra Claude Desktop, haga clic en el menú y luego en Configuración
Vaya a la pestaña Desarrollador y haga clic en "Editar configuración".
Agregue lo siguiente a su
claude_desktop_config.json:
{
"mcpServers": {
"mcp-python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"/path/to/your/work/dir",
"--python-path",
"/path/to/your/python"
],
"env": {
"MCP_ALLOW_SYSTEM_ACCESS": 0
},
}
}
}Para Windows:
{
"mcpServers": {
"python-interpreter": {
"command": "uvx",
"args": [
"mcp-python-interpreter",
"--dir",
"C:\\path\\to\\your\\working\\directory",
"--python-path",
"/path/to/your/python"
],
"env": {
"MCP_ALLOW_SYSTEM_ACCESS": 0
},
}
}
}Reiniciar Claude Desktop
Ahora debería ver el ícono de herramientas MCP en la interfaz de chat
El parámetro --dir es obligatorio y especifica dónde se guardarán y ejecutarán todos los archivos. Esto ayuda a mantener la seguridad al aislar el servidor MCP en un directorio específico.
Prerrequisitos
Asegúrate de tener instalado
uv. Si no es así, instálalo usando:curl -LsSf https://astral.sh/uv/install.sh | shPara Windows:
powershell -ExecutionPolicy Bypass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"
Herramientas disponibles
El intérprete de Python proporciona las siguientes herramientas:
Gestión del medio ambiente y de los paquetes
list_python_environments : enumera todos los entornos de Python disponibles (sistema y conda)
list_installed_packages : enumera los paquetes instalados en un entorno específico
install_package : instala un paquete de Python en un entorno específico
Ejecución de código
run_python_code : Ejecuta código Python en un entorno específico
run_python_file : ejecuta un archivo Python en un entorno específico
Operaciones con archivos
read_file : Lee el contenido de cualquier tipo de archivo, con límites de tamaño y seguridad
Admite archivos de texto con resaltado de sintaxis
Muestra la representación hexadecimal de archivos binarios
write_file : Crea o sobrescribe archivos con texto o contenido binario
write_python_file : Crea o sobrescribe un archivo Python específicamente
list_directory : enumera los archivos de Python en un directorio
Recursos disponibles
python://environments : Lista todos los entornos de Python disponibles
python://packages/{env_name} : enumera los paquetes instalados para un entorno específico
python://file/{file_path} : Obtener el contenido de un archivo Python
python://directory/{directory_path} : enumera todos los archivos de Python en un directorio
Indicaciones
python_function_template : Genera una plantilla para una función de Python
refactor_python_code : Ayuda a refactorizar el código Python
debug_python_error : Ayuda a depurar un error de Python
Ejemplo de uso
A continuación se muestran algunos ejemplos de lo que puedes pedirle a Claude que haga con este servidor MCP:
"Muéstrame todos los entornos de Python disponibles en mi sistema"
Ejecute este código Python en mi entorno conda-base: print('¡Hola, mundo!')
"Crea un nuevo archivo Python llamado 'hello.py' con una función que diga hola"
"Leer el contenido de mi archivo 'data.json'"
"Escribe un nuevo archivo de configuración con estos ajustes..."
"Enumerar todos los paquetes instalados en el entorno Python de mi sistema"
Instalar el paquete de solicitudes en el entorno Python de mi sistema.
Ejecute data_analysis.py con estos argumentos: --input=data.csv --output=results.csv
Capacidades de manejo de archivos
El intérprete de Python de MCP ahora admite operaciones de archivos integrales:
Lee archivos de texto y binarios de hasta 1 MB
Escribir archivos de texto y binarios
Resaltado de sintaxis para archivos de código fuente
Representación hexadecimal para archivos binarios
Seguridad estricta de la ruta de archivo (solo dentro del directorio de trabajo)
Consideraciones de seguridad
Este servidor MCP tiene acceso a sus entornos Python y a su sistema de archivos. Sus principales características de seguridad incluyen:
Directorio de trabajo aislado
Límites de tamaño de archivo
Escrituras evitadas fuera del directorio de trabajo
Protección de sobrescritura explícita
Tenga siempre cuidado al ejecutar código o realizar operaciones con archivos que no comprenda completamente.
Licencia
Instituto Tecnológico de Massachusetts (MIT)
Available Tools
10 toolsclear_sessionC
Clear a REPL session's state and history.
Args:
session_id: Session ID to clear
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | default |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool clears 'state and history,' implying a destructive operation, but doesn't specify whether this is irreversible, what 'state' includes (e.g., variables, outputs), or if it affects other sessions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with the core purpose stated first ('Clear a REPL session's state and history.') and parameter details following. It avoids unnecessary elaboration, but the 'Args' section could be more integrated. Overall, it's efficient with minimal waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (destructive operation with one parameter), no annotations, and an output schema (which reduces need to explain returns), the description is partially complete. It covers the basic action and parameter, but lacks critical context like irreversible effects, session existence checks, or error handling. For a mutation tool, this is a moderate gap in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds minimal parameter semantics beyond the input schema. It includes an 'Args' section listing 'session_id: Session ID to clear,' which provides basic meaning (identifying which session to clear). However, with 0% schema description coverage and only one parameter, this is adequate but not detailed (e.g., no format or default value explanation). The baseline is 4 for 0 parameters, but here it's 3 due to the single parameter being partially documented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('clear') and resource ('a REPL session's state and history'). It distinguishes the tool from siblings like 'list_sessions' or 'run_python_code' by focusing on cleanup rather than listing or execution. However, it doesn't explicitly differentiate from all siblings (e.g., it's clear but not maximally specific about sibling relationships).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention prerequisites (e.g., whether a session must exist), exclusions (e.g., not for active sessions), or suggest alternatives among siblings like 'list_sessions' for checking sessions first. The tool's purpose is clear, but usage context is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
install_packageB
Install a Python package in the specified environment.
Args:
package_name: Name of the package to install
environment: Name of the Python environment
upgrade: Whether to upgrade if already installed
timeout: Maximum execution time in seconds
| Name | Required | Description | Default |
|---|---|---|---|
| package_name | Yes | ||
| environment | No | default | |
| upgrade | No | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('install') but lacks details on permissions required, side effects (e.g., modifies environment state), error handling (e.g., what happens if package not found), or output format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and concise: a clear purpose statement followed by a bullet-point list of parameters. Every sentence earns its place by directly explaining the tool or its inputs, with no redundant or vague language. It's front-loaded with the core action, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (a mutation tool with 4 parameters) and no annotations, the description is moderately complete. It covers the purpose and parameters but lacks behavioral details (e.g., side effects, errors) and usage context. The presence of an output schema (not detailed here) might help with return values, but overall, it's adequate with clear gaps for safe tool invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description lists all four parameters with brief explanations, but schema description coverage is 0%, meaning the schema provides no descriptions. The description adds basic semantics (e.g., 'Name of the package to install'), but it doesn't elaborate on constraints (e.g., package naming conventions) or dependencies (e.g., environment must be valid). This compensates partially but not fully for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Install a Python package in the specified environment.' It specifies the verb ('install') and resource ('Python package'), making the action unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_installed_packages' or 'run_python_code', which would require more specific context about when to use installation versus other package-related operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention prerequisites (e.g., environment must exist), exclusions (e.g., not for system-wide installation), or comparisons to siblings like 'run_python_code' for testing packages. Without such context, an agent might misuse it in scenarios better handled by other tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_directoryB
List all Python files in a directory.
Args:
directory_path: Path to directory (empty for working directory)
| Name | Required | Description | Default |
|---|---|---|---|
| directory_path | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states what the tool does but lacks behavioral details: it doesn't specify if this is a read-only operation, what happens with invalid paths, whether it recursively searches subdirectories, what format the output takes (e.g., list of filenames, full paths), or any error conditions. The description is minimal and doesn't disclose important operational traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and well-structured: a clear purpose statement followed by a brief parameter explanation. Every sentence earns its place, with no redundant information. It's front-loaded with the core functionality, making it easy to scan and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there's an output schema (which presumably describes the return format), the description doesn't need to explain return values. However, for a tool with no annotations and only basic parameter documentation, the description is somewhat incomplete: it doesn't address error handling, recursion behavior, or file filtering details beyond 'Python files'. It's minimally adequate but leaves gaps in understanding the tool's full behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context for the single parameter: it explains that directory_path is 'Path to directory (empty for working directory)', which clarifies the default behavior when the parameter is omitted. Since schema description coverage is 0% and there's only one parameter, this compensates well. However, it doesn't detail path format requirements (e.g., absolute vs. relative) or validation rules.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List all Python files in a directory' which specifies the verb (list), resource (Python files), and scope (directory). It distinguishes from siblings like list_installed_packages or list_sessions by focusing specifically on Python files in a filesystem directory. However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention when to choose list_directory over other file-related tools like read_file or run_python_file, nor does it specify prerequisites or exclusions. The only contextual hint is the sibling list, but the description itself offers no usage instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_installed_packagesC
List installed packages for a specific Python environment.
Args:
environment: Name of the Python environment
| Name | Required | Description | Default |
|---|---|---|---|
| environment | No | default |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a listing operation, implying read-only behavior, but doesn't disclose any behavioral traits such as output format, pagination, error handling, or whether it requires specific permissions. The description is minimal and lacks context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the main purpose in the first sentence, followed by parameter details. There's no wasted text, and it's appropriately sized for a simple tool. However, it could be slightly more structured with clearer separation of sections.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (which handles return values), no annotations, and low complexity, the description is somewhat complete but lacks context. It covers the basic purpose and parameter, but doesn't provide usage guidelines or behavioral details, leaving gaps for an AI agent to infer correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, but the description includes an 'Args' section that explains the 'environment' parameter as 'Name of the Python environment'. This adds meaning beyond the schema's title 'Environment' and default value 'default'. However, it doesn't provide additional details like valid environment names or examples, and there's only one parameter, so the baseline is 4, but the limited info reduces it to 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('List') and resource ('installed packages'), and specifies the target ('for a specific Python environment'). However, it doesn't distinguish this tool from its sibling 'list_python_environments', which could be a related listing operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 like 'list_python_environments' (which lists environments rather than packages) or 'list_directory' (which might list files). There's no mention of prerequisites, typical use cases, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_python_environmentsB
List all available Python environments (system Python and conda environments).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits such as whether it requires specific permissions, how it handles errors, what the output format looks like, or if there are any rate limits. This leaves significant gaps for a tool that interacts with system environments.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It directly states the action and scope, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, as a tool that lists system-level resources with no annotations, it should ideally provide more context about output structure or usage constraints to be fully complete for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('Python environments'), specifying both system Python and conda environments. It distinguishes from some siblings like list_directory or list_sessions by focusing on Python environments specifically, though it doesn't explicitly differentiate from all potential alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention prerequisites, context for usage, or compare with siblings like list_installed_packages or list_sessions, leaving the agent to infer usage scenarios independently.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_sessionsB
List all active REPL sessions.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the tool lists active sessions but doesn't disclose behavioral traits such as whether it requires permissions, how it handles errors, what the output format is, or if there are rate limits. This is a significant gap for a tool with no 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, with no annotations and a simple purpose, it lacks context on usage scenarios or behavioral details, making it just sufficient but with clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it correctly implies no inputs are required, earning a baseline score above 3 for adequate coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('all active REPL sessions'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_directory' or 'list_installed_packages' beyond the resource type, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage based on the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileA
Read the content of any file, with size limits for safety.
Args:
file_path: Path to the file
max_size_kb: Maximum file size to read in KB
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| max_size_kb | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It adds context about 'size limits for safety', which is useful for understanding constraints, but it doesn't cover other behavioral traits such as error handling, permissions required, or what happens with large files beyond the limit. This leaves gaps in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded with the core purpose in the first sentence, followed by parameter details. Every sentence adds value, but the structure could be slightly improved by integrating the parameter explanations more seamlessly rather than as a separate 'Args' section, though this is minor.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is mostly complete. It covers the purpose and parameters, and since an output schema exists, it doesn't need to explain return values. However, it lacks details on error cases or performance, which could enhance completeness for a file-reading tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, so the description must compensate. It adds meaning by explaining 'file_path' as 'Path to the file' and 'max_size_kb' as 'Maximum file size to read in KB', which clarifies the parameters beyond the schema's basic titles. However, it doesn't detail format specifics (e.g., absolute vs. relative paths) or default behavior, keeping it from a perfect score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as 'Read the content of any file' with a specific verb ('Read') and resource ('file'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_directory' or 'run_python_file', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by mentioning 'size limits for safety', suggesting it's for reading files within safe bounds, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'list_directory' for file metadata or 'run_python_file' for executing code. No exclusions or clear alternatives are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_python_codeA
Execute Python code with flexible execution modes.
Args:
code: Python code to execute
execution_mode: Execution mode - "inline" (default, fast, in-process) or "subprocess" (isolated)
session_id: Session ID for inline mode to maintain state across executions
environment: Python environment name (only for subprocess mode)
save_as: Optional filename to save the code before execution
timeout: Maximum execution time in seconds (only enforced for subprocess mode)
Returns:
Execution result with output
Execution modes:
- "inline" (default): Executes code in the current process. Fast and reliable,
maintains session state. Use for most code execution tasks.
- "subprocess": Executes code in a separate Python process. Use when you need
environment isolation or a different Python environment.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| execution_mode | No | inline | |
| session_id | No | default | |
| environment | No | system | |
| save_as | No | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: execution modes with their characteristics (speed, isolation, state persistence), timeout enforcement specifics, and session state maintenance. However, it doesn't mention security implications, error handling, or resource limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (Args, Returns, Execution modes) and front-loaded purpose. Most sentences earn their place by providing essential information, though the execution mode explanations could be slightly more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (code execution with multiple modes), no annotations, and an output schema (which handles return values), the description is largely complete. It covers parameters, execution behavior, and usage guidelines well, though could benefit from mentioning security considerations or error scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. It provides detailed semantics for all 6 parameters: explains what each parameter does, clarifies which parameters apply to which execution modes, and provides default values and constraints. This adds significant value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Execute') and resource ('Python code'), distinguishing it from siblings like 'run_python_file' (which executes files) and 'clear_session' (which manages sessions). It specifies flexible execution modes, making the scope explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use each execution mode: 'inline' for most tasks (fast, maintains state) and 'subprocess' for environment isolation or different Python environments. It also distinguishes from siblings by focusing on code execution rather than file operations or session management.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_python_fileB
Execute a Python file (always uses subprocess for file execution).
Args:
file_path: Path to the Python file to execute
environment: Name of the Python environment to use
arguments: List of command-line arguments to pass to the script
timeout: Maximum execution time in seconds (default: 300)
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| environment | No | default | |
| arguments | No | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the execution method (subprocess) and mentions a default timeout, but doesn't cover critical behaviors like error handling (e.g., what happens if the file doesn't exist or execution fails), output capture (e.g., stdout/stderr return), security implications, or resource usage. This is inadequate for a tool that executes arbitrary code.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement followed by a bullet-point-like Args section. Each sentence adds value, and there's no redundancy. However, the Args formatting could be more integrated, and it's slightly verbose for a tool with only 4 parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (executing arbitrary Python files), lack of annotations, and presence of an output schema, the description is moderately complete. It covers parameters adequately but lacks behavioral details like error handling or security warnings. The output schema may help with return values, but the description doesn't reference it, leaving gaps in understanding the tool's full impact.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds meaningful context for all 4 parameters: file_path specifies it's the 'Python file to execute,' environment indicates the 'Python environment to use,' arguments are 'command-line arguments to pass to the script,' and timeout defines 'maximum execution time in seconds' with a default. This goes beyond the schema's basic titles, though it could elaborate on format (e.g., path requirements).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as 'Execute a Python file' with the specific implementation detail 'always uses subprocess for file execution.' This distinguishes it from sibling tools like run_python_code (which executes code directly) and read_file (which only reads). However, it doesn't explicitly contrast with all siblings like install_package or list_directory.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by specifying it executes files via subprocess, suggesting it's for running complete Python scripts rather than inline code. However, it lacks explicit guidance on when to use this versus alternatives like run_python_code, and doesn't mention prerequisites (e.g., file must exist) or exclusions (e.g., not for interactive scripts).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
write_fileB
Write content to a file.
Args:
file_path: Path to the file to write
content: Content to write
overwrite: Whether to overwrite if exists
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| content | Yes | ||
| overwrite | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'overwrite' behavior, which is useful, but fails to cover critical aspects like error handling (e.g., if the file path is invalid or permissions are insufficient), side effects, or response format details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded with the core purpose, followed by a structured Args list. Every sentence adds value, but the formatting could be slightly more polished for readability.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (a write operation with 3 parameters) and no annotations, the description is moderately complete. It covers parameters well and an output schema exists, but it lacks behavioral context like error cases or system dependencies, leaving gaps for safe usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters ('file_path', 'content', 'overwrite') in the Args section, adding meaningful context beyond the bare schema, though it could include more details like path format or content encoding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with 'Write content to a file', specifying the verb 'write' and resource 'file'. However, it doesn't explicitly differentiate from sibling tools like 'read_file', though the action is distinct by nature.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites, such as file permissions or system constraints, and doesn't mention sibling tools like 'read_file' for comparison.
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.
11 tool updates
v1.0.0- Added
clear_session - Changed
install_package2 fields changed- added
Input schema / properties / timeoutAdded value: +{ + "default": 300, + "title": "Timeout", + "type": "integer" +} - changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "install_packageOutput", + "type": "object" +}
- Changed
list_directory1 field changed- changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "list_directoryOutput", + "type": "object" +}
- Changed
list_installed_packages1 field changed- changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "list_installed_packagesOutput", + "type": "object" +}
- Changed
list_python_environments1 field changed- changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "list_python_environmentsOutput", + "type": "object" +}
- Added
list_sessions - Changed
read_file1 field changed- changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "read_fileOutput", + "type": "object" +}
- Changed
run_python_code5 fields changed- changed
Input schema / properties / environment / defaultPrevious value: -"default"New value: +"system" - added
Input schema / properties / execution_modeAdded value: +{ + "default": "inline", + "title": "Execution Mode", + "type": "string" +} - added
Input schema / properties / session_idAdded value: +{ + "default": "default", + "title": "Session Id", + "type": "string" +} - added
Input schema / properties / timeoutAdded value: +{ + "default": 300, + "title": "Timeout", + "type": "integer" +} - changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "run_python_codeOutput", + "type": "object" +}
- Changed
run_python_file2 fields changed- added
Input schema / properties / timeoutAdded value: +{ + "default": 300, + "title": "Timeout", + "type": "integer" +} - changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "run_python_fileOutput", + "type": "object" +}
- Changed
write_file2 fields changed- removed
Input schema / properties / encodingRemoved value: -{ - "default": "utf-8", - "title": "Encoding", - "type": "string" -} - changed
Output schema / (root)Previous value: -nullNew value: +{ + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "write_fileOutput", + "type": "object" +}
- Removed
write_python_file
9 tool updates
- First observed
install_package - First observed
list_directory - First observed
list_installed_packages - First observed
list_python_environments - First observed
read_file - First observed
run_python_code - First observed
run_python_file - First observed
write_file - First observed
write_python_file
TDQS
Most tools have distinct purposes, but there is some overlap between run_python_code and run_python_file that could cause confusion. The descriptions clarify that run_python_code handles code strings with multiple execution modes, while run_python_file executes existing files via subprocess, but both essentially execute Python code. Other tools like list_directory, read_file, and write_file are clearly distinct.
All tool names follow a consistent verb_noun pattern using snake_case, such as clear_session, install_package, list_directory, etc. There are no deviations in naming conventions, making the set predictable and easy to understand.
With 10 tools, the count is well-scoped for a Python interpreter server. It covers key operations like code execution, file management, package installation, and session handling without being overwhelming or insufficient for the domain.
The tool set provides comprehensive coverage for Python development tasks, including code execution, file operations, package management, and session control. Minor gaps exist, such as no explicit tool for deleting files or uninstalling packages, but agents can work around these using existing tools like write_file with overwrite or other methods.
Maintenance
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.7MIT
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.9MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.1910MIT
- -licenseAqualityNot gradedmaintenanceA Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.9-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/yzfly/mcp-python-interpreter'
If you have feedback or need assistance with the MCP directory API, please join our Discord server