iflow-mcp_mcp-python-interpreter

v1.2.3
iflow-mcp_mcp-python-interpreter Checked 2 days ago Published 1 year ago

MCP server for Python code execution and environment management

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_python_environments

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

list_installed_packages

List installed packages for a specific Python environment. Args: environment: Name of the Python environment

ParameterTypeDescription
environmentstring

run_python_code

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 mo…

ParameterTypeDescription
code *string
environmentstring
execution_modestring
save_as
session_idstring
timeoutinteger

run_python_file

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)

ParameterTypeDescription
file_path *string
arguments
environmentstring
timeoutinteger

install_package

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

ParameterTypeDescription
package_name *string
environmentstring
timeoutinteger
upgradeboolean

read_file

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

ParameterTypeDescription
file_path *string
max_size_kbinteger

write_file

Write content to a file. Args: file_path: Path to the file to write content: Content to write overwrite: Whether to overwrite if exists

ParameterTypeDescription
content *string
file_path *string
overwriteboolean

list_directory

List all Python files in a directory. Args: directory_path: Path to directory (empty for working directory)

ParameterTypeDescription
directory_pathstring

clear_session

Clear a REPL session's state and history. Args: session_id: Session ID to clear

ParameterTypeDescription
session_idstring

list_sessions

List all active REPL sessions.