Research Swarm MCP
Relevant source files
The following files were used as context for generating this wiki page:
- mcp-servers/README.md
- README.md
- CHANGELOG.md
- audits/legalai-system/phase1-audit.json
- audits/legalai-system/phase2-mcp-scan.md
- mcp-servers/research-swarm/server.js
- mcp-servers/research-swarm/formula-engine.js
- mcp-servers/research-swarm/circuit-breaker.js
- mcp-servers/research-swarm/legalai-integration.js
The Research Swarm MCP is a domain-agnostic adaptive research engine designed to solve universal AI challenges such as multi-step research orchestration and confidence tracking. It functions as the primary orchestration layer within the project's research pipeline, enabling structured discovery, validation, and synthesis of information.
Operating on port 3012, the Research Swarm integrates several sophisticated sub-systems, including a formula-based confidence engine and a fault-tolerant circuit breaker. It is primarily used for complex tasks like technical documentation synthesis, financial due diligence, and academic literature reviews.
Sources: mcp-servers/README.md:12-25, mcp-servers/README.md:46-56
Architecture and Components
The Research Swarm architecture follows a tiered approach where a central orchestration layer manages specialized engines for analysis and extraction.
The diagram shows the Research Swarm as the orchestration layer directing data through analyzers before final scoring and reporting.
Sources: mcp-servers/README.md:12-42
Key Components
| Component | Responsibility | Relevant Files |
|---|---|---|
| Formula Engine | Confidence scoring algorithms and statistical analysis. | formula-engine.js, confidence-calculator.js |
| Circuit Breaker | Fault tolerance and failure handling (STAB-004). | circuit-breaker.js |
| Mode Router | Orchestrates multi-mode operations (Discovery, Validation, Synthesis). | mode-router.js |
| Query Analyzer | Classification of incoming research queries. | query-analyzer.ts |
| Entity Extraction | Pattern detection and entity identification. | entity-extraction.js |
Sources: mcp-servers/README.md:58-66, CHANGELOG.md:166-173
Operational Capabilities
Confidence Scoring and Formulas
The Research Swarm utilizes a specialized formula-engine.js to calculate confidence levels for research findings. This system works in tandem with the Basin Analyzer to measure context drift and stability.
Sources: mcp-servers/README.md:58, CHANGELOG.md:168
Fault Tolerance (STAB-004)
The system implements a circuit breaker to handle 504 errors and prevent failure during high-throughput operations. It supports rate limiting of 50 saves per second to ensure stability.
Sources: mcp-servers/README.md:52-54, mcp-servers/README.md:133-134
This sequence demonstrates the fault tolerance logic where the circuit breaker manages retries during service overloads.
Sources: mcp-servers/README.md:53, mcp-servers/README.md:134
API and Integration
The Research Swarm provides several POST endpoints for managing research tasks and actors.
Primary Endpoints
| Endpoint | Method | Description |
|---|---|---|
/swarm/start | POST | Initiates the research swarm process. |
/swarm/pause | POST | Pauses active swarm operations. |
/swarm/status | GET | Returns the current status of the research engine. |
/theories/batch-discover | POST | Executes batch discovery for theoretical research. |
/actors/batch-discover | POST | Identifies and discovers entities/actors in a research context. |
Sources: mcp-servers/README.md:73-77, audits/legalai-system/phase1-audit.json:28-30
Technical Constraints
- Port: 3012
- Throughput: 50 saves/second sustained.
- Latency: p95 < 200ms per operation.
- Error Rate: 0% (achieved via STAB-004 rate limiting).
Sources: mcp-servers/README.md:131-134
Deployment and Configuration
The server can be started using standard Node.js commands or configured as an MCP server within a client like Claude.
Start Command
cd research-swarm
npm install
npm start
Sources: mcp-servers/README.md:68-71
MCP Client JSON Configuration
"research-swarm": {
"command": "node",
"args": ["./eng-platform/mcp-servers/research-swarm/legalai-research-server.js"],
"env": {
"ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
}
}
Sources: mcp-servers/README.md:118-124
Summary
The Research Swarm MCP acts as the "Adaptive Research Engine" for the engineering platform. By combining multi-mode orchestration with rigid fault tolerance and statistical confidence scoring, it provides a reliable foundation for AI-driven research tasks across various professional domains.
Sources: mcp-servers/README.md:46-56, CHANGELOG.md:166-173