| Crates.io | ruvswarm-mcp |
| lib.rs | ruvswarm-mcp |
| version | 1.1.0 |
| created_at | 2025-07-12 20:09:52.793636+00 |
| updated_at | 2025-07-12 20:09:52.793636+00 |
| description | Model Context Protocol (MCP) integration for RUV Swarm |
| homepage | |
| repository | https://github.com/ruvnet/ruv-FANN |
| max_upload_size | |
| id | 1749636 |
| size | 281,651 |
ruvswarm-mcp is a powerful Model Context Protocol (MCP) server implementation for the ruvswarm 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 ruvswarm-mcp crate bridges the gap between Claude Code's AI capabilities and ruvswarm'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/ruvswarm/crates/ruvswarm-mcp
# Build the MCP server
cargo build --release
# Install globally
cargo install --path .
cargo install ruvswarm-mcp
# Basic startup
ruvswarm-mcp
# With custom configuration
ruvswarm-mcp --config mcp-config.json --port 3000
# Debug mode
RUST_LOG=debug ruvswarm-mcp --debug
The easiest way to integrate ruvswarm with Claude Code is using the built-in MCP management:
# Add ruvswarm MCP server to Claude Code
claude mcp add ruvswarm ruvswarm/bin/ruvswarm-mcp-stdio
# Start Claude Code with ruvswarm MCP tools
claude-code
If you prefer manual configuration, add to your Claude Code configuration:
{
"mcpServers": {
"ruvswarm": {
"command": "ruvswarm-mcp",
"args": ["--stdio"],
"env": {
"RUST_LOG": "info"
}
}
}
}
Once configured, the following 13+ MCP tools will be available in Claude Code:
mcp__ruvswarm__spawn - Create new agentsmcp__ruvswarm__agent_list - List all agentsmcp__ruvswarm__orchestrate - Orchestrate complex tasksmcp__ruvswarm__monitor - Monitor swarm activitymcp__ruvswarm__memory_store - Store persistent datamcp__ruvswarm__memory_get - Retrieve stored datamcp__ruvswarm__optimize - Optimize swarm performancemcp__ruvswarm__task_create - Create specific tasksmcp__ruvswarm__agent_metrics - Get agent performance metricsmcp__ruvswarm__query - Query swarm stateSee the MCP Integration Guide for detailed usage examples and workflows.
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__ruvswarm__swarm_init({
"topology": "hierarchical",
"maxAgents": 8,
"strategy": "specialized"
})
# Spawn specialized research agents
await mcp__ruvswarm__agent_spawn({
"type": "researcher",
"name": "Literature Researcher",
"capabilities": ["academic_search", "citation_analysis"]
})
await mcp__ruvswarm__agent_spawn({
"type": "analyst",
"name": "Data Analyst",
"capabilities": ["statistical_analysis", "visualization"]
})
# Orchestrate comprehensive research task
await mcp__ruvswarm__task_orchestrate({
"task": "Conduct comprehensive analysis of renewable energy trends",
"priority": "high",
"strategy": "parallel",
"maxAgents": 4
})
# Monitor progress
await mcp__ruvswarm__swarm_monitor({
"duration": 30,
"interval": 2
})
# Initialize development-focused swarm
await mcp__ruvswarm__swarm_init({
"topology": "mesh",
"maxAgents": 6,
"strategy": "adaptive"
})
# Create coding agents
await mcp__ruvswarm__agent_spawn({
"type": "coder",
"name": "Backend Developer",
"capabilities": ["python", "rust", "api_development"]
})
await mcp__ruvswarm__agent_spawn({
"type": "coder",
"name": "Frontend Developer",
"capabilities": ["javascript", "react", "ui_design"]
})
# Orchestrate development project
await mcp__ruvswarm__task_orchestrate({
"task": "Build a distributed task management system",
"priority": "critical",
"strategy": "sequential",
"maxAgents": 5
})
# Get performance metrics
await mcp__ruvswarm__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 ruvswarm_PORT=3000
export ruvswarm_HOST=127.0.0.1
export ruvswarm_MAX_CONNECTIONS=100
# Feature flags
export ruvswarm_ENABLE_NEURAL=true
export ruvswarm_ENABLE_WASM=true
export ruvswarm_ENABLE_SIMD=true
# Debugging
export RUST_LOG=debug
export ruvswarm_DEBUG=true
# Run all tests (24 unit tests + 4 doc tests)
cargo test
# Run specific test modules
cargo test tests::integration_tests
cargo test tests::security_tests
# Run with debug output
RUST_LOG=debug cargo test -- --nocapture
# Run individual test
cargo test test_mcp_server_creation
# Clone the repository
git clone https://github.com/ruvnet/ruv-FANN.git
cd ruv-FANN/ruvswarm/crates/ruvswarm-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.
ruvswarm-mcp enables seamless integration between Claude Code and distributed AI agent systems, making complex multi-agent coordination accessible through standardized protocols.