swarm
SDK to build Agents in rust. Build and manage complex, self-correcting agent teams. Launch multi-agent systems via configuration files or using an Agent Factory. It's the robust framework for orchestrating intelligent agents using open standards (MCP, A2A).
claude mcp add --transport stdio fcn06-swarm cargo run --release \ --env LLM_A2A_API_KEY="Your A2A API key" \ --env LLM_MCP_API_KEY="Your MCP API key" \ --env LLM_JUDGE_API_KEY="Your LLM-as-a-Judge API key" \ --env LLM_PLANNER_API_KEY="Your Planner API key"
How to use
Swarm is a Rust-based framework for building and orchestrating a network of specialized agents that collaborate through flexible workflows. It implements a conductor (Planner Agent) and a suite of domain-specific agents (Domain Agents) that can be instantiated on demand via an Agent Factory. The system leverages the MCP (Model Context Protocol) and A2A (Agent-to-Agent) protocols to enable robust, interoperable communication between agents and external tools. When you run Swarm, you can either execute a predefined static workflow loaded from JSON or dynamically generate a workflow based on the capabilities of available agents, then execute the plan with an Executor Agent. A built-in Evaluation Service using an LLM-as-a-Judge component provides feedback to refine dynamic plans, creating a continuous improvement loop for complex tasks.
How to install
Prerequisites:
- Rust and Cargo installed (Rust is required to build and run Swarm).
- Git installed to clone the repository.
- An LLM API key setup (as described by your provider) for A2A, MCP, Judge, and Planner services.
Step-by-step:
- Clone the repository: git clone https://github.com/fcn06/swarm.git
- Navigate into the project: cd swarm
- Build in release mode: cargo build --release
- Set required environment variables (example, replace placeholders with real keys): export LLM_A2A_API_KEY=<YOUR-LLM-API-KEY> export LLM_MCP_API_KEY=<YOUR-LLM-API-KEY> export LLM_JUDGE_API_KEY=<YOUR-LLM-API-KEY> export LLM_PLANNER_API_KEY=<YOUR-LLM-API-KEY>
- Run the Swarm server (the default configuration runs the release build): cargo run --release
- Optional: integrate with an MCP client or A2A client to trigger planner/executor workflows as described in the documentation.
Notes:
- Ensure your environment has network access to your chosen LLM provider endpoints.
- The repository provides scripts and examples for both static and dynamic workflow demonstrations; consult the docs folder for paths to those scripts.
Additional notes
Tips and common issues:
- If dynamic workflow generation fails, verify that the Planner Agent has access to all required Domain Agents and their capabilities are correctly registered in the runtime.
- When using the LLM-as-a-Judge Evaluation Service, ensure your API keys have the appropriate permissions and rate limits for the expected workload.
- If you encounter port or service discovery issues, check the MCP Runtime networking configuration and verify that Agent Factory can instantiate new Domain Agents as needed.
- Environment variables for keys can be centralized in a .env file and loaded at startup if your deployment environment supports it.
- For larger deployments, consider scaling Domain Agents and ensuring the Executor has robust retry and timeout handling to avoid stuck workflows.
Related MCP Servers
Context-Engineering-for-Multi-Agent-Systems
Save thousands of lines of code by building universal, domain-agnostic Multi-Agent Systems (MAS) through high-level semantic orchestration. This repository provides a production-ready blueprint for the Agentic Era, allowing you to replace rigid, hard-coded workflows with a dynamic transparent Context Engine that provides 100% transparency.
Q4_learning
This repository serves as the comprehensive workspace for Quarter 4 academic endeavors, encompassing assignments, technical documentation, experimental implementations, and applied projects.
kiro-powers
Repository of custom kiro powers. https://kiro.dev/docs/powers/
scorable
MCP for Scorable Evaluation Platform
WisAI
Agentic AI Orchestrator and coding agent for business-as-code platforms, services, and data. Focused on streamlining development for startups and small business who want to own their own cloud.
project-synapse
A production-ready multi-agent system showcasing Agent Communication Protocol (ACP) and Model Context Protocol (MCP) capabilities through a collaborative research workflow.