JosefVilestadGit/colonies-mcp
If you are the rightful owner of colonies-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
An MCP server for interacting with ColonyOS, a distributed meta-orchestrator framework for seamless execution of computational workloads across heterogeneous platforms.
MCP ColonyOS Server
An MCP (Model Context Protocol) server for interacting with ColonyOS, a distributed meta-orchestrator framework for seamless execution of computational workloads across heterogeneous platforms.
What is ColonyOS?
ColonyOS is a distributed computing framework that creates Compute Continuums across cloud, edge, HPC, IoT devices, and more. It uses a broker-based architecture where:
- Colonies are distributed runtime environments consisting of networked executors
- Executors are distributed workers that pull and execute processes
- Processes are computational workloads with states (WAITING → RUNNING → SUCCESS/FAILED)
- FunctionSpecs define what computation to run and execution conditions
Features
This MCP server provides tools to interact with ColonyOS:
Process Management
submit_function_spec- Submit computational tasks to the colonyget_process- Get detailed information about a processlist_waiting_processes- List processes waiting for executionlist_running_processes- List currently running processeslist_successful_processes- List completed successful processeslist_failed_processes- List failed processesclose_process_successful- Mark a running process as successfully completedclose_process_failed- Mark a running process as failed with an error messagedelete_process- Permanently delete a process and its history
Executor Management
list_executors- List all registered executorsget_executor- Get detailed executor informationadd_executor- Register a new executorapprove_executor- Approve an executor to start processinglist_functions_by_executor- List all functions that a specific executor can handlelist_functions_by_colony- List all available functions across all executors in the colony
Colony Management
get_colony- Get information about the current colony
Development Server Management
start_colonies_dev_server- Start a local ColonyOS development environment with Dockerstop_colonies_dev_server- Stop the development server and optionally remove volumescheck_colonies_server_status- Check if the server is running and healthyget_colonies_logs- View logs from server containers
Executor Runtime Management
start_python_executor- Start a Python executor that connects to the dev serverstop_python_executor- Stop a running Python executorlist_running_executors- List all executors started by this MCP server
Security & Key Management
generate_keypair- Generate a new Ed25519 keypair (ID and private key) for colonies, executors, users, or servers
Installation
- Clone this repository:
cd /home/ayag/git/mcp-colonies
- Install dependencies:
pip install -e .
Or install from PyPI (when published):
pip install mcp-colonies
Configuration
The server requires ColonyOS credentials to be configured via environment variables.
- Copy the example environment file:
cp .env.example .env
- Edit
.envwith your ColonyOS credentials:
# ColonyOS Server Configuration
COLONIES_SERVER_HOST=localhost
COLONIES_SERVER_PORT=8080
COLONIES_SERVER_TLS=false
# Colony Configuration
COLONIES_COLONY_NAME=your_colony_name
COLONIES_COLONY_PRVKEY=your_colony_private_key
# Executor Configuration (optional)
COLONIES_EXECUTOR_NAME=your_executor_name
COLONIES_EXECUTOR_PRVKEY=your_executor_private_key
Quick Start: Local Development Environment
The easiest way to get started is to use the built-in dev server management tools:
- Clone the ColonyOS repository (if not already done):
cd ~/git # or your preferred location
git clone https://github.com/colonyos/colonies.git
- Set up the .env file in the colonies repository:
cd ~/git/colonies
cp .env.example .env
# Edit .env if needed - the defaults work for local development
- Start the dev server using Claude: Once the MCP server is configured in Claude Desktop (see below), you can simply ask Claude:
Start the ColonyOS development server
Claude will use the start_colonies_dev_server tool to automatically start all services (TimescaleDB, MinIO, Colonies server) using Docker Compose.
- Check server status:
Check if the ColonyOS server is running
Alternative: Manual Setup
If you prefer manual setup or need custom configuration:
- Start a ColonyOS server:
cd ~/git/colonies
docker-compose up -d
-
The dev environment automatically creates:
- A colony (check
.envforCOLONIES_COLONY_NAMEand credentials) - Docker executors via the reconciler
- A colony (check
-
Use these credentials in your MCP server configuration
See the ColonyOS documentation for more details.
Usage with Claude Desktop
Add this server to your Claude Desktop configuration:
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"colonies": {
"command": "python",
"args": ["-m", "mcp_colonies.server"],
"env": {
"COLONIES_SERVER_HOST": "localhost",
"COLONIES_SERVER_PORT": "8080",
"COLONIES_SERVER_TLS": "false",
"COLONIES_COLONY_NAME": "your_colony_name",
"COLONIES_COLONY_PRVKEY": "your_colony_private_key",
"COLONIES_EXECUTOR_NAME": "your_executor_name",
"COLONIES_EXECUTOR_PRVKEY": "your_executor_private_key"
}
}
}
}
Linux
Edit ~/.config/Claude/claude_desktop_config.json with the same configuration.
Windows
Edit %APPDATA%\Claude\claude_desktop_config.json with the same configuration.
Example Usage
Once configured, you can use Claude to interact with your ColonyOS cluster:
Manage Development Server:
Start the ColonyOS development server
Check the status of the ColonyOS server
Show me the logs from the colonies-server
Stop the ColonyOS development server
Generate Keypairs:
Generate a keypair for a new colony
Generate a keypair for an executor
Start an Executor:
Start a Python executor
List running executors
Submit a function spec with func_name "echo" and executor_type "python-executor" with kwargs {"message": "Hello from Claude!"}
Stop the Python executor
Submit a task:
Submit a function spec with:
- func_name: "process_image"
- executor_type: "gpu-worker"
- kwargs: {"image_url": "https://example.com/image.jpg", "model": "yolo"}
- max_exec_time: 300
Check process status:
Get the status of process abc123def456
List executors:
Show me all executors in the colony
Discover available functions:
What functions are available in the colony?
What functions can the executor "mcp-executor" handle?
List all functions by colony
Monitor running tasks:
List all currently running processes
Manage process lifecycle:
Mark process abc123 as successful
Mark process def456 as failed with error message "Timeout exceeded"
Delete process xyz789
Development
Running in Development Mode
- Install development dependencies:
pip install -e ".[dev]"
- Run the server directly:
python -m mcp_colonies.server
Testing
pytest tests/
Code Formatting
black src/
ruff check src/
Architecture
This MCP server wraps the official pycolonies Python SDK to provide MCP tools for ColonyOS operations. It:
- Initializes a ColonyOS client from environment variables
- Exposes ColonyOS operations as MCP tools
- Handles authentication using Ed25519 cryptographic signing
- Returns formatted results to Claude
Use Cases
With this MCP server, Claude can help you:
- Monitor distributed workflows - Check status of tasks across your compute continuum
- Submit computational jobs - Deploy ML/AI workloads, data processing pipelines
- Manage executors - Register and approve new workers in your colony
- Debug failures - Investigate failed processes and their error messages
- Orchestrate complex workflows - Submit multi-step computational pipelines
Links
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.