| Crates.io | ruv-swarm-mcp |
| lib.rs | ruv-swarm-mcp |
| version | 0.2.0 |
| created_at | 2025-06-30 11:27:56.196614+00 |
| updated_at | 2025-06-30 16:46:01.939936+00 |
| description | Model Context Protocol (MCP) integration for RUV Swarm |
| homepage | |
| repository | https://github.com/ruvnet/ruv-FANN |
| max_upload_size | |
| id | 1731724 |
| size | 162,369 |
ruv-swarm-mcp is a powerful Model Context Protocol (MCP) server implementation for the RUV-Swarm orchestration system. It provides Claude Code and other MCP-compatible clients with seamless access to advanced swarm intelligence capabilities through a standardized JSON-RPC interface.
The ruv-swarm-mcp crate bridges the gap between Claude Code's AI capabilities and RUV-Swarm's distributed agent orchestration system. By implementing the Model Context Protocol specification, it enables Claude to directly control and coordinate intelligent agent swarms for complex task execution.
# Clone the repository
git clone https://github.com/ruvnet/ruv-FANN.git
cd ruv-FANN/ruv-swarm/crates/ruv-swarm-mcp
# Build the MCP server
cargo build --release
# Install globally
cargo install --path .
cargo install ruv-swarm-mcp
# Basic startup
ruv-swarm-mcp
# With custom configuration
ruv-swarm-mcp --config mcp-config.json --port 3000
# Debug mode
RUST_LOG=debug ruv-swarm-mcp --debug
Add to your Claude Code configuration:
{
"mcpServers": {
"ruv-swarm": {
"command": "ruv-swarm-mcp",
"args": ["--stdio"],
"env": {
"RUST_LOG": "info"
}
}
}
}
# Start Claude Code with ruv-swarm MCP tools
claude-code --mcp-server ruv-swarm
# The following tools will be available in Claude Code:
# - mcp__ruv-swarm__swarm_init
# - mcp__ruv-swarm__agent_spawn
# - mcp__ruv-swarm__task_orchestrate
# - mcp__ruv-swarm__swarm_monitor
# ... and 9 more tools
swarm_initInitialize a new swarm with specified topology and configuration.
Parameters:
topology (required): "mesh" | "hierarchical" | "ring" | "star"maxAgents (optional): Maximum number of agents (default: 5)strategy (optional): "balanced" | "specialized" | "adaptive"Example:
{
"name": "swarm_init",
"arguments": {
"topology": "mesh",
"maxAgents": 10,
"strategy": "balanced"
}
}
agent_spawnCreate new agents with specific roles and capabilities.
Parameters:
type (required): "researcher" | "coder" | "analyst" | "optimizer" | "coordinator"name (optional): Custom agent namecapabilities (optional): Array of agent capabilitiesExample:
{
"name": "agent_spawn",
"arguments": {
"type": "researcher",
"name": "Research Agent Alpha",
"capabilities": ["data_analysis", "literature_review", "report_generation"]
}
}
agent_listList all active agents in the swarm.
Parameters:
filter (optional): "all" | "active" | "idle" | "busy"agent_metricsGet performance metrics for specific agents or all agents.
Parameters:
agentId (optional): Specific agent IDmetric (optional): "all" | "cpu" | "memory" | "tasks" | "performance"task_orchestrateOrchestrate complex tasks across the swarm using various strategies.
Parameters:
task (required): Task description or objectivepriority (optional): "low" | "medium" | "high" | "critical"strategy (optional): "parallel" | "sequential" | "adaptive"maxAgents (optional): Maximum agents to useExample:
{
"name": "task_orchestrate",
"arguments": {
"task": "Analyze market trends and generate investment recommendations",
"priority": "high",
"strategy": "adaptive",
"maxAgents": 5
}
}
task_statusCheck the progress of running tasks.
Parameters:
taskId (optional): Specific task IDdetailed (optional): Include detailed progress informationtask_resultsRetrieve results from completed tasks.
Parameters:
taskId (required): Task ID to retrieve results forformat (optional): "summary" | "detailed" | "raw"swarm_statusGet comprehensive swarm status and health information.
Parameters:
verbose (optional): Include detailed agent informationswarm_monitorMonitor swarm activity in real-time.
Parameters:
duration (optional): Monitoring duration in seconds (default: 10)interval (optional): Update interval in seconds (default: 1)memory_usageGet current memory usage statistics.
Parameters:
detail (optional): "summary" | "detailed" | "by-agent"benchmark_runExecute performance benchmarks.
Parameters:
type (optional): "all" | "wasm" | "swarm" | "agent" | "task"iterations (optional): Number of iterations (default: 10)features_detectDetect runtime features and capabilities.
Parameters:
category (optional): "all" | "wasm" | "simd" | "memory" | "platform"neural_statusGet neural agent status and performance metrics.
Parameters:
agentId (optional): Specific neural agent IDneural_trainTrain neural agents with sample tasks.
Parameters:
agentId (optional): Specific agent ID to trainiterations (optional): Number of training iterations (default: 10)neural_patternsGet cognitive pattern information for neural agents.
Parameters:
pattern (optional): "all" | "convergent" | "divergent" | "lateral" | "systems" | "critical" | "abstract"# In Claude Code, use the MCP tools to orchestrate research
await mcp__ruv_swarm__swarm_init({
"topology": "hierarchical",
"maxAgents": 8,
"strategy": "specialized"
})
# Spawn specialized research agents
await mcp__ruv_swarm__agent_spawn({
"type": "researcher",
"name": "Literature Researcher",
"capabilities": ["academic_search", "citation_analysis"]
})
await mcp__ruv_swarm__agent_spawn({
"type": "analyst",
"name": "Data Analyst",
"capabilities": ["statistical_analysis", "visualization"]
})
# Orchestrate comprehensive research task
await mcp__ruv_swarm__task_orchestrate({
"task": "Conduct comprehensive analysis of renewable energy trends",
"priority": "high",
"strategy": "parallel",
"maxAgents": 4
})
# Monitor progress
await mcp__ruv_swarm__swarm_monitor({
"duration": 30,
"interval": 2
})
# Initialize development-focused swarm
await mcp__ruv_swarm__swarm_init({
"topology": "mesh",
"maxAgents": 6,
"strategy": "adaptive"
})
# Create coding agents
await mcp__ruv_swarm__agent_spawn({
"type": "coder",
"name": "Backend Developer",
"capabilities": ["python", "rust", "api_development"]
})
await mcp__ruv_swarm__agent_spawn({
"type": "coder",
"name": "Frontend Developer",
"capabilities": ["javascript", "react", "ui_design"]
})
# Orchestrate development project
await mcp__ruv_swarm__task_orchestrate({
"task": "Build a distributed task management system",
"priority": "critical",
"strategy": "sequential",
"maxAgents": 5
})
# Get performance metrics
await mcp__ruv_swarm__agent_metrics({
"metric": "all"
})
mcp-config.json){
"bind_addr": "127.0.0.1:3000",
"max_connections": 100,
"request_timeout_secs": 300,
"enable_websocket": true,
"enable_stdio": true,
"log_level": "info",
"features": {
"neural_agents": true,
"wasm_modules": true,
"simd_support": true,
"persistent_memory": true
},
"swarm_defaults": {
"max_agents": 10,
"strategy": "balanced",
"topology": "mesh"
}
}
# Server configuration
export RUV_SWARM_PORT=3000
export RUV_SWARM_HOST=127.0.0.1
export RUV_SWARM_MAX_CONNECTIONS=100
# Feature flags
export RUV_SWARM_ENABLE_NEURAL=true
export RUV_SWARM_ENABLE_WASM=true
export RUV_SWARM_ENABLE_SIMD=true
# Debugging
export RUST_LOG=debug
export RUV_SWARM_DEBUG=true
# Run all tests
cargo test
# Run MCP integration tests
cargo test mcp_integration
# Run with debug output
RUST_LOG=debug cargo test -- --nocapture
# Clone the repository
git clone https://github.com/ruvnet/ruv-FANN.git
cd ruv-FANN/ruv-swarm/crates/ruv-swarm-mcp
# Install dependencies
cargo build
# Run in development mode
cargo run -- --debug --config dev-config.json
# Run tests with coverage
cargo tarpaulin --out Html
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)ws://localhost:3000/mcp - Main MCP WebSocket endpointws://localhost:3000/events - Real-time event streamingws://localhost:3000/metrics - Performance metrics streamGET / - Server information and health checkGET /tools - List all available MCP toolsGET /status - Current swarm statusGET /metrics - Performance metricsPOST /execute - Execute MCP tool directlyAll MCP tools follow the JSON-RPC 2.0 specification:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "tool_name",
"arguments": { ... }
},
"id": 1
}
This project is licensed under the MIT License - see the LICENSE file for details.
| Tool | Average Latency | Throughput | Memory Usage |
|---|---|---|---|
| swarm_init | 150ms | 100 ops/sec | 2.5MB |
| agent_spawn | 50ms | 500 ops/sec | 1.2MB |
| task_orchestrate | 200ms | 50 ops/sec | 5.1MB |
| swarm_monitor | 10ms | 1000 ops/sec | 0.8MB |
Created by rUv - Pioneering the future of AI agent orchestration and swarm intelligence.
ruv-swarm-mcp enables seamless integration between Claude Code and distributed AI agent systems, making complex multi-agent coordination accessible through standardized protocols.