- Home
- MCP servers
- MCP AgentRun Server
MCP AgentRun Server
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"cheongqinxue-mcp-agentrun": {
"command": "/path/to/mcp-agentrun/.venv/bin/python",
"args": [
"/path/to/mcp-agentrun/src/server.py"
],
"env": {
"PYTHONPATH": "/path/to/mcp-agentrun",
"CONTAINER_NAME": "your-container-name",
"AGENTRUN_API_DIR": "/path/to/mcp-agentrun/agentrun/agentrun-api",
"PYTHONUNBUFFERED": "1"
}
}
}
}You can run Python code safely inside isolated Docker containers using the MCP AgentRun Server. This setup lets AI assistants request code execution with clean environments, automatic container management, and robust error handling, making it ideal for reproducible experiments and safe automation.
How to use
To use this MCP server, configure your MCP client to connect via the local stdio interface described here. Start the MCP server process, then invoke the code-execution function provided by the AgentRun integration to run Python snippets inside isolated containers. Each execution happens in a fresh environment, ensuring reproducibility and strong isolation between runs.
Typical usage flow is as follows: you set up the client to point at the MCP server, then request execution of Python code snippets. The server returns the output produced by the code, handling any errors and logging them for you. This enables safe experimentation with arbitrary Python code as part of your AI-assisted workflows.
How to install
Prerequisites you need before installation:
-
Python 3.13+ installed on your system
-
Docker Engine 20.10+
-
Docker Compose 1.29+ or the Docker Compose CLI
-
uvx or equivalent tooling
Follow these concrete steps to get started locally:
# 1) Clone the repository
# (replace with the actual URL when you set up your environment)
git clone <repository-url>
cd mcp-agentrun
# 2) Set up permissions and install dependencies
chmod +x setup.sh
./setup.sh
# 3) Start the MCP server
python src/server.py
Configuration and run details
Configure the MCP client to connect to the AgentRun-based Python code executor. Use the following inline configuration snippet to register the server under a short name, enabling your MCP client to dispatch code execution requests.
{
"mcpServers": {
"python_code_executor": {
"command": "/path/to/mcp-agentrun/.venv/bin/python",
"args": [
"/path/to/mcp-agentrun/src/server.py"
],
"env": {
"PYTHONPATH": "/path/to/mcp-agentrun",
"AGENTRUN_API_DIR": "/path/to/mcp-agentrun/agentrun/agentrun-api",
"PYTHONUNBUFFERED": "1"
}
}
}
}
Available tools
execute_code
Execute Python code inside a Docker container managed by AgentRun. Returns the code output as a string and handles errors with logging for debugging.