System Overview
Pcnaid MCP Hub is designed as a scalable, modular platform for managing Model Context Protocol (MCP) servers. The architecture follows modern web application patterns with clear separation of concerns, microservices-ready design, and extensibility in mind.High-Level Architecture
Core Components
1. Application Server
The main Node.js/Express application that handles all HTTP requests and coordinates between services.- HTTP request handling
- WebSocket connections for real-time features
- Service coordination
- Middleware chain management
- Error handling and logging
2. MCP Service Layer
Manages the lifecycle and communication with MCP servers.- Process lifecycle management
- Health monitoring
- Request routing
- Error recovery
- Resource management
3. Smart Routing Engine
Provides AI-powered tool discovery and routing using vector embeddings.- Vector embedding generation
- Similarity search
- Result ranking and filtering
- Tool metadata management
4. Authentication & Authorization
Handles user authentication, session management, and access control.- JWT-based authentication
- Role-based access control (RBAC)
- Session management
- API key authentication
- Group-based permissions
5. Monitoring & Logging
Provides comprehensive monitoring, metrics collection, and logging.- Real-time metrics collection
- Performance monitoring
- Error tracking
- Alert management
- Audit logging
Data Architecture
Database Schema
Caching Strategy
- L1 (Memory): Fast access for frequently used data
- L2 (Redis): Shared cache across instances
- L3 (Database): Persistent storage with query optimization