Architecture Diagram
The architecture diagram is being updated and will provide detailed system architecture diagrams in future versions.
Core Modules
MCP Gateway (mcp-gateway)
MCP Gateway is the core component of the system, responsible for handling all MCP protocol requests:Request Processing
- Unified Entry:
/*listens to all HTTP requests - Route Distribution: Dynamic request distribution based on route prefix
Protocol Conversion
- Protocol Parsing: Parse JSON-RPC format requests
- Tool Distribution: Parse tool names and construct call parameters
Main Functions
1
Request Routing
Request distribution based on route prefix and suffix (
/sse, /message, /mcp)2
Protocol Parsing
Parse JSON-RPC format to extract methods and parameters
3
Service Invocation
Invoke external services and parse results
4
Configuration Reading
Dynamically load and apply configuration information
Management Backend (web)
Provides a visual management interface with the following core modules:Proxy Configuration Module
Proxy Configuration Module
Used to configure MCP gateway proxies and tools, supporting graphical configuration interface
Conversation Experiment Platform
Conversation Experiment Platform
Simple Chat for testing MCP, mainly provided for developers and users who need to integrate into custom systems for reference
User Management Module
User Management Module
User permissions, information maintenance, and access control
Management Backend Service (apiserver)
Provides complete backend API services:API Services
- Configuration management API
- User interface management
- Chat history queries
Configuration Management
- Configuration write storage
- Hot update notifications
- Permission control
Storage System
Configuration Storage
Stores all MCP services, tools, routing and other configuration information:SQLite
Lightweight database, suitable for single-machine deployment and development
PostgreSQL/MySQL
Production-grade databases, suitable for multi-node deployment
API Storage
Enterprise-grade database, suitable for production environments
Web Data Storage
Stores user data, session records, etc.:- User account information
- Chat session history
- System configuration data
- Operation log records
External Service Integration
MCP Gateway is designed for seamless integration with existing business systems:REST API Services
REST API Services
Supports standard REST API calls, including GET, POST, PUT, DELETE and other methods
Webhook Services
Webhook Services
Supports Webhook callbacks and event trigger mechanisms
Database Services
Database Services
Can directly integrate with existing database systems, supporting multiple database types
Data Flow
1
Request Reception
MCP Client sends requests to specified endpoints of MCP Gateway
2
Protocol Parsing
Gateway parses MCP protocol format and extracts tool invocation information
3
Configuration Lookup
Look up corresponding configuration information based on tool name
4
Service Invocation
Call backend services using configured templates and parameters
5
Response Processing
Process backend service responses and convert to MCP protocol format
6
Result Return
Return processing results to MCP Client
Deployment Architecture
Single Machine Deployment
All-in-One Deployment
All services run on the same machine, suitable for development and testing environments
Distributed Deployment
Microservice Architecture
Each component is deployed independently, supporting horizontal scaling and load balancing
Containerized Deployment
Use Docker and Kubernetes for containerized deployment
Extensibility Design
MCP Gateway adopts a modular design and supports the following extensions:- Protocol Extensions: Support for new MCP protocol versions
- Storage Extensions: Support for new storage backends
- Authentication Extensions: Support for multiple authentication mechanisms
- Monitoring Extensions: Integration with various monitoring and logging systems
To deeply understand the specific implementation of each component, please refer to the corresponding configuration documentation and development guides.