π Supercharge your AI workflows with distributed computing!
A powerful Model Context Protocol (MCP) server that brings Ray's distributed computing capabilities directly to Claude Desktop. Manage clusters, submit jobs, and orchestrate complex workflows through natural language commands! π―
- ποΈ Multi-Node Cluster Management: Start and manage Ray clusters with head nodes and worker nodes
- π Job Management: Submit, monitor, and manage Ray jobs with ease
- π Actor Management: Create and manage Ray actors for stateful computations
- π Real-time Monitoring: Get cluster status, resource usage, and performance metrics
- π Logging and Debugging: Access logs and debug job issues seamlessly
- β° Scheduling: Schedule jobs with cron-like syntax for automated workflows
π Super Easy with uvx (Recommended):
# Install and run directly with uvx - no setup needed! β‘
uvx ray-mcp-serverπ₯ Or clone for development:
# Clone the repository
git clone <repository-url>
cd ray-mcp
# Install dependencies with UV (lightning fast! β‘)
uv sync
# You're ready to go! πThe server supports both single-node and multi-node cluster configurations:
{
"tool": "start_ray",
"arguments": {
"num_cpus": 4,
"num_gpus": 1
}
}The server now defaults to starting multi-node clusters with 2 worker nodes (perfect for scaling! π):
{
"tool": "start_ray",
"arguments": {
"num_cpus": 1
}
}This creates:
- π§ Head node: 1 CPU, 0 GPUs, 1GB object store memory
- βοΈ Worker node 1: 2 CPUs, 0 GPUs, 500MB object store memory
- βοΈ Worker node 2: 2 CPUs, 0 GPUs, 500MB object store memory
For advanced configurations, you can specify custom worker nodes:
{
"tool": "start_ray",
"arguments": {
"num_cpus": 4,
"num_gpus": 0,
"object_store_memory": 1000000000,
"worker_nodes": [
{
"num_cpus": 2,
"num_gpus": 0,
"object_store_memory": 500000000,
"node_name": "cpu-worker-1"
},
{
"num_cpus": 4,
"num_gpus": 1,
"object_store_memory": 1000000000,
"node_name": "gpu-worker-1",
"resources": {"custom_resource": 2}
}
],
"head_node_port": 10001,
"dashboard_port": 8265,
"head_node_host": "127.0.0.1"
}
}Just ask Claude Desktop naturally! π£οΈ
- "What's my Ray cluster status?"
- "Submit a job to process my data"
- "Show me cluster resources"
- "List all running jobs"
Or use direct tool calls:
{
"tool": "cluster_status"
}20+ powerful tools for comprehensive Ray management! πͺ
- π
start_ray- Start a new Ray cluster with head node and optional worker nodes - π
connect_ray- Connect to an existing Ray cluster - π
stop_ray- Stop the current Ray cluster - π
cluster_status- Get comprehensive cluster status - πΎ
cluster_resources- Get resource usage information - π₯οΈ
cluster_nodes- List all cluster nodes - βοΈ
worker_status- Get detailed status of worker nodes
- π€
submit_job- Submit a new job to the cluster - π
list_jobs- List all jobs (running, completed, failed) - π
job_status- Get detailed status of a specific job - β
cancel_job- Cancel a running or queued job - π
monitor_job- Monitor job progress in real-time - π
debug_job- Debug a job with detailed information - π
get_logs- Retrieve job logs and outputs
- π₯
list_actors- List all actors in the cluster - π
kill_actor- Terminate a specific actor
- β‘
performance_metrics- Get detailed cluster performance metrics - π₯
health_check- Perform comprehensive cluster health check - π―
optimize_config- Get cluster optimization recommendations
- π
schedule_job- Configure job scheduling parameters
Ready-to-run examples in the examples/ directory:
- π―
simple_job.py- Basic Ray job example (start here!) - π
multi_node_cluster.py- Multi-node cluster with worker management - π
actor_example.py- Actor-based stateful computation - π
data_pipeline.py- Scalable data processing pipeline - π€
distributed_training.py- Distributed machine learning - πΌ
workflow_orchestration.py- Complex workflow orchestration
-
π― Choose your installation method:
Option A: uvx (Easiest! π)
# No installation needed! uvx handles everythingOption B: Development setup
git clone <repository-url> cd ray-mcp uv sync
-
βοΈ Add to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):For uvx installation:
{ "mcpServers": { "ray-mcp": { "command": "uvx", "args": ["ray-mcp-server"] } } }For development setup:
{ "mcpServers": { "ray-mcp": { "command": "/opt/homebrew/bin/uv", "args": ["run", "--directory", "/absolute/path/to/ray-mcp", "ray-mcp-server"] } } } -
π For remote Ray clusters (like Kubernetes), add port-forwarding and environment:
kubectl port-forward -n ray-cluster ray-cluster-kuberay-head-<pod-id> 10001:10001
For uvx:
{ "mcpServers": { "ray-mcp": { "command": "uvx", "args": ["ray-mcp-server"], "env": { "RAY_ADDRESS": "ray://127.0.0.1:10001" } } } } -
π Restart Claude Desktop and test with: "What Ray tools are available?" π
- π’ Kubernetes Ray Clusters: See docs/KUBERNETES_SETUP.md
- βοΈ Configuration Examples: See docs/config/
- π¨βπ» Development Guide: See CLAUDE.md
# Run all tests
uv run pytest
# Run specific test categories
uv run pytest tests/test_mcp_tools.py
uv run pytest tests/test_multi_node_cluster.py
uv run pytest tests/test_e2e_integration.py# Run linting and formatting checks
make lint
# Format code automatically
make format
# Run type checking
uv run pyright ray_mcp/
# Run code formatting
uv run black ray_mcp/
uv run isort ray_mcp/This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
This software includes code originally from ray-mcp licensed under the MIT License. See NOTICE file for full attribution details.
Ready to supercharge your Ray workflows? Get started now! πβ¨