Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit bbd3d96

Browse files
committed
Add architecture
1 parent 8b352c0 commit bbd3d96

File tree

9 files changed

+344
-0
lines changed

9 files changed

+344
-0
lines changed

docs/development/architecture.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# MCP 网关架构总览
2+
3+
概述了 MCP Gateway 系统的整体架构,包括网关本身、管理后台、配套 API、存储机制以及与外部服务的集成方式。
4+
5+
---
6+
7+
## 架构图
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## 模块说明
14+
15+
### MCP 网关(mcp-gateway)
16+
- **入口**`/*` 统一监听所有 HTTP 请求,在应用层根据配置去动态分发
17+
- **路由层**:根据路由前缀和后缀 `/sse``/message``/mcp` 进行分发
18+
- **协议解析**:对 JSON-RPC 格式进行解析,提取方法与参数
19+
- **Tool分发**:解析工具名称,构造调用参数
20+
- **外部服务调用**:针对外部服务发起调用并解析结果
21+
- **配置存储(读取)**:加载配置信息
22+
23+
### 管理后台(web)
24+
- **代理配置模块**:用于配置 MCP 网关代理/工具
25+
- **对话实验台**:用于测试MCP的简易Chat,主要提供给开发者和需要集成到自研系统中的用户参考
26+
- **用户管理模块**:用户权限、信息维护
27+
28+
### 管理后台后端服务(apiserver)
29+
- **主服务模块**:提供配置管理、用户接口、聊天记录查询等 API
30+
- **配置存储(写入)**:将修改写入数据库
31+
- **通知器(发送端)**:当配置变化时通知 MCP 网关进行热更新
32+
33+
### 配置存储
34+
- 存储所有 MCP 服务、工具、路由等配置
35+
- 支持多种实现:磁盘(yaml)、SQLite、PostgreSQL、MySQL 等
36+
37+
### Web 数据存储
38+
- 存储用户数据、会话记录等
39+
- 支持多种实现:SQLite、PostgreSQL、MySQL 等
40+
41+
### 外部服务
42+
- 工具调用所依赖的后端服务系统
43+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MCP Gateway Architekturübersicht
2+
3+
Bietet einen Überblick über die MCP Gateway-Systemarchitektur, einschließlich des Gateways selbst, des Management-Backends, unterstützender APIs, Speichermechanismen und Integrationsmethoden mit externen Diensten.
4+
5+
---
6+
7+
## Architekturdiagramm
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## Modulbeschreibung
14+
15+
### MCP Gateway (mcp-gateway)
16+
- **Einstiegspunkt**: `/*` Einheitlicher HTTP-Anfragen-Listener, dynamisches Routing basierend auf der Konfiguration auf Anwendungsebene
17+
- **Routing-Schicht**: Routing basierend auf Präfixen und Suffixen `/sse`, `/message`, `/mcp`
18+
- **Protokoll-Analyse**: Analysiert JSON-RPC-Format, extrahiert Methoden und Parameter
19+
- **Tool-Verteilung**: Analysiert Tool-Namen, konstruiert Aufrufparameter
20+
- **Externe Dienstaufrufe**: Initiiert Aufrufe an externe Dienste und analysiert Ergebnisse
21+
- **Konfigurationsspeicher (Lesen)**: Lädt Konfigurationsinformationen
22+
23+
### Management-Backend (web)
24+
- **Proxy-Konfigurationsmodul**: Wird zur Konfiguration von MCP Gateway-Proxies/Tools verwendet
25+
- **Chat-Labor**: Einfacher Chat zum Testen von MCP, hauptsächlich für Entwickler und Benutzer, die es in selbst entwickelte Systeme integrieren müssen
26+
- **Benutzerverwaltungsmodul**: Wartung von Benutzerberechtigungen und -informationen
27+
28+
### Management-Backend-Service (apiserver)
29+
- **Hauptdienstmodul**: Stellt APIs für Konfigurationsverwaltung, Benutzeroberfläche, Chat-Verlauf-Abfrage usw. bereit
30+
- **Konfigurationsspeicher (Schreiben)**: Schreibt Änderungen in die Datenbank
31+
- **Benachrichtiger (Sender)**: Benachrichtigt MCP Gateway über Hot-Updates bei Konfigurationsänderungen
32+
33+
### Konfigurationsspeicher
34+
- Speichert alle MCP-Dienste, Tools, Routen und andere Konfigurationen
35+
- Unterstützt mehrere Implementierungen: Festplatte (yaml), SQLite, PostgreSQL, MySQL usw.
36+
37+
### Web-Datenspeicher
38+
- Speichert Benutzerdaten, Sitzungsaufzeichnungen usw.
39+
- Unterstützt mehrere Implementierungen: SQLite, PostgreSQL, MySQL usw.
40+
41+
### Externe Dienste
42+
- Backend-Dienstsysteme, die für Tool-Aufrufe erforderlich sind
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MCP Gateway Architecture Overview
2+
3+
Provides an overview of the MCP Gateway system architecture, including the gateway itself, management backend, supporting APIs, storage mechanisms, and integration methods with external services.
4+
5+
---
6+
7+
## Architecture Diagram
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## Module Description
14+
15+
### MCP Gateway (mcp-gateway)
16+
- **Entry Point**: `/*` Unified HTTP request listener, dynamically routes based on configuration at the application layer
17+
- **Routing Layer**: Routes based on prefixes and suffixes `/sse`, `/message`, `/mcp`
18+
- **Protocol Parsing**: Parses JSON-RPC format, extracts methods and parameters
19+
- **Tool Distribution**: Parses tool names, constructs call parameters
20+
- **External Service Calls**: Initiates calls to external services and parses results
21+
- **Configuration Storage (Read)**: Loads configuration information
22+
23+
### Management Backend (web)
24+
- **Proxy Configuration Module**: Used for configuring MCP gateway proxies/tools
25+
- **Chat Lab**: Simple Chat for testing MCP, mainly for developers and users who need to integrate into self-developed systems
26+
- **User Management Module**: User permissions and information maintenance
27+
28+
### Management Backend Service (apiserver)
29+
- **Main Service Module**: Provides APIs for configuration management, user interface, chat history query, etc.
30+
- **Configuration Storage (Write)**: Writes modifications to the database
31+
- **Notifier (Sender)**: Notifies MCP gateway for hot updates when configuration changes
32+
33+
### Configuration Storage
34+
- Stores all MCP services, tools, routes, and other configurations
35+
- Supports multiple implementations: disk (yaml), SQLite, PostgreSQL, MySQL, etc.
36+
37+
### Web Data Storage
38+
- Stores user data, session records, etc.
39+
- Supports multiple implementations: SQLite, PostgreSQL, MySQL, etc.
40+
41+
### External Services
42+
- Backend service systems required for tool calls
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Descripción General de la Arquitectura de MCP Gateway
2+
3+
Proporciona una visión general de la arquitectura del sistema MCP Gateway, incluyendo el gateway en sí, el backend de gestión, las APIs de soporte, los mecanismos de almacenamiento y los métodos de integración con servicios externos.
4+
5+
---
6+
7+
## Diagrama de Arquitectura
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## Descripción de Módulos
14+
15+
### MCP Gateway (mcp-gateway)
16+
- **Punto de Entrada**: `/*` Escucha unificada de todas las solicitudes HTTP, enrutamiento dinámico basado en la configuración a nivel de aplicación
17+
- **Capa de Enrutamiento**: Enrutamiento basado en prefijos y sufijos `/sse`, `/message`, `/mcp`
18+
- **Análisis de Protocolo**: Analiza el formato JSON-RPC, extrae métodos y parámetros
19+
- **Distribución de Herramientas**: Analiza nombres de herramientas, construye parámetros de llamada
20+
- **Llamadas a Servicios Externos**: Inicia llamadas a servicios externos y analiza resultados
21+
- **Almacenamiento de Configuración (Lectura)**: Carga información de configuración
22+
23+
### Backend de Gestión (web)
24+
- **Módulo de Configuración de Proxy**: Utilizado para configurar proxies/herramientas de MCP gateway
25+
- **Laboratorio de Chat**: Chat simple para probar MCP, principalmente para desarrolladores y usuarios que necesitan integrarlo en sistemas autodesarrollados
26+
- **Módulo de Gestión de Usuarios**: Mantenimiento de permisos e información de usuarios
27+
28+
### Servicio Backend de Gestión (apiserver)
29+
- **Módulo de Servicio Principal**: Proporciona APIs para gestión de configuración, interfaz de usuario, consulta de historial de chat, etc.
30+
- **Almacenamiento de Configuración (Escritura)**: Escribe modificaciones en la base de datos
31+
- **Notificador (Emisor)**: Notifica al MCP gateway para actualizaciones en caliente cuando cambia la configuración
32+
33+
### Almacenamiento de Configuración
34+
- Almacena todos los servicios MCP, herramientas, rutas y otras configuraciones
35+
- Soporta múltiples implementaciones: disco (yaml), SQLite, PostgreSQL, MySQL, etc.
36+
37+
### Almacenamiento de Datos Web
38+
- Almacena datos de usuario, registros de sesión, etc.
39+
- Soporta múltiples implementaciones: SQLite, PostgreSQL, MySQL, etc.
40+
41+
### Servicios Externos
42+
- Sistemas de servicios backend requeridos para llamadas de herramientas
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Vue d'ensemble de l'architecture de la passerelle MCP
2+
3+
Présente une vue d'ensemble de l'architecture du système MCP Gateway, y compris la passerelle elle-même, le backend de gestion, les API de support, les mécanismes de stockage et les méthodes d'intégration avec les services externes.
4+
5+
---
6+
7+
## Diagramme d'architecture
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## Description des modules
14+
15+
### Passerelle MCP (mcp-gateway)
16+
- **Point d'entrée** : `/*` Écoute unifiée de toutes les requêtes HTTP, routage dynamique basé sur la configuration au niveau de l'application
17+
- **Couche de routage** : Routage basé sur les préfixes et suffixes `/sse`, `/message`, `/mcp`
18+
- **Analyse de protocole** : Analyse du format JSON-RPC, extraction des méthodes et paramètres
19+
- **Distribution d'outils** : Analyse des noms d'outils, construction des paramètres d'appel
20+
- **Appels aux services externes** : Lancement des appels aux services externes et analyse des résultats
21+
- **Stockage de configuration (lecture)** : Chargement des informations de configuration
22+
23+
### Backend de gestion (web)
24+
- **Module de configuration des proxies** : Utilisé pour configurer les proxies/outils de la passerelle MCP
25+
- **Laboratoire de chat** : Chat simple pour tester MCP, principalement destiné aux développeurs et aux utilisateurs qui doivent l'intégrer dans des systèmes auto-développés
26+
- **Module de gestion des utilisateurs** : Maintenance des permissions et informations utilisateur
27+
28+
### Service backend de gestion (apiserver)
29+
- **Module de service principal** : Fournit des API pour la gestion de la configuration, l'interface utilisateur, la requête d'historique de chat, etc.
30+
- **Stockage de configuration (écriture)** : Écrit les modifications dans la base de données
31+
- **Notificateur (émetteur)** : Notifie la passerelle MCP pour les mises à jour à chaud lors des changements de configuration
32+
33+
### Stockage de configuration
34+
- Stocke toutes les configurations des services MCP, outils, routes, etc.
35+
- Prend en charge plusieurs implémentations : disque (yaml), SQLite, PostgreSQL, MySQL, etc.
36+
37+
### Stockage de données Web
38+
- Stocke les données utilisateur, les enregistrements de session, etc.
39+
- Prend en charge plusieurs implémentations : SQLite, PostgreSQL, MySQL, etc.
40+
41+
### Services externes
42+
- Systèmes de services backend requis pour les appels d'outils
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MCP गेटवे आर्किटेक्चर अवलोकन
2+
3+
MCP गेटवे सिस्टम आर्किटेक्चर का एक अवलोकन प्रदान करता है, जिसमें गेटवे स्वयं, प्रबंधन बैकएंड, सहायक API, स्टोरेज मैकेनिज्म और बाहरी सेवाओं के साथ एकीकरण के तरीके शामिल हैं।
4+
5+
---
6+
7+
## आर्किटेक्चर डायग्राम
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## मॉड्यूल विवरण
14+
15+
### MCP गेटवे (mcp-gateway)
16+
- **प्रवेश बिंदु**: `/*` एकीकृत HTTP अनुरोध लिस्टनर, एप्लिकेशन लेयर पर कॉन्फ़िगरेशन के आधार पर गतिशील रूटिंग
17+
- **रूटिंग लेयर**: प्रीफिक्स और सफिक्स `/sse`, `/message`, `/mcp` के आधार पर रूटिंग
18+
- **प्रोटोकॉल पार्सिंग**: JSON-RPC फॉर्मेट का विश्लेषण, मेथड और पैरामीटर निकालना
19+
- **टूल वितरण**: टूल नामों का विश्लेषण, कॉल पैरामीटर का निर्माण
20+
- **बाहरी सेवा कॉल**: बाहरी सेवाओं के लिए कॉल शुरू करना और परिणामों का विश्लेषण
21+
- **कॉन्फ़िगरेशन स्टोरेज (पढ़ना)**: कॉन्फ़िगरेशन जानकारी लोड करना
22+
23+
### प्रबंधन बैकएंड (web)
24+
- **प्रॉक्सी कॉन्फ़िगरेशन मॉड्यूल**: MCP गेटवे प्रॉक्सी/टूल्स को कॉन्फ़िगर करने के लिए उपयोग किया जाता है
25+
- **चैट लैब**: MCP का परीक्षण करने के लिए सरल चैट, मुख्य रूप से डेवलपर्स और स्व-विकसित सिस्टम में एकीकृत करने वाले उपयोगकर्ताओं के लिए
26+
- **उपयोगकर्ता प्रबंधन मॉड्यूल**: उपयोगकर्ता अनुमतियों और जानकारी का रखरखाव
27+
28+
### प्रबंधन बैकएंड सेवा (apiserver)
29+
- **मुख्य सेवा मॉड्यूल**: कॉन्फ़िगरेशन प्रबंधन, उपयोगकर्ता इंटरफेस, चैट इतिहास क्वेरी आदि के लिए API प्रदान करता है
30+
- **कॉन्फ़िगरेशन स्टोरेज (लिखना)**: डेटाबेस में परिवर्तन लिखता है
31+
- **नोटिफायर (प्रेषक)**: कॉन्फ़िगरेशन परिवर्तनों पर MCP गेटवे को हॉट अपडेट के लिए सूचित करता है
32+
33+
### कॉन्फ़िगरेशन स्टोरेज
34+
- सभी MCP सेवाओं, टूल्स, रूट्स और अन्य कॉन्फ़िगरेशन को संग्रहीत करता है
35+
- कई कार्यान्वयनों का समर्थन करता है: डिस्क (yaml), SQLite, PostgreSQL, MySQL, आदि
36+
37+
### वेब डेटा स्टोरेज
38+
- उपयोगकर्ता डेटा, सत्र रिकॉर्ड आदि संग्रहीत करता है
39+
- कई कार्यान्वयनों का समर्थन करता है: SQLite, PostgreSQL, MySQL, आदि
40+
41+
### बाहरी सेवाएं
42+
- टूल कॉल के लिए आवश्यक बैकएंड सेवा सिस्टम
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MCP ゲートウェイアーキテクチャ概要
2+
3+
MCP Gateway システムの全体的なアーキテクチャを概説します。ゲートウェイ自体、管理バックエンド、サポート API、ストレージメカニズム、および外部サービスとの統合方法を含みます。
4+
5+
---
6+
7+
## アーキテクチャ図
8+
9+
![MCP Gateway Architecture](https://www.mermaidchart.com/raw/32023f97-aaa9-4563-a4fe-2f0f4da28916?theme=light&version=v0.1&format=svg)
10+
11+
---
12+
13+
## モジュール説明
14+
15+
### MCP ゲートウェイ(mcp-gateway)
16+
- **エントリーポイント**`/*` すべての HTTP リクエストを統一的にリッスンし、アプリケーション層で設定に基づいて動的にルーティング
17+
- **ルーティング層**:プレフィックスとサフィックス `/sse``/message``/mcp` に基づいてルーティング
18+
- **プロトコル解析**:JSON-RPC 形式を解析し、メソッドとパラメータを抽出
19+
- **ツール配信**:ツール名を解析し、呼び出しパラメータを構築
20+
- **外部サービス呼び出し**:外部サービスへの呼び出しを開始し、結果を解析
21+
- **設定ストレージ(読み取り)**:設定情報を読み込み
22+
23+
### 管理バックエンド(web)
24+
- **プロキシ設定モジュール**:MCP ゲートウェイプロキシ/ツールの設定に使用
25+
- **チャットラボ**:MCP のテスト用のシンプルなチャット、主に開発者と自社開発システムへの統合が必要なユーザー向け
26+
- **ユーザー管理モジュール**:ユーザー権限と情報の管理
27+
28+
### 管理バックエンドサービス(apiserver)
29+
- **メインサービスモジュール**:設定管理、ユーザーインターフェース、チャット履歴クエリなどの API を提供
30+
- **設定ストレージ(書き込み)**:変更をデータベースに書き込み
31+
- **通知機能(送信側)**:設定変更時に MCP ゲートウェイにホットアップデートを通知
32+
33+
### 設定ストレージ
34+
- すべての MCP サービス、ツール、ルートなどの設定を保存
35+
- 複数の実装をサポート:ディスク(yaml)、SQLite、PostgreSQL、MySQL など
36+
37+
### Web データストレージ
38+
- ユーザーデータ、セッション記録などを保存
39+
- 複数の実装をサポート:SQLite、PostgreSQL、MySQL など
40+
41+
### 外部サービス
42+
- ツール呼び出しに必要なバックエンドサービスシステム

0 commit comments

Comments
 (0)