Claude Swarm MCP Server
Enables multi-agent orchestration and coordination using specialized, persistent Claude agents for complex workflows like financial analysis and research. It supports intelligent agent handoffs, local storage, and pre-built team templates through Claude Desktop.
README
Claude Swarm MCP Server
A Model Context Protocol (MCP) server that enables multi-agent orchestration using Claude AI through Claude Desktop. Create, manage, and coordinate specialized AI agents for complex workflows like financial analysis, customer service, and research.
🚀 Features
- 🤖 Persistent Agents: Create specialized Claude agents that survive restarts
- 🔄 Agent Coordination: Intelligent handoffs between agents based on expertise
- 💾 Local Storage: All agents and conversations saved locally
- 📊 Pre-built Templates: Ready-to-use financial analysis and customer service teams
- 🎯 Specialized Functions: Custom tools and capabilities per agent
- 🔧 Easy Integration: Works seamlessly with Claude Desktop
📋 Quick Start
Prerequisites
- Python 3.10+
- Claude Desktop installed
- Anthropic API key with billing enabled
Installation
- Clone the repository
git clone https://github.com/yourusername/claude-swarm-mcp.git
cd claude-swarm-mcp
- Install dependencies
pip install -r requirements.txt
-
Configure Claude Desktop
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"claude-swarm": {
"command": "python3",
"args": ["/path/to/claude-swarm-mcp/claude_swarm_mcp_server.py"],
"env": {
"ANTHROPIC_API_KEY": "your-api-key-here"
}
}
}
}
- Start the server
python3 claude_swarm_mcp_server.py
- Restart Claude Desktop and test with:
Create finance team with company name "Your Company"
🎯 Usage Examples
Create a Financial Analysis Team
Create finance team with company name "TechVest Capital"
This creates 4 specialized agents:
- Risk Analyst - VaR calculations, stress testing
- Portfolio Manager - Asset allocation, optimization
- Data Analyst - Market data, performance metrics
- Research Analyst - Investment research, market analysis
Chat with Specialists
Chat with agent: "Calculate the VaR for a portfolio with AAPL 30%, GOOGL 25%, MSFT 20%, AMZN 15%, TSLA 10%" using agent "Risk Analyst"
Create Custom Agents
Create agent with name "Options Specialist" and instructions "You are an expert in options trading. Calculate Greeks, analyze volatility, and recommend hedging strategies."
List All Agents
List agents
Portfolio Analysis Workflow
Chat with agent: "I need a complete analysis of my tech portfolio: analyze risk, optimize allocation, and provide investment recommendations."
Agents will coordinate automatically to provide comprehensive analysis
🔧 Available Tools
| Tool | Description |
|---|---|
create_agent |
Create a new specialized agent |
list_agents |
View all saved agents |
chat_with_agent |
Interact with specific agents |
delete_agent |
Remove an agent permanently |
create_finance_team |
Generate complete financial analysis team |
get_conversation_history |
View chat history and agent transfers |
reset_conversation |
Clear conversation history |
📁 Project Structure
claude-swarm-mcp/
├── claude_swarm.py # Core Swarm framework
├── claude_swarm_mcp_server.py # MCP server implementation
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
├── examples/ # Usage examples
│ ├── finance_workflow.py # Financial analysis example
│ ├── customer_service.py # Customer service template
│ └── research_team.py # Research coordination example
├── tests/ # Test suite
│ ├── test_agents.py # Agent functionality tests
│ ├── test_mcp_server.py # MCP server tests
│ └── test_swarm.py # Swarm coordination tests
└── docs/ # Documentation
├── API.md # API reference
├── DEPLOYMENT.md # Deployment guide
└── CONTRIBUTING.md # Contribution guidelines
🏗️ Architecture
Core Components
-
Claude Swarm Framework (
claude_swarm.py)- Multi-agent orchestration
- Automatic handoffs between agents
- Shared conversation context
- Function calling integration
-
MCP Server (
claude_swarm_mcp_server.py)- Model Context Protocol implementation
- Persistent agent storage
- Tool registration and handling
- Claude Desktop integration
-
Agent Storage (
data/)- JSON-based agent persistence
- Conversation history
- Context variables
- Backup and restore capabilities
Data Flow
Claude Desktop ↔ MCP Protocol ↔ Swarm Server ↔ Claude API
↓
Agent Storage (JSON)
🎨 Use Cases
Financial Services
- Portfolio Risk Analysis: VaR calculations, stress testing
- Investment Research: Market analysis, stock recommendations
- Compliance Monitoring: Regulatory requirements, position limits
- Client Advisory: Personalized investment advice
Customer Support
- Intelligent Triage: Route customers to appropriate specialists
- Multi-language Support: Automatic language detection and routing
- Escalation Management: Seamless handoffs to senior agents
- Knowledge Base Integration: Context-aware information retrieval
Research & Development
- Literature Review: Coordinate research across multiple domains
- Data Analysis: Statistical analysis, visualization, reporting
- Project Management: Task coordination, milestone tracking
- Technical Documentation: Automated documentation generation
🔒 Security & Privacy
- Local Storage: All data stored locally on your machine
- API Key Security: Secure API key handling through environment variables
- No External Dependencies: No third-party services for agent storage
- Audit Trail: Complete conversation history and agent interactions
🛠️ Configuration
Environment Variables
export ANTHROPIC_API_KEY="your-api-key"
export CLAUDE_SWARM_STORAGE_DIR="/custom/storage/path" # Optional
export CLAUDE_SWARM_DEBUG="true" # Optional debug mode
Storage Configuration
# Custom storage location
storage_path = "/Users/yourname/claude_agents"
server = ClaudeSwarmMCPServer(storage_dir=storage_path)
📊 Performance
- Agent Creation: < 2 seconds
- Chat Response: 3-8 seconds (depending on complexity)
- Agent Handoffs: < 1 second
- Storage Operations: < 500ms
- Memory Usage: ~50-100MB (depending on conversation history)
🔍 Troubleshooting
Common Issues
1. API Authentication Errors
# Check your API key
python3 -c "from anthropic import Anthropic; print('API key valid')"
2. MCP Connection Issues
- Restart Claude Desktop
- Check server logs for errors
- Verify config file path and syntax
3. Agent Not Responding
- Check billing status in Anthropic Console
- Verify agent instructions are clear
- Test with simple messages first
4. Storage Permission Errors
# Fix permissions
chmod 755 /path/to/storage/directory
Debug Mode
# Run server with debug logging
CLAUDE_SWARM_DEBUG=true python3 claude_swarm_mcp_server.py
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Clone and setup development environment
git clone https://github.com/yourusername/claude-swarm-mcp.git
cd claude-swarm-mcp
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
Running Tests
python -m pytest tests/ -v
📈 Roadmap
- [ ] Advanced Agent Coordination: Complex multi-step workflows
- [ ] Custom Function Registry: User-defined agent capabilities
- [ ] Web UI: Browser-based agent management interface
- [ ] Integration Templates: Pre-built integrations for popular services
- [ ] Performance Optimization: Faster response times and memory usage
- [ ] Multi-Model Support: Support for other LLM providers
- [ ] Cloud Deployment: Docker containers and cloud hosting options
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Anthropic for Claude AI and excellent API
- OpenAI for the original Swarm framework inspiration
- Model Context Protocol team for the MCP specification
- Claude Desktop team for seamless integration
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
⭐ Star this repository if you find it useful!
Built with ❤️ for the Claude AI community# Claude Swarm MCP Server
A Model Context Protocol (MCP) server that enables multi-agent orchestration using Claude AI through Claude Desktop. Create, manage, and coordinate specialized AI agents for complex workflows like financial analysis, customer service, and research.
🚀 Features
- 🤖 Persistent Agents: Create specialized Claude agents that survive restarts
- 🔄 Agent Coordination: Intelligent handoffs between agents based on expertise
- 💾 Local Storage: All agents and conversations saved locally
- 📊 Pre-built Templates: Ready-to-use financial analysis and customer service teams
- 🎯 Specialized Functions: Custom tools and capabilities per agent
- 🔧 Easy Integration: Works seamlessly with Claude Desktop
📋 Quick Start
Prerequisites
- Python 3.10+
- Claude Desktop installed
- Anthropic API key with billing enabled
Installation
- Clone the repository
git clone https://github.com/yourusername/claude-swarm-mcp.git
cd claude-swarm-mcp
- Install dependencies
pip install -r requirements.txt
- **Configure# Claude Swarm MCP Server
A Model Context Protocol (MCP) server that enables multi-agent orchestration using Claude AI through Claude Desktop. Create, manage, and coordinate specialized AI agents for complex workflows like financial analysis, customer service, and research.
🚀 Features
- 🤖 Persistent Agents: Create specialized Claude agents that survive restarts
- 🔄 Agent Coordination: Intelligent handoffs between agents based on expertise
- 💾 Local Storage: All agents and conversations saved locally
- 📊 Pre-built Templates: Ready-to-use financial analysis and customer service teams
- 🎯 Specialized Functions: Custom tools and capabilities per agent
- 🔧 Easy Integration: Works seamlessly with Claude Desktop
📋 Quick
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。