Federated MCP Architecture β
What We Actually Built and Tested
Complete guide to integrating Research Library with Mnemoverse Docs through the standard MCP protocol
π― Overview β
Imagine you have:
- π Research Library - specialized in searching and analyzing research data
- π Mnemoverse Docs - comprehensive technical documentation repository
Before: Research Library had no access to documentation
Now: Research Library can query documentation with "find everything about MCP" and get precise answers
In practice: When someone asks Research Library about a technical topic, it automatically checks current documentation and provides comprehensive responses.
β Current Implementation β
1. Federated MCP Architecture π β
Two independent services communicate through the standard MCP JSON-RPC 2.0 protocol:
βββββββββββββββββββββββ MCP JSON-RPC 2.0 βββββββββββββββββββββββ
β Research Library β ββββββββββββββββββββββ β Mnemoverse Docs β
β MCP Client β HTTP POST /mcp β MCP Server β
β (localhost:3001) β β (localhost:3003) β
βββββββββββββββββββββββ βββββββββββββββββββββββ
2. Dual API Server for Documentation π β
javascript
// mnemoverse-docs/api-server.js (port 3003)
app.post('/api/search', ...) // HTTP REST API
app.post('/mcp', ...) // MCP JSON-RPC endpoint
app.get('/.well-known/mcp', ...) // MCP Discovery
Capabilities:
- β HTTP REST API for standard web requests
- β MCP JSON-RPC for federated calls
- β
Auto-discovery via
/.well-known/mcp
- β CORS configuration for security
3. Ready-to-Use Federated MCP Client π± β
python
# Simple to use
from mcp_servers.federated_mcp_client import FederatedMCPClient
client = FederatedMCPClient()
results = await client.search_docs("MCP protocol")
document = await client.get_document("about.md")
π§ͺ Test Results β
Test 1: Documentation Search β
bash
# Query: "MCP protocol"
β
Found 3 documents in 0.09s
1. MCP Server Development Guide (score: 4)
2. Noosphere Layer Documentation (score: 1)
3. API Integration Guide (score: 2)
Test 2: Document Retrieval β
bash
# Document request: "about.md"
β
Document retrieved in 0.01s
π Title: about
π Size: 9899 characters
π Modified: 2025-07-31T18:30:18.677Z
Test 3: Performance β
bash
πββοΈ 4 parallel requests:
β±οΈ Sequential: 0.02s
π Parallel: 0.01s
π Speedup: 1.4x
Test 4: Federated Integration β
bash
β
JSON-RPC 2.0 protocol working
β
MCP discovery endpoint responding
β
tools/list returning correct schemas
β
tools/call executing search_docs and get_document
β
Error handling working correctly
π Real-World Use Cases β
...existing code...
π Implementation Structure β
Mnemoverse Docs (MCP Server) β
mnemoverse-docs/
βββ api-server.js # π Dual HTTP+MCP server
βββ docs/ # Existing documentation
βββ package.json # API server dependencies
Research Library (MCP Client) β
mnemoverse-research-library/
βββ src/mcp_servers/
β βββ research_library_server.py # Main MCP server
β βββ federated_mcp_client.py # π Federated client
βββ test_comprehensive_federated_mcp.py # π Comprehensive tests
βββ demo_federated_research.py # π Real scenario demos
π§ Setup Instructions β
1. Start mnemoverse-docs MCP Server β
bash
cd /Users/eduardizgorodin/Projects/mnemoverse/mnemoverse-docs
node api-server.js &
# Check status
curl http://localhost:3003/health
2. Test Federated Calls β
bash
cd /Users/eduardizgorodin/Projects/mnemoverse/mnemoverse-research-library
python test_comprehensive_federated_mcp.py
3. Run Real Scenario Demos β
bash
python demo_federated_research.py
π οΈ Technical Implementation β
...existing code...
β‘ Performance Metrics β
...existing code...
β Pending Improvements β
...existing code...
π’ Deployment and CI/CD β
...existing code...
π Debugging and Diagnostics β
...existing code...