@loop_ouroboros/mcp-hub-lite 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +410 -331
  3. package/dist/client/assets/{HomeView-Bi2bkUKf.js → HomeView-DplI3V-h.js} +1 -1
  4. package/dist/client/assets/{ResourceDetailView-DyuSovH9.js → ResourceDetailView-CeHPn99Y.js} +1 -1
  5. package/dist/client/assets/ResourcesView-C1ObRhYS.js +1 -0
  6. package/dist/client/assets/{ServerDashboard-BGyyZAti.js → ServerDashboard-D7wG4Gvt.js} +1 -1
  7. package/dist/client/assets/ServerDetail-G23phOcJ.js +2 -0
  8. package/dist/client/assets/{ServerListView-yQPVJFHG.js → ServerListView-BFiZLtPO.js} +1 -1
  9. package/dist/client/assets/{ServerStatusTags.vue_vue_type_script_setup_true_lang-C8gQlxGE.js → ServerStatusTags.vue_vue_type_script_setup_true_lang-Deb_SbFw.js} +1 -1
  10. package/dist/client/assets/SettingsView-QBFLZ6fP.js +1 -0
  11. package/dist/client/assets/ToolCallDialog-DYS-ADCL.js +1 -0
  12. package/dist/client/assets/ToolsView-DYwgtm7W.js +1 -0
  13. package/dist/client/assets/_baseClone-DQno9YO3.js +1 -0
  14. package/dist/client/assets/{el-form-item-DfWq_kSy.js → el-form-item-DF0zzQdH.js} +2 -2
  15. package/dist/client/assets/el-input-C_p2Qw42.js +1 -0
  16. package/dist/client/assets/el-loading-BaenpNzU.js +1 -0
  17. package/dist/client/assets/el-overlay-MbIUXSQ7.js +1 -0
  18. package/dist/client/assets/el-radio-group-COnCjCcz.js +1 -0
  19. package/dist/client/assets/el-skeleton-item-qj0eQP4s.js +1 -0
  20. package/dist/client/assets/el-switch-BZbXqB3_.js +1 -0
  21. package/dist/client/assets/el-tab-pane-w7RltRLd.js +1 -0
  22. package/dist/client/assets/el-table-column-OD8zhFcD.js +1 -0
  23. package/dist/client/assets/index-DwhULJXZ.js +2 -0
  24. package/dist/client/assets/{index-Bzz3tYbS.css → index-UtsV0Cvh.css} +1 -1
  25. package/dist/client/assets/{omit-BIIebEYo.js → omit-BAJQlviJ.js} +1 -1
  26. package/dist/client/assets/raf-B1Ry7ruA.js +1 -0
  27. package/dist/client/assets/{vue-vendor-Dwcr0jep.js → vue-vendor-ClSvefnQ.js} +1 -1
  28. package/dist/client/index.html +3 -3
  29. package/dist/server/shared/models/constants.d.ts +5 -0
  30. package/dist/server/shared/models/constants.d.ts.map +1 -1
  31. package/dist/server/shared/models/constants.js +4 -0
  32. package/dist/server/shared/models/server.model.d.ts +14 -0
  33. package/dist/server/shared/models/server.model.d.ts.map +1 -1
  34. package/dist/server/shared/models/server.model.js +27 -4
  35. package/dist/server/src/api/mcp/gateway.d.ts +10 -6
  36. package/dist/server/src/api/mcp/gateway.d.ts.map +1 -1
  37. package/dist/server/src/api/mcp/gateway.js +235 -69
  38. package/dist/server/src/api/web/hub-tools.d.ts.map +1 -1
  39. package/dist/server/src/api/web/hub-tools.js +2 -2
  40. package/dist/server/src/api/web/search.d.ts +1 -1
  41. package/dist/server/src/api/web/search.d.ts.map +1 -1
  42. package/dist/server/src/api/web/search.js +18 -16
  43. package/dist/server/src/api/web/sessions.d.ts +1 -27
  44. package/dist/server/src/api/web/sessions.d.ts.map +1 -1
  45. package/dist/server/src/api/web/sessions.js +8 -97
  46. package/dist/server/src/app.d.ts.map +1 -1
  47. package/dist/server/src/app.js +5 -0
  48. package/dist/server/src/cli/commands/status.js +39 -1
  49. package/dist/server/src/cli/commands/use-guide.d.ts +0 -8
  50. package/dist/server/src/cli/commands/use-guide.d.ts.map +1 -1
  51. package/dist/server/src/cli/commands/use-guide.js +28 -170
  52. package/dist/server/src/cli/server.d.ts +10 -0
  53. package/dist/server/src/cli/server.d.ts.map +1 -1
  54. package/dist/server/src/cli/server.js +31 -1
  55. package/dist/server/src/models/system-tools.constants.d.ts +1 -0
  56. package/dist/server/src/models/system-tools.constants.d.ts.map +1 -1
  57. package/dist/server/src/server/dev-server.js +2 -0
  58. package/dist/server/src/server/runner.d.ts.map +1 -1
  59. package/dist/server/src/server/runner.js +2 -0
  60. package/dist/server/src/services/connection/connection-manager.d.ts +2 -0
  61. package/dist/server/src/services/connection/connection-manager.d.ts.map +1 -1
  62. package/dist/server/src/services/connection/connection-manager.js +14 -7
  63. package/dist/server/src/services/gateway/gateway.service.d.ts +13 -0
  64. package/dist/server/src/services/gateway/gateway.service.d.ts.map +1 -1
  65. package/dist/server/src/services/gateway/gateway.service.js +72 -0
  66. package/dist/server/src/services/gateway/global-transport.d.ts +20 -10
  67. package/dist/server/src/services/gateway/global-transport.d.ts.map +1 -1
  68. package/dist/server/src/services/gateway/global-transport.js +50 -34
  69. package/dist/server/src/services/gateway/request-handlers/initialize-handler.d.ts.map +1 -1
  70. package/dist/server/src/services/gateway/request-handlers/initialize-handler.js +22 -6
  71. package/dist/server/src/services/gateway/request-handlers/resources-handler.d.ts.map +1 -1
  72. package/dist/server/src/services/gateway/request-handlers/resources-handler.js +5 -1
  73. package/dist/server/src/services/gateway/request-handlers/system-tools-handler.d.ts.map +1 -1
  74. package/dist/server/src/services/gateway/request-handlers/system-tools-handler.js +3 -2
  75. package/dist/server/src/services/gateway/session-manager.d.ts +101 -0
  76. package/dist/server/src/services/gateway/session-manager.d.ts.map +1 -0
  77. package/dist/server/src/services/gateway/session-manager.js +256 -0
  78. package/dist/server/src/services/hub-tools/resource-generator.d.ts +1 -1
  79. package/dist/server/src/services/hub-tools/resource-generator.d.ts.map +1 -1
  80. package/dist/server/src/services/hub-tools/resource-generator.js +11 -9
  81. package/dist/server/src/services/hub-tools/system-tool-definitions.d.ts.map +1 -1
  82. package/dist/server/src/services/hub-tools/system-tool-definitions.js +7 -0
  83. package/dist/server/src/services/hub-tools.service.d.ts +1 -1
  84. package/dist/server/src/services/hub-tools.service.d.ts.map +1 -1
  85. package/dist/server/src/services/hub-tools.service.js +23 -15
  86. package/dist/server/src/services/system-tool-handler.js +1 -1
  87. package/dist/server/src/utils/json-utils.d.ts +9 -0
  88. package/dist/server/src/utils/json-utils.d.ts.map +1 -1
  89. package/dist/server/src/utils/json-utils.js +19 -0
  90. package/dist/server/src/utils/logger/index.d.ts +1 -1
  91. package/dist/server/src/utils/logger/index.d.ts.map +1 -1
  92. package/dist/server/src/utils/logger/index.js +1 -1
  93. package/dist/server/src/utils/logger/log-context.d.ts +1 -0
  94. package/dist/server/src/utils/logger/log-context.d.ts.map +1 -1
  95. package/dist/server/src/utils/logger/log-formatter.d.ts.map +1 -1
  96. package/dist/server/src/utils/logger/log-formatter.js +25 -11
  97. package/dist/server/src/utils/logger/log-output.d.ts +17 -1
  98. package/dist/server/src/utils/logger/log-output.d.ts.map +1 -1
  99. package/dist/server/src/utils/logger/log-output.js +46 -40
  100. package/dist/server/src/utils/logger/logger.d.ts.map +1 -1
  101. package/dist/server/src/utils/logger/logger.js +18 -2
  102. package/dist/server/src/utils/request-context.d.ts +8 -70
  103. package/dist/server/src/utils/request-context.d.ts.map +1 -1
  104. package/dist/server/src/utils/request-context.js +11 -70
  105. package/dist/server/src/utils/search-matcher.d.ts +6 -0
  106. package/dist/server/src/utils/search-matcher.d.ts.map +1 -0
  107. package/dist/server/src/utils/search-matcher.js +24 -0
  108. package/dist/server/tests/unit/config/config.schema.test.js +2 -1
  109. package/dist/server/tests/unit/server/runner.test.js +14 -7
  110. package/dist/server/tests/unit/services/gateway-session-mode.test.d.ts +2 -0
  111. package/dist/server/tests/unit/services/gateway-session-mode.test.d.ts.map +1 -0
  112. package/dist/server/tests/unit/services/gateway-session-mode.test.js +174 -0
  113. package/dist/server/tests/unit/services/hub-tools.service.test.js +299 -4
  114. package/dist/server/tests/unit/utils/config.test.js +14 -7
  115. package/dist/server/tests/unit/utils/log-output.test.d.ts +2 -0
  116. package/dist/server/tests/unit/utils/log-output.test.d.ts.map +1 -0
  117. package/dist/server/tests/unit/utils/log-output.test.js +198 -0
  118. package/dist/server/vitest.config.d.ts.map +1 -1
  119. package/dist/server/vitest.config.js +0 -2
  120. package/package.json +1 -1
  121. package/dist/client/assets/ResourcesView-CU0VbNy5.js +0 -1
  122. package/dist/client/assets/ServerDetail-bcQ8BVXR.js +0 -2
  123. package/dist/client/assets/SettingsView-B1DxbFP3.js +0 -1
  124. package/dist/client/assets/ToolCallDialog-DEapCO06.js +0 -1
  125. package/dist/client/assets/ToolsView-DA0u_bCw.js +0 -1
  126. package/dist/client/assets/_baseClone-B991Lvrt.js +0 -1
  127. package/dist/client/assets/el-input-5YzZrwir.js +0 -1
  128. package/dist/client/assets/el-loading-DE3FcxNH.js +0 -1
  129. package/dist/client/assets/el-overlay-BTeTueuN.js +0 -1
  130. package/dist/client/assets/el-radio-group-Y1E2bxIW.js +0 -1
  131. package/dist/client/assets/el-skeleton-item-DhgR50Jx.js +0 -1
  132. package/dist/client/assets/el-switch-fF--nMSD.js +0 -1
  133. package/dist/client/assets/el-tab-pane-rvS_KTwP.js +0 -1
  134. package/dist/client/assets/el-table-column-B1O8mY47.js +0 -1
  135. package/dist/client/assets/index-DkqV9kH4.js +0 -2
  136. package/dist/client/assets/raf-Cj-gATZv.js +0 -1
package/README.md CHANGED
@@ -1,331 +1,410 @@
1
- # MCP-HUB-LITE
2
-
3
- [![License](https://img.shields.io/badge/license-MIT-080f12?style=flat&colorA=080f12&colorB=1fa669)](./LICENSE)
4
- [![Node.js](https://img.shields.io/badge/Node.js-22.x-080f12?style=flat&logo=nodedotjs&logoColor=white&colorA=080f12&colorB=339933)](https://nodejs.org/)
5
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-080f12?style=flat&logo=typescript&logoColor=white&colorA=080f12&colorB=3178C6)](https://www.typescriptlang.org/)
6
- [![Vitest](https://img.shields.io/badge/Vitest-Testing-080f12?style=flat&logo=vitest&logoColor=white&colorA=080f12&colorB=6E9F18)](https://vitest.dev/)
7
- [![Fastify](https://img.shields.io/badge/Fastify-Web-080f12?style=flat&logo=fastify&logoColor=white&colorA=080f12&colorB=000000)](https://fastify.io/)
8
- [![Vue.js](https://img.shields.io/badge/Vue.js-3-080f12?style=flat&logo=vuedotjs&logoColor=white&colorA=080f12&colorB=4FC08D)](https://vuejs.org/)
9
- [![Claude Code](https://img.shields.io/badge/Claude-Code-1fa669?style=flat&colorA=080f12&colorB=1fa669)](https://claude.ai/code)
10
-
11
- ---
12
-
13
- [中文文档](./README_zh.md)
14
-
15
- A lightweight MCP management platform designed for independent developers, providing MCP server gateway, grouping, fuzzy search, and MCP HttpStream protocol interface.
16
-
17
- ## Overview
18
-
19
- MCP-HUB-LITE is an MCP server gateway designed specifically for independent developers. It acts as a proxy between your frontend and multiple backend MCP servers, providing a unified access interface with support for the MCP JSON-RPC 2.0 protocol.
20
-
21
- ### Core Features
22
-
23
- - **MCP Gateway Service**: Unified proxy interface for multiple backend MCP servers
24
- - **MCP CLI Tool**: Command-line tool for listing and calling MCP tools across servers
25
- - **Server Management**: Manage multiple MCP servers through a web interface
26
- - **Tool Search**: Search and tool discovery across all servers with aggregation
27
- - **Process Management**: Launch and manage MCP server processes via npx/uvx
28
- - **Session Management**: Native stateless session management via MCP SDK
29
- - **Multi-Instance Support**: Run multiple instances of the same MCP server with load balancing
30
- - **Instance Selection Strategies**: Support random, round-robin, and unique-by-tag selection
31
- - **Tag System**: Organize multiple MCP servers by environment, category, function, etc.
32
- - **Fault Tolerance**: System continues to operate when individual servers fail
33
- - **Bilingual Interface**: Support for Chinese/English interface switching
34
- - **Configuration Management**: Support for hot-reloading and maintenance of `.mcp-hub.json`
35
- - **MCP Native Resources**: Forward resource calls to backend MCP servers
36
- - **Security**: Mask sensitive values in config change logs
37
-
38
- ## Quick Start
39
-
40
- ### System Requirements
41
-
42
- - Node.js 22.x or higher
43
- - npm or yarn
44
- - Windows, macOS, or Linux
45
-
46
- ### Installation
47
-
48
- #### Install from npm
49
-
50
- ```bash
51
- # Install from npm
52
- npm install -g @loop_ouroboros/mcp-hub-lite
53
-
54
- # Start the service
55
- mcp-hub-lite start
56
-
57
- # Open UI
58
- mcp-hub-lite ui
59
- ```
60
-
61
- #### Build from source
62
-
63
- ```bash
64
- # Install dependencies
65
- npm install
66
-
67
- # Run in development mode (frontend and backend hot reload)
68
- npm run dev
69
-
70
- # Build production version
71
- npm run build
72
-
73
- # Full check (build + tests + code check)
74
- npm run full:check
75
-
76
- # Run production version
77
- npm start
78
-
79
- # Check status
80
- npm run status
81
-
82
- # Open UI interface
83
- npm run ui
84
- ```
85
-
86
- The server will start at <http://localhost:7788>.
87
-
88
- ## Server Management
89
-
90
- ![Servers](./docs/screenshot/en/servers.png)
91
-
92
- Manage all your MCP servers in one place. Add, edit, delete, connect, and disconnect servers through the intuitive web interface.
93
-
94
- ## Gateway & Tools
95
-
96
- ![Gateway Tools](./docs/screenshot/en/gateway-tools.png)
97
-
98
- ![Aggregated Tools](./docs/screenshot/en/aggregated-tool.png)
99
-
100
- Discover and call tools from all connected MCP servers through the unified gateway interface. The aggregated tools view provides a single place to search and use all available tools.
101
-
102
- ## Resources
103
-
104
- ![Resources](./docs/screenshot/en/resources.png)
105
-
106
- Browse and manage MCP resources from all connected servers.
107
-
108
- ### Testing
109
-
110
- ```bash
111
- # Run all tests
112
- npm test
113
-
114
- # Backend tests
115
- npm run test:backend
116
-
117
- # Frontend tests
118
- npm run test:frontend
119
- ```
120
-
121
- ## CLI Commands
122
-
123
- MCP-HUB-LITE provides a command-line interface for managing the service.
124
-
125
- ```bash
126
- # Start the service
127
- npm start
128
- # or
129
- node dist/index.js start
130
-
131
- # Check status
132
- node dist/index.js status
133
-
134
- # List all servers
135
- node dist/index.js list
136
-
137
- # Open web interface
138
- node dist/index.js ui
139
-
140
- # Help
141
- node dist/index.js --help
142
- ```
143
-
144
- ### Tool Use Command
145
-
146
- The `tool-use` command provides MCP server tool operations:
147
-
148
- ```bash
149
- # List system tools (default server: mcp-hub-lite)
150
- npm run tool-use -- list-tools
151
- mcp-hub-lite tool-use list-tools
152
-
153
- # List tools from a specific server
154
- npm run tool-use -- list-tools --server baidu-search
155
- mcp-hub-lite tool-use list-tools --server baidu-search
156
-
157
- # Get tool schema
158
- npm run tool-use -- get-tool --tool list_tools
159
- mcp-hub-lite tool-use get-tool --tool list_tools
160
-
161
- # Call a system tool
162
- npm run tool-use -- call-tool --tool list_tools --args '{}'
163
- mcp-hub-lite tool-use call-tool --tool list_tools --args '{}'
164
-
165
- # Call a server tool
166
- npm run tool-use -- call-tool --server baidu-search --tool search --args '{"query":"hello"}'
167
- mcp-hub-lite tool-use call-tool --server baidu-search --tool search --args '{"query":"hello"}'
168
- ```
169
-
170
- ## Configuration
171
-
172
- MCP-HUB-LITE uses a `.mcp-hub.json` file for configuration. Configuration lookup priority:
173
-
174
- 1. Environment variable `MCP_HUB_CONFIG_PATH`
175
- 2. `~/.mcp-hub-lite/config/.mcp-hub.json` (hidden folder in user home directory)
176
-
177
- ### Configuration Example
178
-
179
- ```json
180
- {
181
- "version": "1.1.0",
182
- "servers": [
183
- {
184
- "id": "server-1",
185
- "name": "My MCP Server",
186
- "description": "Example server",
187
- "transport": "streamable-http",
188
- "endpoint": "http://localhost:8080",
189
- "tags": {
190
- "env": "development",
191
- "category": "api-server",
192
- "function": "http-api",
193
- "priority": "medium"
194
- },
195
- "allowedTools": [],
196
- "instances": [
197
- {
198
- "index": 0,
199
- "displayName": "Instance 1",
200
- "enabled": true,
201
- "env": {}
202
- }
203
- ],
204
- "managedProcess": {
205
- "command": "npx my-mcp-server",
206
- "managedMode": "npx",
207
- "processType": "streamable-http"
208
- }
209
- }
210
- ],
211
- "settings": {
212
- "language": {
213
- "current": "en-US",
214
- "autoDetect": true,
215
- "fallback": "en-US"
216
- },
217
- "logging": {
218
- "level": "info"
219
- }
220
- },
221
- "gateway": {
222
- "proxyTimeout": 30000,
223
- "rateLimit": {
224
- "enabled": true,
225
- "maxRequests": 100,
226
- "windowMs": 60000
227
- }
228
- }
229
- }
230
- ```
231
-
232
- ## Usage Guide
233
-
234
- ### Adding MCP Servers
235
-
236
- Through the web interface:
237
-
238
- 1. Open <http://localhost:7788>
239
- 2. Navigate to the "Servers" page
240
- 3. Click "Add Server"
241
- 4. Fill in server details and save
242
-
243
- ## Process Management
244
-
245
- MCP-HUB-LITE supports launching and managing MCP servers using your local environment:
246
-
247
- ### Supported Launch Methods
248
-
249
- - **Node.js (npx)**: `npx package-name`
250
- - **Python (uvx)**: `uvx package-name`
251
- - **Direct Command**: Custom startup command
252
-
253
- ### Process Management Features
254
-
255
- - Start/stop/restart MCP servers
256
- - Monitor CPU and memory usage
257
- - Crash detection and automatic restart
258
- - PID tracking and health checks
259
-
260
- ## Development Guide
261
-
262
- ### Project Structure
263
-
264
- ```
265
- src/
266
- ├── api/ # API implementations
267
- │ ├── mcp-protocol/ # MCP protocol handlers
268
- │ └── web-api/ # Web API routes
269
- ├── models/ # Data models
270
- ├── services/ # Core business logic
271
- │ ├── gateway/ # MCP gateway service
272
- │ ├── connection/ # Connection management
273
- │ └── hub-tools/ # Hub tools service
274
- ├── utils/ # Utility functions
275
- │ ├── logger/ # Logging utilities
276
- │ └── transports/ # MCP transport implementations
277
- ├── config/ # Configuration
278
- ├── cli/ # CLI commands
279
- │ └── commands/ # CLI command implementations
280
- ├── pid/ # Process ID management
281
- └── server/ # Server runtime
282
-
283
- frontend/
284
- ├── src/
285
- │ ├── components/ # Reusable UI components
286
- │ ├── views/ # Page view components
287
- │ ├── stores/ # Pinia state management
288
- │ ├── composables/ # Vue composables
289
- │ ├── router/ # Vue Router configuration
290
- │ ├── i18n/ # Internationalization
291
- │ └── types/ # Frontend type definitions
292
-
293
- shared/
294
- ├── models/ # Shared models
295
- └── types/ # Shared types
296
-
297
- tests/
298
- ├── unit/ # Unit tests
299
- ├── integration/ # Integration tests
300
- ├── contract/ # Contract tests
301
- ├── helpers/ # Test helpers
302
- └── types/ # Test types
303
- ```
304
-
305
- ### Adding New Features
306
-
307
- 1. Create models (models/)
308
- 2. Implement services (services/)
309
- 3. Add API routes (api/)
310
- 4. Write tests (tests/)
311
- 5. Update configuration files
312
-
313
- ## Detailed Technical Documentation
314
-
315
- Complete project architecture, constraints, and design decisions can be found in:
316
-
317
- - [CLAUDE.md](./CLAUDE.md) - Project AI context and module documentation
318
-
319
- ## License
320
-
321
- MIT
322
-
323
- ## Contributing
324
-
325
- Pull Requests and Issues are welcome!
326
-
327
- ## Community
328
-
329
- Thanks to the LinuxDo (linux.do) community for the discussions, sharing, and feedback.
330
-
331
- <!-- Badges -->
1
+ # MCP-HUB-LITE
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-080f12?style=flat&colorA=080f12&colorB=1fa669)](./LICENSE)
4
+ [![Node.js](https://img.shields.io/badge/Node.js-22.x-080f12?style=flat&logo=nodedotjs&logoColor=white&colorA=080f12&colorB=339933)](https://nodejs.org/)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-080f12?style=flat&logo=typescript&logoColor=white&colorA=080f12&colorB=3178C6)](https://www.typescriptlang.org/)
6
+ [![Vitest](https://img.shields.io/badge/Vitest-Testing-080f12?style=flat&logo=vitest&logoColor=white&colorA=080f12&colorB=6E9F18)](https://vitest.dev/)
7
+ [![Fastify](https://img.shields.io/badge/Fastify-Web-080f12?style=flat&logo=fastify&logoColor=white&colorA=080f12&colorB=000000)](https://fastify.io/)
8
+ [![Vue.js](https://img.shields.io/badge/Vue.js-3-080f12?style=flat&logo=vuedotjs&logoColor=white&colorA=080f12&colorB=4FC08D)](https://vuejs.org/)
9
+ [![Claude Code](https://img.shields.io/badge/Claude-Code-1fa669?style=flat&colorA=080f12&colorB=1fa669)](https://claude.ai/code)
10
+
11
+ ---
12
+
13
+ [中文文档](./README_zh.md)
14
+
15
+ A lightweight MCP management platform designed for independent developers, providing MCP server gateway, grouping, fuzzy search, and MCP HttpStream protocol interface.
16
+
17
+ ## Overview
18
+
19
+ MCP-HUB-LITE is an MCP server gateway designed specifically for independent developers. It acts as a proxy between your frontend and multiple backend MCP servers, providing a unified access interface with support for the MCP JSON-RPC 2.0 protocol.
20
+
21
+ ### Core Features
22
+
23
+ - **MCP Gateway Service**: Unified proxy interface for multiple backend MCP servers
24
+ - **MCP CLI Tool**: Command-line tool for listing and calling MCP tools across servers
25
+ - **Server Management**: Manage multiple MCP servers through a web interface
26
+ - **Tool Search**: Search and tool discovery across all servers with aggregation
27
+ - **Process Management**: Launch and manage MCP server processes via npx/uvx
28
+ - **Dual-Mode Session**: Stateful (session persistence, SSE, notifications) and stateless (per-request) modes, with UA / header / config priority switching
29
+ - **MCP Notification Push**: Push `notifications/tools/list_changed` and `notifications/resources/list_changed` to connected clients
30
+ - **Multi-Instance Support**: Run multiple instances of the same MCP server with load balancing
31
+ - **Instance Selection Strategies**: Support random, round-robin, and unique-by-tag selection
32
+ - **Tag System**: Organize multiple MCP servers by environment, category, function, etc.
33
+ - **Fault Tolerance**: System continues to operate when individual servers fail
34
+ - **Bilingual Interface**: Support for Chinese/English interface switching
35
+ - **Configuration Management**: Support for hot-reloading and maintenance of `.mcp-hub.json`
36
+ - **MCP Native Resources**: Forward resource calls to backend MCP servers
37
+ - **Security**: Mask sensitive values in config change logs
38
+
39
+ ## Quick Start
40
+
41
+ ### System Requirements
42
+
43
+ - Node.js 22.x or higher
44
+ - npm or yarn
45
+ - Windows, macOS, or Linux
46
+
47
+ ### Installation
48
+
49
+ #### Install from npm
50
+
51
+ ```bash
52
+ # Install from npm
53
+ npm install -g @loop_ouroboros/mcp-hub-lite
54
+
55
+ # Start the service
56
+ mcp-hub-lite start
57
+
58
+ # Open UI
59
+ mcp-hub-lite ui
60
+ ```
61
+
62
+ #### Build from source
63
+
64
+ ```bash
65
+ # Install dependencies
66
+ npm install
67
+
68
+ # Run in development mode (frontend and backend hot reload)
69
+ npm run dev
70
+
71
+ # Build production version
72
+ npm run build
73
+
74
+ # Full check (build + tests + code check)
75
+ npm run full:check
76
+
77
+ # Run production version
78
+ npm start
79
+
80
+ # Check status
81
+ mcp-hub-lite status
82
+
83
+ # Open UI interface
84
+ mcp-hub-lite ui
85
+ ```
86
+
87
+ The server will start at <http://localhost:7788>.
88
+
89
+ ## Server Management
90
+
91
+ ![Servers](./docs/screenshot/en/servers.png)
92
+
93
+ Manage all your MCP servers in one place. Add, edit, delete, connect, and disconnect servers through the intuitive web interface.
94
+
95
+ ## Gateway & Tools
96
+
97
+ ![Gateway Tools](./docs/screenshot/en/gateway-tools.png)
98
+
99
+ ![Aggregated Tools](./docs/screenshot/en/aggregated-tool.png)
100
+
101
+ Discover and call tools from all connected MCP servers through the unified gateway interface. The aggregated tools view provides a single place to search and use all available tools.
102
+
103
+ ## Resources
104
+
105
+ ![Resources](./docs/screenshot/en/resources.png)
106
+
107
+ Browse and manage MCP resources from all connected servers.
108
+
109
+ ### Testing
110
+
111
+ ```bash
112
+ # Run all tests
113
+ npm test
114
+
115
+ # Backend tests
116
+ npm run test:backend
117
+
118
+ # Frontend tests
119
+ npm run test:frontend
120
+ ```
121
+
122
+ ## CLI Commands
123
+
124
+ MCP-HUB-LITE provides a command-line interface for managing the service.
125
+
126
+ ```bash
127
+ # Start the service
128
+ npm start
129
+ # or
130
+ mcp-hub-lite start
131
+
132
+ # Check status
133
+ mcp-hub-lite status
134
+
135
+ # List all servers
136
+ mcp-hub-lite list
137
+
138
+ # Open web interface
139
+ mcp-hub-lite ui
140
+
141
+ # Help
142
+ mcp-hub-lite --help
143
+ ```
144
+
145
+ ### Tool Use Command
146
+
147
+ The `tool-use` command provides MCP server tool operations:
148
+
149
+ ```bash
150
+ # List system tools (default server: mcp-hub-lite)
151
+ mcp-hub-lite tool-use list-tools
152
+
153
+ # List tools from a specific server
154
+ mcp-hub-lite tool-use list-tools --server baidu-search
155
+
156
+ # Get tool schema
157
+ mcp-hub-lite tool-use get-tool --tool list_tools
158
+
159
+ # Call a system tool
160
+ mcp-hub-lite tool-use call-tool --tool list_tools --args '{}'
161
+
162
+ # Call a server tool
163
+ mcp-hub-lite tool-use call-tool --server baidu-search --tool search --args '{"query":"hello"}'
164
+ ```
165
+
166
+ ## Configuration
167
+
168
+ MCP-HUB-LITE uses a `.mcp-hub.json` file for configuration. Configuration lookup priority:
169
+
170
+ 1. Environment variable `MCP_HUB_CONFIG_PATH`
171
+ 2. `~/.mcp-hub-lite/config/.mcp-hub.json` (hidden folder in user home directory)
172
+
173
+ ### Configuration Example
174
+
175
+ <details>
176
+ <summary>Click to expand full <code>.mcp-hub.json</code> example</summary>
177
+
178
+ ```json
179
+ {
180
+ "version": "1.1.0",
181
+ "servers": [
182
+ {
183
+ "id": "server-1",
184
+ "name": "My MCP Server",
185
+ "description": "Example server",
186
+ "transport": "streamable-http",
187
+ "endpoint": "http://localhost:8080",
188
+ "tags": {
189
+ "env": "development",
190
+ "category": "api-server",
191
+ "function": "http-api",
192
+ "priority": "medium"
193
+ },
194
+ "allowedTools": [],
195
+ "instances": [
196
+ {
197
+ "index": 0,
198
+ "displayName": "Instance 1",
199
+ "enabled": true,
200
+ "env": {}
201
+ }
202
+ ],
203
+ "managedProcess": {
204
+ "command": "npx my-mcp-server",
205
+ "managedMode": "npx",
206
+ "processType": "streamable-http"
207
+ }
208
+ }
209
+ ],
210
+ "settings": {
211
+ "language": {
212
+ "current": "en-US",
213
+ "autoDetect": true,
214
+ "fallback": "en-US"
215
+ },
216
+ "logging": {
217
+ "level": "info"
218
+ }
219
+ },
220
+ "system": {
221
+ "session": {
222
+ "defaultSessionMode": "stateful",
223
+ "sessionModeRules": {
224
+ "stateful": ["Claude"],
225
+ "stateless": ["CherryStudio"]
226
+ }
227
+ }
228
+ },
229
+ "gateway": {
230
+ "proxyTimeout": 30000,
231
+ "rateLimit": {
232
+ "enabled": true,
233
+ "maxRequests": 100,
234
+ "windowMs": 60000
235
+ }
236
+ }
237
+ }
238
+ ```
239
+
240
+ </details>
241
+
242
+ ### Client Configuration
243
+
244
+ To connect your MCP client to MCP-HUB-LITE, add the following to your client's MCP configuration:
245
+
246
+ <details>
247
+ <summary>Claude Code / Claude Desktop (stateful mode — default)</summary>
248
+
249
+ ```json
250
+ {
251
+ "mcpServers": {
252
+ "mcp-hub-lite": {
253
+ "type": "http",
254
+ "url": "http://localhost:7788/mcp"
255
+ }
256
+ }
257
+ }
258
+ ```
259
+
260
+ Stateful mode provides session persistence, SSE streaming, and real-time notifications. UA matching is NOT automatic — it requires manually adding `"ClaudeCode"` to `system.session.sessionModeRules.stateful` in `.mcp-hub.json`. Standard MCP clients like Claude Code work with the default stateful mode without extra configuration.
261
+
262
+ </details>
263
+
264
+ <details>
265
+ <summary>CherryStudio (stateless mode)</summary>
266
+
267
+ ```json
268
+ {
269
+ "mcpServers": {
270
+ "mcp-hub-lite": {
271
+ "type": "http",
272
+ "url": "http://localhost:7788/mcp",
273
+ "headers": {
274
+ "x-mcp-session-mode": "stateless"
275
+ }
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ CherryStudio requires the `x-mcp-session-mode: stateless` header to use stateless mode. UA matching is NOT automatic — it requires manually adding `"CherryStudio"` to `system.session.sessionModeRules.stateless` in `.mcp-hub.json`. The header approach is the recommended way and takes highest priority.
282
+
283
+ Stateless mode uses per-request transport — each POST creates an independent transport, no session persistence, GET returns 405.
284
+
285
+ </details>
286
+
287
+ <details>
288
+ <summary>Manual session mode override</summary>
289
+
290
+ Add the `x-mcp-session-mode` header to force a specific mode:
291
+
292
+ ```json
293
+ {
294
+ "mcpServers": {
295
+ "mcp-hub-lite": {
296
+ "type": "http",
297
+ "url": "http://localhost:7788/mcp",
298
+ "headers": {
299
+ "x-mcp-session-mode": "stateful"
300
+ }
301
+ }
302
+ }
303
+ }
304
+ ```
305
+
306
+ Valid values: `"stateful"` or `"stateless"`. Header takes highest priority over UA matching and config defaults.
307
+
308
+ </details>
309
+
310
+ ## Usage Guide
311
+
312
+ ### Adding MCP Servers
313
+
314
+ Through the web interface:
315
+
316
+ 1. Open <http://localhost:7788>
317
+ 2. Navigate to the "Servers" page
318
+ 3. Click "Add Server"
319
+ 4. Fill in server details and save
320
+
321
+ ## Process Management
322
+
323
+ MCP-HUB-LITE supports launching and managing MCP servers using your local environment:
324
+
325
+ ### Supported Launch Methods
326
+
327
+ - **Node.js (npx)**: `npx package-name`
328
+ - **Python (uvx)**: `uvx package-name`
329
+ - **Direct Command**: Custom startup command
330
+
331
+ ### Process Management Features
332
+
333
+ - Start/stop/restart MCP servers
334
+ - Monitor CPU and memory usage
335
+ - Crash detection and automatic restart
336
+ - PID tracking and health checks
337
+
338
+ ## Development Guide
339
+
340
+ ### Project Structure
341
+
342
+ ```
343
+ src/
344
+ ├── api/ # API implementations
345
+ │ ├── mcp/ # MCP protocol handlers
346
+ │ ├── web/ # Web API routes (includes sessions.ts)
347
+ │ └── ws/ # WebSocket routes
348
+ ├── models/ # Data models
349
+ ├── services/ # Core business logic
350
+ │ ├── gateway/ # MCP gateway service
351
+ │ ├── connection/ # Connection management
352
+ │ └── hub-tools/ # Hub tools service
353
+ ├── utils/ # Utility functions
354
+ │ ├── logger/ # Logging utilities
355
+ │ └── transports/ # MCP transport implementations
356
+ ├── config/ # Configuration
357
+ ├── cli/ # CLI commands
358
+ │ └── commands/ # CLI command implementations
359
+ ├── pid/ # Process ID management
360
+ └── server/ # Server runtime
361
+
362
+ frontend/
363
+ ├── src/
364
+ │ ├── components/ # Reusable UI components
365
+ │ ├── views/ # Page view components
366
+ │ ├── stores/ # Pinia state management
367
+ │ ├── composables/ # Vue composables
368
+ │ ├── router/ # Vue Router configuration
369
+ │ ├── i18n/ # Internationalization
370
+ │ └── types/ # Frontend type definitions
371
+
372
+ shared/
373
+ ├── models/ # Shared models
374
+ └── types/ # Shared types
375
+
376
+ tests/
377
+ ├── unit/ # Unit tests
378
+ ├── integration/ # Integration tests
379
+ ├── contract/ # Contract tests
380
+ ├── helpers/ # Test helpers
381
+ └── types/ # Test types
382
+ ```
383
+
384
+ ### Adding New Features
385
+
386
+ 1. Create models (models/)
387
+ 2. Implement services (services/)
388
+ 3. Add API routes (api/)
389
+ 4. Write tests (tests/)
390
+ 5. Update configuration files
391
+
392
+ ## Detailed Technical Documentation
393
+
394
+ Complete project architecture, constraints, and design decisions can be found in:
395
+
396
+ - [CLAUDE.md](./CLAUDE.md) - Project AI context and module documentation
397
+
398
+ ## License
399
+
400
+ MIT
401
+
402
+ ## Contributing
403
+
404
+ Pull Requests and Issues are welcome!
405
+
406
+ ## Community
407
+
408
+ Thanks to the LinuxDo (linux.do) community for the discussions, sharing, and feedback.
409
+
410
+ <!-- Badges -->