mcp_code_executor
If you are the rightful owner of mcp_code_executor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Code Executor is a server that enables LLMs to execute Python code within a specified environment, supporting incremental code generation and dependency management.
The MCP Code Executor is a Model Context Protocol (MCP) server designed to facilitate the execution of Python code by Language Model Machines (LLMs) within a defined Python environment. This server allows LLMs to run code with access to necessary libraries and dependencies, which are specified in the environment. It supports incremental code generation, which is particularly useful for handling large code blocks that may exceed token limits. The server can dynamically configure the environment at runtime, install dependencies as needed, and check if packages are already installed. It also provides a configurable directory for code storage, ensuring that generated code is organized and accessible.
Features
- Execute Python code from LLM prompts
- Support for incremental code generation to overcome token limitations
- Run code within a specified environment (Conda, virtualenv, or UV virtualenv)
- Install dependencies when needed
- Dynamically configure the environment at runtime
Tools
execute_code
Executes Python code in the configured environment. Best for short code snippets.
install_dependencies
Installs Python packages in the environment.
check_installed_packages
Checks if packages are already installed in the environment.
configure_environment
Dynamically changes the environment configuration.
get_environment_config
Gets the current environment configuration.
initialize_code_file
Creates a new Python file with initial content.
append_to_code_file
Appends content to an existing Python code file.
execute_code_file
Executes an existing Python file.
read_code_file
Reads the content of an existing Python code file.