ruv-swarm-mcp
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.
๐ Introduction
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.
Key Features
- 13+ Comprehensive MCP Tools - Complete swarm orchestration capabilities
- Claude Code Integration - Seamless integration with Anthropic's Claude Code CLI
- JSON-RPC 2.0 Protocol - Standards-compliant MCP server implementation
- WebSocket & Stdio Support - Multiple communication protocols
- Real-time Monitoring - Live event streaming and performance metrics
- Neural Agent Support - Advanced AI agents with cognitive pattern recognition
- WASM Integration - High-performance WebAssembly modules
- Persistent Memory - Session-based and long-term data storage
- Performance Optimization - Built-in profiling and auto-optimization
๐ฆ Installation
From Source
# Clone the repository
# Build the MCP server
# Install globally
Using Cargo
๐ ๏ธ Usage
Starting the MCP Server
# Basic startup
# With custom configuration
# Debug mode
RUST_LOG=debug
Claude Code Integration
1. Configure Claude Code MCP Server
Add to your Claude Code configuration:
2. Using ruv-swarm Tools in Claude Code
# Start Claude Code with ruv-swarm MCP tools
# 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
๐ง Complete MCP Tools Documentation
1. Swarm Initialization
swarm_init
Initialize 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:
2. Agent Management
agent_spawn
Create new agents with specific roles and capabilities.
Parameters:
type(required):"researcher"|"coder"|"analyst"|"optimizer"|"coordinator"name(optional): Custom agent namecapabilities(optional): Array of agent capabilities
Example:
agent_list
List all active agents in the swarm.
Parameters:
filter(optional):"all"|"active"|"idle"|"busy"
agent_metrics
Get performance metrics for specific agents or all agents.
Parameters:
agentId(optional): Specific agent IDmetric(optional):"all"|"cpu"|"memory"|"tasks"|"performance"
3. Task Orchestration
task_orchestrate
Orchestrate 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 use
Example:
task_status
Check the progress of running tasks.
Parameters:
taskId(optional): Specific task IDdetailed(optional): Include detailed progress information
task_results
Retrieve results from completed tasks.
Parameters:
taskId(required): Task ID to retrieve results forformat(optional):"summary"|"detailed"|"raw"
4. Monitoring & Analytics
swarm_status
Get comprehensive swarm status and health information.
Parameters:
verbose(optional): Include detailed agent information
swarm_monitor
Monitor swarm activity in real-time.
Parameters:
duration(optional): Monitoring duration in seconds (default: 10)interval(optional): Update interval in seconds (default: 1)
memory_usage
Get current memory usage statistics.
Parameters:
detail(optional):"summary"|"detailed"|"by-agent"
5. Performance & Benchmarking
benchmark_run
Execute performance benchmarks.
Parameters:
type(optional):"all"|"wasm"|"swarm"|"agent"|"task"iterations(optional): Number of iterations (default: 10)
features_detect
Detect runtime features and capabilities.
Parameters:
category(optional):"all"|"wasm"|"simd"|"memory"|"platform"
6. Neural Agent Capabilities
neural_status
Get neural agent status and performance metrics.
Parameters:
agentId(optional): Specific neural agent ID
neural_train
Train neural agents with sample tasks.
Parameters:
agentId(optional): Specific agent ID to trainiterations(optional): Number of training iterations (default: 10)
neural_patterns
Get cognitive pattern information for neural agents.
Parameters:
pattern(optional):"all"|"convergent"|"divergent"|"lateral"|"systems"|"critical"|"abstract"
๐ Claude Code Workflow Examples
Research & Analysis Workflow
# In Claude Code, use the MCP tools to orchestrate research
await
# Spawn specialized research agents
await
await
# Orchestrate comprehensive research task
await
# Monitor progress
await
Development Workflow
# Initialize development-focused swarm
await
# Create coding agents
await
await
# Orchestrate development project
await
# Get performance metrics
await
โ๏ธ Configuration
Server Configuration (mcp-config.json)
Environment Variables
# Server configuration
# Feature flags
# Debugging
๐งช Development & Testing
Running Tests
# Run all tests
# Run MCP integration tests
# Run with debug output
RUST_LOG=debug
Development Setup
# Clone the repository
# Install dependencies
# Run in development mode
# Run tests with coverage
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ API Reference
WebSocket Endpoints
ws://localhost:3000/mcp- Main MCP WebSocket endpointws://localhost:3000/events- Real-time event streamingws://localhost:3000/metrics- Performance metrics stream
HTTP Endpoints
GET /- Server information and health checkGET /tools- List all available MCP toolsGET /status- Current swarm statusGET /metrics- Performance metricsPOST /execute- Execute MCP tool directly
JSON-RPC Methods
All MCP tools follow the JSON-RPC 2.0 specification:
๐ Links
- Main Repository: https://github.com/ruvnet/ruv-FANN
- Documentation: https://github.com/ruvnet/ruv-FANN/tree/main/ruv-swarm/docs
- Model Context Protocol: https://modelcontextprotocol.io
- Claude Code: https://claude.ai/code
- Issues: https://github.com/ruvnet/ruv-FANN/issues
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ฏ Performance Benchmarks
| 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 |
๐ค Acknowledgments
- Anthropic for Claude Code and MCP specification
- WebAssembly Community for WASM runtime capabilities
- Rust Community for excellent async/tokio ecosystem
- Contributors who have helped improve this project
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.