@loop_ouroboros/mcp-hub-lite 1.2.9 → 1.3.1

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 (203) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +405 -331
  3. package/dist/client/assets/{HomeView-CGezWc0j.js → HomeView-DplI3V-h.js} +1 -1
  4. package/dist/client/assets/{ResourceDetailView-CDmWGdAK.css → ResourceDetailView-BkTSg91z.css} +1 -1
  5. package/dist/client/assets/ResourceDetailView-CeHPn99Y.js +1 -0
  6. package/dist/client/assets/ResourcesView-C1ObRhYS.js +1 -0
  7. package/dist/client/assets/ResourcesView-zgV8Nq7w.css +1 -0
  8. package/dist/client/assets/{ServerDashboard-g5p4VC_-.js → ServerDashboard-D7wG4Gvt.js} +1 -1
  9. package/dist/client/assets/{ServerDetail-DCQH8HIb.css → ServerDetail-CPNAFBPM.css} +1 -1
  10. package/dist/client/assets/ServerDetail-G23phOcJ.js +2 -0
  11. package/dist/client/assets/{ServerListView-DZsy2gaQ.js → ServerListView-BFiZLtPO.js} +1 -1
  12. package/dist/client/assets/{ServerStatusTags.vue_vue_type_script_setup_true_lang-DmGg4uuV.js → ServerStatusTags.vue_vue_type_script_setup_true_lang-Deb_SbFw.js} +1 -1
  13. package/dist/client/assets/SettingsView-QBFLZ6fP.js +1 -0
  14. package/dist/client/assets/ToolCallDialog-BQ9UJZ_-.css +1 -0
  15. package/dist/client/assets/ToolCallDialog-DYS-ADCL.js +1 -0
  16. package/dist/client/assets/ToolsView-DYwgtm7W.js +1 -0
  17. package/dist/client/assets/ToolsView-cO61nMNr.css +1 -0
  18. package/dist/client/assets/_baseClone-DQno9YO3.js +1 -0
  19. package/dist/client/assets/{el-form-item-CTsVV8sm.js → el-form-item-DF0zzQdH.js} +2 -2
  20. package/dist/client/assets/el-input-C_p2Qw42.js +1 -0
  21. package/dist/client/assets/el-loading-BaenpNzU.js +1 -0
  22. package/dist/client/assets/el-overlay-MbIUXSQ7.js +1 -0
  23. package/dist/client/assets/el-radio-group-COnCjCcz.js +1 -0
  24. package/dist/client/assets/el-skeleton-item-qj0eQP4s.js +1 -0
  25. package/dist/client/assets/el-switch-BZbXqB3_.js +1 -0
  26. package/dist/client/assets/el-tab-pane-w7RltRLd.js +1 -0
  27. package/dist/client/assets/el-table-column-OD8zhFcD.js +1 -0
  28. package/dist/client/assets/index-DwhULJXZ.js +2 -0
  29. package/dist/client/assets/{index-BNmwPGMT.css → index-UtsV0Cvh.css} +1 -1
  30. package/dist/client/assets/{omit-Btci9mp3.js → omit-BAJQlviJ.js} +1 -1
  31. package/dist/client/assets/raf-B1Ry7ruA.js +1 -0
  32. package/dist/client/assets/{vue-vendor-Dwcr0jep.js → vue-vendor-ClSvefnQ.js} +1 -1
  33. package/dist/client/index.html +3 -3
  34. package/dist/server/shared/models/constants.d.ts +8 -0
  35. package/dist/server/shared/models/constants.d.ts.map +1 -0
  36. package/dist/server/shared/models/constants.js +6 -0
  37. package/dist/server/shared/models/index.d.ts +1 -0
  38. package/dist/server/shared/models/index.d.ts.map +1 -1
  39. package/dist/server/shared/models/index.js +1 -0
  40. package/dist/server/shared/models/server.model.d.ts +14 -0
  41. package/dist/server/shared/models/server.model.d.ts.map +1 -1
  42. package/dist/server/shared/models/server.model.js +27 -4
  43. package/dist/server/shared/types/index.d.ts +0 -1
  44. package/dist/server/shared/types/index.d.ts.map +1 -1
  45. package/dist/server/shared/types/index.js +0 -1
  46. package/dist/server/src/api/mcp/debug-response-wrapper.js +1 -1
  47. package/dist/server/src/api/mcp/gateway.d.ts +10 -6
  48. package/dist/server/src/api/mcp/gateway.d.ts.map +1 -1
  49. package/dist/server/src/api/mcp/gateway.js +235 -87
  50. package/dist/server/src/api/web/hub-tools.d.ts.map +1 -1
  51. package/dist/server/src/api/web/hub-tools.js +11 -0
  52. package/dist/server/src/api/web/mcp-status.js +2 -2
  53. package/dist/server/src/api/web/search.d.ts +2 -16
  54. package/dist/server/src/api/web/search.d.ts.map +1 -1
  55. package/dist/server/src/api/web/search.js +22 -30
  56. package/dist/server/src/api/web/servers.js +1 -1
  57. package/dist/server/src/api/web/sessions.d.ts +1 -27
  58. package/dist/server/src/api/web/sessions.d.ts.map +1 -1
  59. package/dist/server/src/api/web/sessions.js +8 -97
  60. package/dist/server/src/api/ws/events.js +1 -1
  61. package/dist/server/src/api/ws/ws-handler.js +1 -1
  62. package/dist/server/src/app.d.ts.map +1 -1
  63. package/dist/server/src/app.js +6 -1
  64. package/dist/server/src/cli/commands/status.js +39 -1
  65. package/dist/server/src/cli/commands/tool-use.d.ts +10 -3
  66. package/dist/server/src/cli/commands/tool-use.d.ts.map +1 -1
  67. package/dist/server/src/cli/commands/tool-use.js +69 -30
  68. package/dist/server/src/cli/commands/use-guide.d.ts +0 -8
  69. package/dist/server/src/cli/commands/use-guide.d.ts.map +1 -1
  70. package/dist/server/src/cli/commands/use-guide.js +28 -170
  71. package/dist/server/src/cli/server.d.ts +10 -0
  72. package/dist/server/src/cli/server.d.ts.map +1 -1
  73. package/dist/server/src/cli/server.js +31 -1
  74. package/dist/server/src/config/config-change-logger.js +1 -1
  75. package/dist/server/src/config/config-loader.js +1 -1
  76. package/dist/server/src/config/config-manager.js +1 -1
  77. package/dist/server/src/config/config-migrator.d.ts +4 -48
  78. package/dist/server/src/config/config-migrator.d.ts.map +1 -1
  79. package/dist/server/src/config/config-migrator.js +2 -103
  80. package/dist/server/src/config/config-saver.js +1 -1
  81. package/dist/server/src/config/server-config-manager.js +1 -1
  82. package/dist/server/src/models/system-tools.constants.d.ts +2 -1
  83. package/dist/server/src/models/system-tools.constants.d.ts.map +1 -1
  84. package/dist/server/src/models/system-tools.constants.js +2 -1
  85. package/dist/server/src/pid/manager.js +1 -1
  86. package/dist/server/src/server/dev-server.js +4 -2
  87. package/dist/server/src/server/runner.d.ts.map +1 -1
  88. package/dist/server/src/server/runner.js +4 -2
  89. package/dist/server/src/server/startup.js +2 -2
  90. package/dist/server/src/services/connection/connection-manager.d.ts +2 -0
  91. package/dist/server/src/services/connection/connection-manager.d.ts.map +1 -1
  92. package/dist/server/src/services/connection/connection-manager.js +27 -25
  93. package/dist/server/src/services/connection/tool-cache.d.ts.map +1 -1
  94. package/dist/server/src/services/connection/tool-cache.js +10 -8
  95. package/dist/server/src/services/event-bus.service.d.ts +3 -1
  96. package/dist/server/src/services/event-bus.service.d.ts.map +1 -1
  97. package/dist/server/src/services/event-bus.service.js +1 -0
  98. package/dist/server/src/services/gateway/gateway.service.d.ts +14 -0
  99. package/dist/server/src/services/gateway/gateway.service.d.ts.map +1 -1
  100. package/dist/server/src/services/gateway/gateway.service.js +101 -7
  101. package/dist/server/src/services/gateway/global-transport.d.ts +20 -10
  102. package/dist/server/src/services/gateway/global-transport.d.ts.map +1 -1
  103. package/dist/server/src/services/gateway/global-transport.js +50 -34
  104. package/dist/server/src/services/gateway/request-handlers/call-tool-handler.d.ts +1 -2
  105. package/dist/server/src/services/gateway/request-handlers/call-tool-handler.d.ts.map +1 -1
  106. package/dist/server/src/services/gateway/request-handlers/call-tool-handler.js +24 -13
  107. package/dist/server/src/services/gateway/request-handlers/initialize-handler.d.ts.map +1 -1
  108. package/dist/server/src/services/gateway/request-handlers/initialize-handler.js +22 -6
  109. package/dist/server/src/services/gateway/request-handlers/resources-handler.d.ts.map +1 -1
  110. package/dist/server/src/services/gateway/request-handlers/resources-handler.js +12 -4
  111. package/dist/server/src/services/gateway/session-manager.d.ts +101 -0
  112. package/dist/server/src/services/gateway/session-manager.d.ts.map +1 -0
  113. package/dist/server/src/services/gateway/session-manager.js +256 -0
  114. package/dist/server/src/services/gateway/tool-list-generator.d.ts +14 -19
  115. package/dist/server/src/services/gateway/tool-list-generator.d.ts.map +1 -1
  116. package/dist/server/src/services/gateway/tool-list-generator.js +221 -80
  117. package/dist/server/src/services/hub-manager.service.d.ts.map +1 -1
  118. package/dist/server/src/services/hub-manager.service.js +15 -2
  119. package/dist/server/src/services/hub-tools/instance-selector.js +1 -1
  120. package/dist/server/src/services/hub-tools/resource-generator.d.ts +1 -22
  121. package/dist/server/src/services/hub-tools/resource-generator.d.ts.map +1 -1
  122. package/dist/server/src/services/hub-tools/resource-generator.js +24 -22
  123. package/dist/server/src/services/hub-tools/server-selector.js +1 -1
  124. package/dist/server/src/services/hub-tools.service.d.ts.map +1 -1
  125. package/dist/server/src/services/hub-tools.service.js +18 -13
  126. package/dist/server/src/services/log-storage.service.js +1 -1
  127. package/dist/server/src/services/system-tool-handler.js +1 -1
  128. package/dist/server/src/utils/error-handler.js +1 -1
  129. package/dist/server/src/utils/index.d.ts +1 -1
  130. package/dist/server/src/utils/index.d.ts.map +1 -1
  131. package/dist/server/src/utils/index.js +1 -1
  132. package/dist/server/src/utils/json-utils.d.ts +9 -0
  133. package/dist/server/src/utils/json-utils.d.ts.map +1 -1
  134. package/dist/server/src/utils/json-utils.js +23 -4
  135. package/dist/server/src/utils/log-rotator.d.ts +0 -15
  136. package/dist/server/src/utils/log-rotator.d.ts.map +1 -1
  137. package/dist/server/src/utils/log-rotator.js +0 -18
  138. package/dist/server/src/utils/logger/index.d.ts +1 -1
  139. package/dist/server/src/utils/logger/index.d.ts.map +1 -1
  140. package/dist/server/src/utils/logger/index.js +1 -1
  141. package/dist/server/src/utils/logger/log-context.d.ts +1 -0
  142. package/dist/server/src/utils/logger/log-context.d.ts.map +1 -1
  143. package/dist/server/src/utils/logger/log-formatter.d.ts.map +1 -1
  144. package/dist/server/src/utils/logger/log-formatter.js +25 -11
  145. package/dist/server/src/utils/logger/log-output.d.ts +17 -1
  146. package/dist/server/src/utils/logger/log-output.d.ts.map +1 -1
  147. package/dist/server/src/utils/logger/log-output.js +46 -40
  148. package/dist/server/src/utils/logger/logger.d.ts.map +1 -1
  149. package/dist/server/src/utils/logger/logger.js +18 -2
  150. package/dist/server/src/utils/port-checker.js +1 -1
  151. package/dist/server/src/utils/request-context.d.ts +8 -70
  152. package/dist/server/src/utils/request-context.d.ts.map +1 -1
  153. package/dist/server/src/utils/request-context.js +11 -70
  154. package/dist/server/src/utils/transports/stdio-transport.js +1 -1
  155. package/dist/server/src/utils/transports/streamable-http-transport.js +1 -1
  156. package/dist/server/src/utils/transports/transport-factory.d.ts.map +1 -1
  157. package/dist/server/src/utils/transports/transport-factory.js +26 -3
  158. package/dist/server/tests/contract/mcp-protocol/initialize.test.js +1 -1
  159. package/dist/server/tests/contract/mcp-protocol/tools-call.test.js +1 -1
  160. package/dist/server/tests/contract/mcp-protocol/tools-list.test.js +1 -1
  161. package/dist/server/tests/integration/gateway/fault-tolerance.test.js +1 -1
  162. package/dist/server/tests/integration/gateway/mcp-connection.test.js +1 -1
  163. package/dist/server/tests/types/logger-test-helpers.d.ts +1 -1
  164. package/dist/server/tests/types/logger-test-helpers.d.ts.map +1 -1
  165. package/dist/server/tests/unit/config/config-migrator.test.js +45 -105
  166. package/dist/server/tests/unit/config/config-saver.test.js +1 -1
  167. package/dist/server/tests/unit/config/config.schema.test.js +2 -1
  168. package/dist/server/tests/unit/server/runner.test.js +19 -13
  169. package/dist/server/tests/unit/services/gateway-logging.test.js +1 -1
  170. package/dist/server/tests/unit/services/gateway-session-mode.test.d.ts +2 -0
  171. package/dist/server/tests/unit/services/gateway-session-mode.test.d.ts.map +1 -0
  172. package/dist/server/tests/unit/services/gateway-session-mode.test.js +174 -0
  173. package/dist/server/tests/unit/services/hub-manager-service.test.js +4 -5
  174. package/dist/server/tests/unit/services/hub-tools.service.test.js +82 -6
  175. package/dist/server/tests/unit/utils/config.test.js +14 -7
  176. package/dist/server/tests/unit/utils/log-output.test.d.ts +2 -0
  177. package/dist/server/tests/unit/utils/log-output.test.d.ts.map +1 -0
  178. package/dist/server/tests/unit/utils/log-output.test.js +198 -0
  179. package/dist/server/tests/unit/utils/log-rotator.test.js +1 -15
  180. package/dist/server/tests/unit/utils/logger.test.js +1 -1
  181. package/dist/server/vitest.config.d.ts.map +1 -1
  182. package/dist/server/vitest.config.js +0 -2
  183. package/package.json +1 -3
  184. package/dist/client/assets/ResourceDetailView-Bi5UsbFq.js +0 -1
  185. package/dist/client/assets/ResourcesView-B9anSm85.js +0 -1
  186. package/dist/client/assets/ResourcesView-Cc8RHtia.css +0 -1
  187. package/dist/client/assets/ServerDetail-DMoFqWCp.js +0 -2
  188. package/dist/client/assets/SettingsView-DQSWb9xM.js +0 -1
  189. package/dist/client/assets/ToolCallDialog-BEyRp_J3.js +0 -1
  190. package/dist/client/assets/ToolCallDialog-BhdPX-Kf.css +0 -1
  191. package/dist/client/assets/ToolsView-BU7PKJwt.js +0 -1
  192. package/dist/client/assets/ToolsView-BkrQLjH9.css +0 -1
  193. package/dist/client/assets/_baseClone-DsVtZfPm.js +0 -1
  194. package/dist/client/assets/el-input-Bh1VGJTU.js +0 -1
  195. package/dist/client/assets/el-loading-huOeK9cW.js +0 -1
  196. package/dist/client/assets/el-overlay-CR_KVhLU.js +0 -1
  197. package/dist/client/assets/el-radio-group-BSbtAW4k.js +0 -1
  198. package/dist/client/assets/el-skeleton-item-BSxOLPFM.js +0 -1
  199. package/dist/client/assets/el-switch-BaQUQWTL.js +0 -1
  200. package/dist/client/assets/el-tab-pane-9JxLgdS7.js +0 -1
  201. package/dist/client/assets/el-table-column-Du1l9Ww3.js +0 -1
  202. package/dist/client/assets/index-CsZoFRv1.js +0 -2
  203. package/dist/client/assets/raf-tUu4BwZS.js +0 -1
package/README.md CHANGED
@@ -1,331 +1,405 @@
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. No extra headers needed — Claude Code is detected automatically by UA matching.
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
+ }
274
+ }
275
+ }
276
+ ```
277
+
278
+ CherryStudio is detected automatically by UA matching and routed to stateless mode. Stateless mode uses per-request transport — each POST creates an independent transport, no session persistence, GET returns 405.
279
+
280
+ </details>
281
+
282
+ <details>
283
+ <summary>Manual session mode override</summary>
284
+
285
+ Add the `x-mcp-session-mode` header to force a specific mode:
286
+
287
+ ```json
288
+ {
289
+ "mcpServers": {
290
+ "mcp-hub-lite": {
291
+ "type": "http",
292
+ "url": "http://localhost:7788/mcp",
293
+ "headers": {
294
+ "x-mcp-session-mode": "stateful"
295
+ }
296
+ }
297
+ }
298
+ }
299
+ ```
300
+
301
+ Valid values: `"stateful"` or `"stateless"`. Header takes highest priority over UA matching and config defaults.
302
+
303
+ </details>
304
+
305
+ ## Usage Guide
306
+
307
+ ### Adding MCP Servers
308
+
309
+ Through the web interface:
310
+
311
+ 1. Open <http://localhost:7788>
312
+ 2. Navigate to the "Servers" page
313
+ 3. Click "Add Server"
314
+ 4. Fill in server details and save
315
+
316
+ ## Process Management
317
+
318
+ MCP-HUB-LITE supports launching and managing MCP servers using your local environment:
319
+
320
+ ### Supported Launch Methods
321
+
322
+ - **Node.js (npx)**: `npx package-name`
323
+ - **Python (uvx)**: `uvx package-name`
324
+ - **Direct Command**: Custom startup command
325
+
326
+ ### Process Management Features
327
+
328
+ - Start/stop/restart MCP servers
329
+ - Monitor CPU and memory usage
330
+ - Crash detection and automatic restart
331
+ - PID tracking and health checks
332
+
333
+ ## Development Guide
334
+
335
+ ### Project Structure
336
+
337
+ ```
338
+ src/
339
+ ├── api/ # API implementations
340
+ │ ├── mcp/ # MCP protocol handlers
341
+ │ ├── web/ # Web API routes (includes sessions.ts)
342
+ │ └── ws/ # WebSocket routes
343
+ ├── models/ # Data models
344
+ ├── services/ # Core business logic
345
+ │ ├── gateway/ # MCP gateway service
346
+ │ ├── connection/ # Connection management
347
+ │ └── hub-tools/ # Hub tools service
348
+ ├── utils/ # Utility functions
349
+ │ ├── logger/ # Logging utilities
350
+ │ └── transports/ # MCP transport implementations
351
+ ├── config/ # Configuration
352
+ ├── cli/ # CLI commands
353
+ │ └── commands/ # CLI command implementations
354
+ ├── pid/ # Process ID management
355
+ └── server/ # Server runtime
356
+
357
+ frontend/
358
+ ├── src/
359
+ │ ├── components/ # Reusable UI components
360
+ │ ├── views/ # Page view components
361
+ │ ├── stores/ # Pinia state management
362
+ │ ├── composables/ # Vue composables
363
+ │ ├── router/ # Vue Router configuration
364
+ │ ├── i18n/ # Internationalization
365
+ │ └── types/ # Frontend type definitions
366
+
367
+ shared/
368
+ ├── models/ # Shared models
369
+ └── types/ # Shared types
370
+
371
+ tests/
372
+ ├── unit/ # Unit tests
373
+ ├── integration/ # Integration tests
374
+ ├── contract/ # Contract tests
375
+ ├── helpers/ # Test helpers
376
+ └── types/ # Test types
377
+ ```
378
+
379
+ ### Adding New Features
380
+
381
+ 1. Create models (models/)
382
+ 2. Implement services (services/)
383
+ 3. Add API routes (api/)
384
+ 4. Write tests (tests/)
385
+ 5. Update configuration files
386
+
387
+ ## Detailed Technical Documentation
388
+
389
+ Complete project architecture, constraints, and design decisions can be found in:
390
+
391
+ - [CLAUDE.md](./CLAUDE.md) - Project AI context and module documentation
392
+
393
+ ## License
394
+
395
+ MIT
396
+
397
+ ## Contributing
398
+
399
+ Pull Requests and Issues are welcome!
400
+
401
+ ## Community
402
+
403
+ Thanks to the LinuxDo (linux.do) community for the discussions, sharing, and feedback.
404
+
405
+ <!-- Badges -->