Skip to content

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 ​

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...