Skip to main content
Glama
PortPro-Technologies-Inc

MCP Python Interpreter

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_ALLOW_SYSTEM_ACCESSNoControls whether the MCP server has access to system resources0

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
read_fileA
Read the content of any file, with size limits for safety.

Args:
    file_path: Path to the file (relative to working directory or absolute)
    max_size_kb: Maximum file size to read in KB (default: 1024)

Returns:
    str: File content or an error message
write_fileB
Write content to a file in the working directory or system-wide if allowed.

Args:
    file_path: Path to the file to write (relative to working directory or absolute if system access is enabled)
    content: Content to write to the file
    overwrite: Whether to overwrite the file if it exists (default: False)
    encoding: File encoding (default: utf-8)

Returns:
    str: Status message about the file writing operation
list_directoryA
List all Python files in a directory or subdirectory.

Args:
    directory_path: Path to directory (relative to working directory or absolute, empty for working directory)
list_python_environmentsB

List all available Python environments (system Python and conda environments).

list_installed_packagesA
List installed packages for a specific Python environment.

Args:
    environment: Name of the Python environment (default: default if custom path provided, otherwise system)
run_python_codeB
Execute Python code and return the result. Code runs in the working directory.

Args:
    code: Python code to execute
    environment: Name of the Python environment to use (default if custom path provided, otherwise system)
    save_as: Optional filename to save the code before execution (useful for future reference)
install_packageA
Install a Python package in the specified environment.

Args:
    package_name: Name of the package to install
    environment: Name of the Python environment (default if custom path provided, otherwise system)
    upgrade: Whether to upgrade the package if already installed (default: False)
write_python_fileB
Write content to a Python file in the working directory or system-wide if allowed.

Args:
    file_path: Path to the file to write (relative to working directory or absolute if system access is enabled)
    content: Content to write to the file
    overwrite: Whether to overwrite the file if it exists (default: False)
run_python_fileB
Execute a Python file and return the result.

Args:
    file_path: Path to the Python file to execute (relative to working directory or absolute if system access is enabled)
    environment: Name of the Python environment to use (default if custom path provided, otherwise system)
    arguments: List of command-line arguments to pass to the script

Prompts

Interactive templates invoked by user choice

NameDescription
python_function_templateGenerate a template for a Python function with docstring.
refactor_python_codeHelp refactor Python code for better readability and performance.
debug_python_errorHelp debug a Python error.

Resources

Contextual data attached and managed by the client

NameDescription
get_environments_resourceList all available Python environments as a resource.
get_file_in_current_dirList Python files in the current working directory.
get_working_directory_listingList all Python files in the working directory as a resource.

TDQS

A3.7/5.0

Scored across 9 tools

Disambiguation4/5

Most tools have distinct purposes, but there is some overlap between write_file and write_python_file, as both handle file writing with similar arguments, which could cause confusion. However, descriptions clarify that write_python_file is specifically for Python files, reducing ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (e.g., install_package, list_directory, run_python_code), with clear and predictable naming throughout the set. No deviations or mixed conventions are present.

Tool Count5/5

With 9 tools, the count is well-scoped for a Python interpreter server, covering package management, file operations, code execution, and environment handling. Each tool serves a clear purpose without being excessive or insufficient.

Completeness4/5

The toolset provides comprehensive coverage for core Python interpreter tasks, including installation, execution, and file management. Minor gaps exist, such as no tool for deleting files or packages, but agents can work around this using existing tools like write_file with overwrite or system commands.