@loop_ouroboros/mcp-hub-lite 1.1.0 → 1.2.0

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 (100) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/README.md +74 -116
  3. package/dist/client/assets/{HomeView-Bu2joUvW.js → HomeView-BBwvy1oj.js} +1 -1
  4. package/dist/client/assets/{ResourceDetailView-BvrhDCD1.js → ResourceDetailView-CZ2aB73w.js} +1 -1
  5. package/dist/client/assets/{ResourcesView-LjqioF_s.js → ResourcesView-CN1NlhWs.js} +1 -1
  6. package/dist/client/assets/{ServerDashboard-FhHJFvUi.js → ServerDashboard-k652Vw4Z.js} +1 -1
  7. package/dist/client/assets/{ServerDetail-BKV-M4qT.js → ServerDetail-BLQ-a4cO.js} +1 -1
  8. package/dist/client/assets/{ServerListView-BXgtDyt3.js → ServerListView-BHrsFD5i.js} +4 -4
  9. package/dist/client/assets/{ServerStatusTags.vue_vue_type_script_setup_true_lang-D-ooYNdN.js → ServerStatusTags.vue_vue_type_script_setup_true_lang-BHhwEuGe.js} +1 -1
  10. package/dist/client/assets/{SettingsView-CMFG91Z4.js → SettingsView-CUOFNXrz.js} +1 -1
  11. package/dist/client/assets/{ToolCallDialog-Bf4Xe4gH.js → ToolCallDialog-BfPjLxfV.js} +1 -1
  12. package/dist/client/assets/ToolsView-BxgXvPC3.css +1 -0
  13. package/dist/client/assets/ToolsView-CyuhYAE2.js +1 -0
  14. package/dist/client/assets/{_baseClone-Bp9Rjwd7.js → _baseClone-DO5qfalW.js} +1 -1
  15. package/dist/client/assets/{el-form-item-DdSUWYsl.js → el-form-item-CcGsD2K_.js} +2 -2
  16. package/dist/client/assets/{el-input-99gMrutP.js → el-input-tYgeiaCT.js} +1 -1
  17. package/dist/client/assets/{el-loading-CIQ5pD5u.js → el-loading-Dwl9E_Vr.js} +1 -1
  18. package/dist/client/assets/{el-overlay-BVM6msGX.js → el-overlay-kqX_BABo.js} +1 -1
  19. package/dist/client/assets/{el-radio-group-DhXWy7ry.js → el-radio-group-D8aWBVOT.js} +1 -1
  20. package/dist/client/assets/el-skeleton-item-BRwIFspE.js +1 -0
  21. package/dist/client/assets/{el-switch-Bu8AQ5uM.js → el-switch-BF8c-xeU.js} +1 -1
  22. package/dist/client/assets/{el-tab-pane-BnGMaV56.js → el-tab-pane-C4Ep94cd.js} +1 -1
  23. package/dist/client/assets/{el-table-column-BMWOaLS_.js → el-table-column-Cog6uCh-.js} +1 -1
  24. package/dist/client/assets/{index-C2V-ZGji.js → index-ByNBhPAR.js} +1 -1
  25. package/dist/client/assets/index-CTB6oe-9.js +2 -0
  26. package/dist/client/assets/omit-CUnDT6sS.js +1 -0
  27. package/dist/client/assets/{raf-C2wXzaVU.js → raf-CmzeRPMd.js} +1 -1
  28. package/dist/client/assets/{vue-vendor-BLHLXXJK.js → vue-vendor-CbgVSHIh.js} +3 -3
  29. package/dist/client/index.html +2 -2
  30. package/dist/server/src/api/mcp/debug-response-wrapper.js +2 -2
  31. package/dist/server/src/api/mcp/gateway.d.ts.map +1 -1
  32. package/dist/server/src/api/mcp/gateway.js +17 -3
  33. package/dist/server/src/api/mcp/session-context-extractor.d.ts.map +1 -1
  34. package/dist/server/src/api/mcp/session-context-extractor.js +14 -5
  35. package/dist/server/src/cli/commands/mcp-tool-use.d.ts +62 -0
  36. package/dist/server/src/cli/commands/mcp-tool-use.d.ts.map +1 -0
  37. package/dist/server/src/cli/commands/mcp-tool-use.js +174 -0
  38. package/dist/server/src/cli/commands/server.d.ts +57 -0
  39. package/dist/server/src/cli/commands/server.d.ts.map +1 -0
  40. package/dist/server/src/cli/commands/server.js +169 -0
  41. package/dist/server/src/cli/commands/tool-use.d.ts +95 -0
  42. package/dist/server/src/cli/commands/tool-use.d.ts.map +1 -0
  43. package/dist/server/src/cli/commands/tool-use.js +255 -0
  44. package/dist/server/src/cli/index.d.ts +4 -2
  45. package/dist/server/src/cli/index.d.ts.map +1 -1
  46. package/dist/server/src/cli/index.js +35 -3
  47. package/dist/server/src/config/config-loader.js +1 -1
  48. package/dist/server/src/config/config-manager.js +1 -1
  49. package/dist/server/src/models/system-tools.constants.d.ts +2 -2
  50. package/dist/server/src/models/system-tools.constants.d.ts.map +1 -1
  51. package/dist/server/src/models/system-tools.constants.js +2 -2
  52. package/dist/server/src/services/connection/tool-cache.d.ts.map +1 -1
  53. package/dist/server/src/services/connection/tool-cache.js +3 -1
  54. package/dist/server/src/services/gateway/gateway.service.d.ts.map +1 -1
  55. package/dist/server/src/services/gateway/gateway.service.js +38 -4
  56. package/dist/server/src/services/gateway/global-transport.d.ts +14 -5
  57. package/dist/server/src/services/gateway/global-transport.d.ts.map +1 -1
  58. package/dist/server/src/services/gateway/global-transport.js +54 -30
  59. package/dist/server/src/services/gateway/request-handlers/initialize-handler.d.ts.map +1 -1
  60. package/dist/server/src/services/gateway/request-handlers/initialize-handler.js +12 -1
  61. package/dist/server/src/services/gateway/request-handlers/system-tools-handler.js +2 -2
  62. package/dist/server/src/services/gateway/request-handlers/tools-handler.d.ts.map +1 -1
  63. package/dist/server/src/services/gateway/request-handlers/tools-handler.js +3 -4
  64. package/dist/server/src/services/hub-tools/system-tool-definitions.d.ts +1 -0
  65. package/dist/server/src/services/hub-tools/system-tool-definitions.d.ts.map +1 -1
  66. package/dist/server/src/services/hub-tools/system-tool-definitions.js +4 -3
  67. package/dist/server/src/services/hub-tools.service.d.ts +3 -2
  68. package/dist/server/src/services/hub-tools.service.d.ts.map +1 -1
  69. package/dist/server/src/services/hub-tools.service.js +36 -19
  70. package/dist/server/src/services/search/search-core.service.d.ts +5 -5
  71. package/dist/server/src/services/search/search-core.service.js +11 -11
  72. package/dist/server/src/services/session/session-manager.d.ts +256 -12
  73. package/dist/server/src/services/session/session-manager.d.ts.map +1 -1
  74. package/dist/server/src/services/session/session-manager.js +585 -23
  75. package/dist/server/src/services/session-tracker.service.d.ts +10 -2
  76. package/dist/server/src/services/session-tracker.service.d.ts.map +1 -1
  77. package/dist/server/src/services/session-tracker.service.js +53 -2
  78. package/dist/server/src/services/system-tool-handler.js +2 -2
  79. package/dist/server/src/utils/index.d.ts +1 -0
  80. package/dist/server/src/utils/index.d.ts.map +1 -1
  81. package/dist/server/src/utils/index.js +1 -0
  82. package/dist/server/src/utils/name-converter.d.ts +17 -0
  83. package/dist/server/src/utils/name-converter.d.ts.map +1 -0
  84. package/dist/server/src/utils/name-converter.js +27 -0
  85. package/dist/server/src/utils/request-context.d.ts +18 -0
  86. package/dist/server/src/utils/request-context.d.ts.map +1 -1
  87. package/dist/server/src/utils/request-context.js +20 -0
  88. package/dist/server/tests/evaluation/evaluation.test.js +9 -10
  89. package/dist/server/tests/integration/api/gateway.test.js +2 -2
  90. package/dist/server/tests/unit/services/hub-tools.service.test.js +1 -1
  91. package/dist/server/tests/unit/utils/name-converter.test.d.ts +2 -0
  92. package/dist/server/tests/unit/utils/name-converter.test.d.ts.map +1 -0
  93. package/dist/server/tests/unit/utils/name-converter.test.js +69 -0
  94. package/dist/server/tests/unit/utils/request-context.test.js +24 -5
  95. package/package.json +3 -1
  96. package/dist/client/assets/ToolsView-DFpha1z0.js +0 -1
  97. package/dist/client/assets/ToolsView-E3Ps9c7i.css +0 -1
  98. package/dist/client/assets/el-skeleton-item-DJz-Us12.js +0 -1
  99. package/dist/client/assets/index-vhkqgpmN.js +0 -2
  100. package/dist/client/assets/omit-CqPQN3XP.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,146 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-04-14
4
+
5
+ - **CLI Fix**: Fix CLI entry detection for Windows/npm symlink environments
6
+ - **CLI Refactor**: Fix command count and rename mcpToolUseCommand to toolUseCommand
7
+ - **Config Refactor**: Change config loading logs from info to debug level
8
+ - **Docs**: Complete CLAUDE.md documentation for all submodules
9
+ - **Test**: Add unit tests for normalizeToolName function
10
+ - **System Tools Refactor**: Rename list_tools_in_server to list_tools
11
+ - **Core Feature**: Add normalizeToolName for cross-format tool name matching
12
+ - **CLI Feature**: Add tool-use command for MCP server tool operations
13
+ - **Version**: Bump version to 1.1.1
14
+ - **Gateway Feature**: Implement per-request transport mode to fix connection errors
15
+
16
+ ## 2026-04-13
17
+
18
+ - **Deps**: Add undici dependency for HTTP transport
19
+ - **Frontend Fix**: Prevent runtime error when tool is undefined in groupedTools
20
+ - **Version**: Bump version to 1.1.0
21
+ - **Core Refactor**: Use composite key serverName-serverIndex instead of serverId
22
+ - **Resource Feature**: Implement MCP native resource forwarding
23
+ - **Docs**: Update search functionality description in CLAUDE.md
24
+ - **Hub Tools Refactor**: Add non-strict mode to selectBestInstance
25
+ - **Search Refactor**: Remove complex search module, simplify to string matching
26
+ - **Test Refactor**: Remove evaluation tests not compliant with MCP spec
27
+
28
+ ## 2026-04-12
29
+
30
+ - **Config Refactor**: Move instance selection strategy to template
31
+ - **Frontend Refactor**: Improve type declarations and test type safety
32
+ - **Frontend Refactor**: Compute instance counts from server.instances directly
33
+ - **Gateway Feature**: Restrict call_tool from invoking system tools
34
+ - **Docs**: Compress use-guide from 13 to 7 sections
35
+ - **Gateway Fix**: Return 400 for missing Accept header
36
+
37
+ ## 2026-04-10
38
+
39
+ - **Transport Refactor**: Use official SDK StdioClientTransport
40
+ - **Stdio Transport Refactor**: Log non-JSON-RPC stdout and unify stderr log level
41
+ - **Frontend Fix**: Fix tools and resources not displaying in server detail
42
+ - **Frontend Fix**: Add description field to ConfigTemplateForm
43
+ - **Tools Fix**: Handle nested toolArgs in updateServerDescription
44
+
45
+ ## 2026-04-09
46
+
47
+ - **Security Feature**: Mask sensitive values in config change logs
48
+ - **Frontend Fix**: Improve instance status reactivity and management
49
+ - **i18n Fix**: Improve noToolsFound message to reflect tool aggregation
50
+ - **Frontend Fix**: Add bottom padding to prevent save button cutoff on scroll
51
+ - **Gateway Refactor**: Extract version and protocol version to shared utility
52
+ - **Config Refactor**: Unify instance ID generation with content hash
53
+
54
+ ## 2026-04-08
55
+
56
+ - **MCP Status Fix**: Prevent automatic enabled field updates on connect/disconnect
57
+ - **Chore**: Update .gitignore to ignore .full-review directory
58
+
59
+ ## 2026-04-07
60
+
61
+ - **Frontend Fix**: Fix TypeScript type errors in component event handlers
62
+
63
+ ## 2026-04-04
64
+
65
+ - **Test Refactor**: Simplify ServerStatusTags tests with mocks
66
+ - **Config Feature**: Sort env and headers keys on config save
67
+ - **Proxy Feature**: Add proxy configuration support for SSE and Streamable HTTP transports
68
+
69
+ ## 2026-04-03
70
+
71
+ - **Config Feature**: Sort env and headers keys on config save
72
+ - **Config Refactor**: Optimize updateServerInstance logging
73
+ - **Connection Refactor**: Improve serverId handling and protocol version support
74
+
75
+ ## 2026-04-02
76
+
77
+ - **Docs**: Update CLAUDE.md documentation for logging and composables
78
+ - **Logging Refactor**: Enhance transport logging with serverId context
79
+ - **Transports Feature**: Add LineBuffer for proper stderr line buffering
80
+ - **Logging Refactor**: Enhance logging module and configuration change tracking
81
+ - **Docs**: Update CLAUDE.md documentation for v1.1 config refactor
82
+
83
+ ## 2026-04-01
84
+
85
+ - **Config Refactor**: Complete v1.1 multi-instance configuration refactoring
86
+ - **Docs**: Update CLAUDE.md files to reflect session removal
87
+ - **Session Refactor**: Remove session persistence mechanism and use SDK native stateless mode
88
+ - **Session Refactor**: Remove session persistence mechanism
89
+
90
+ ## 2026-03-31
91
+
92
+ - **UI Fix**: Ensure log viewer area fills available container height
93
+ - **Frontend Feature**: Add instance tab routing synchronization
94
+
95
+ ## 2026-03-29
96
+
97
+ - **i18n Fix**: Correct missing translation key in InstanceConfig component
98
+
99
+ ## 2026-03-28
100
+
101
+ - **Hub Tools Feature**: Implement instance selection strategies
102
+
103
+ ## 2026-03-27
104
+
105
+ - **Docs**: Update CLAUDE.md files across project modules
106
+ - **Session Feature**: Remove cwd and project fields from session management
107
+ - **UI Fix**: Optimize instance list display in English and hide redundant Running tag
108
+ - **Config Fix**: Ensure server instance indexes from config load and migration
109
+
110
+ ## 2026-03-26
111
+
112
+ - **Config Feature**: Implement v1.1 instance configuration system
113
+
114
+ ## 2026-03-25
115
+
116
+ - **Config Fix**: Support string index type for server instance operations
117
+ - **Docs**: Update CLAUDE.md files to reflect recent v1.1 config changes
118
+ - **Config Feature**: Enhance instance management with display name and route selection
119
+
120
+ ## 2026-03-24
121
+
122
+ - **Config Refactor**: Activate v1.1 config format with instance support
123
+ - **Gateway Fix**: Only include tools from servers with allowedTools configured
124
+ - **Hub Tools Fix**: Support both toolArgs and arguments for backward compatibility
125
+
126
+ ## 2026-03-23
127
+
128
+ - **Config Refactor**: Activate v1.1 config format, remove v1.0 compatibility code
129
+ - **Config Feature**: Add empty value cleaning when saving config
130
+
131
+ ## 2026-03-20
132
+
133
+ - **UI Fix**: Correct dark mode background color and refine instance UI
134
+ - **UI Feature**: Add server instance management UI components
135
+ - **Config Feature**: Add index and displayName to ServerInstanceConfig with reassignment API
136
+ - **UI Feature**: Add tag management UI with TagManager component
137
+ - **Config Feature**: Add v1.1 config schema with auto-migration support
138
+
139
+ ## 2026-03-19
140
+
141
+ - **i18n Fix**: Fix headers label and add button text in server config
142
+ - **UI Feature**: Add description field support in AddServerModal
143
+
3
144
  ## 2026-03-17
4
145
 
5
146
  - **UI Enhancement**: Update resource detail and list views with hub tools integration
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # MCP-HUB-LITE
2
2
 
3
- [![License][license-src]][license-href]
4
- [![Node.js][node-src]][node-href]
5
- [![TypeScript][typescript-src]][typescript-href]
6
- [![Vitest][vitest-src]][vitest-href]
7
- [![Fastify][fastify-src]][fastify-href]
8
- [![Vue.js][vue-src]][vue-href]
9
- [![Claude Code][claude-code-src]][claude-code-href]
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
10
 
11
- ---
11
+ ***
12
12
 
13
13
  [中文文档](./README_zh.md)
14
14
 
@@ -18,32 +18,22 @@ A lightweight MCP management platform designed for independent developers, provi
18
18
 
19
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
20
 
21
- ### Dashboard
22
-
23
- ![Dashboard](./docs/screenshot/en/dashboard.png)
24
-
25
21
  ### Core Features
26
22
 
27
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
28
25
  - **Server Management**: Manage multiple MCP servers through a web interface
29
- - **Tool Search**: Fuzzy search and tool discovery across all servers
26
+ - **Tool Search**: Search and tool discovery across all servers with aggregation
30
27
  - **Process Management**: Launch and manage MCP server processes via npx/uvx
31
- - **Session Management**: Session state management with persistence and recovery
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
32
31
  - **Tag System**: Organize multiple MCP servers by environment, category, function, etc.
33
32
  - **Fault Tolerance**: System continues to operate when individual servers fail
34
33
  - **Bilingual Interface**: Support for Chinese/English interface switching
35
34
  - **Configuration Management**: Support for hot-reloading and maintenance of `.mcp-hub.json`
36
-
37
- ## Tech Stack
38
-
39
- - **TypeScript 5.x** + Node.js 22.x
40
- - **Fastify**: High-performance HTTP server
41
- - **MCP SDK**: Official MCP protocol support (@modelcontextprotocol/sdk)
42
- - **Vitest**: Unit testing framework
43
- - **Zod**: Data validation
44
- - **Vue 3**: Frontend UI framework
45
- - **Pinia**: Frontend state management
46
- - **Element Plus**: UI component library
35
+ - **MCP Native Resources**: Forward resource calls to backend MCP servers
36
+ - **Security**: Mask sensitive values in config change logs
47
37
 
48
38
  ## Quick Start
49
39
 
@@ -93,7 +83,7 @@ npm run status
93
83
  npm run ui
94
84
  ```
95
85
 
96
- The server will start at http://localhost:7788.
86
+ The server will start at <http://localhost:7788>.
97
87
 
98
88
  ## Server Management
99
89
 
@@ -115,32 +105,17 @@ Discover and call tools from all connected MCP servers through the unified gatew
115
105
 
116
106
  Browse and manage MCP resources from all connected servers.
117
107
 
118
- ## Sessions
119
-
120
- ![Sessions](./docs/screenshot/en/sessions.png)
121
-
122
- Session management with persistence support. Sessions are automatically saved to disk and can be restored after service restart.
123
-
124
- ## Settings
125
-
126
- ![Settings](./docs/screenshot/en/settings.png)
127
-
128
- Configure language, logging, and other settings through the settings page.
129
-
130
108
  ### Testing
131
109
 
132
110
  ```bash
133
111
  # Run all tests
134
112
  npm test
135
113
 
136
- # Unit tests
137
- npm run test:unit
138
-
139
- # Integration tests
140
- npm run test:integration
114
+ # Backend tests
115
+ npm run test:backend
141
116
 
142
- # Contract tests
143
- npm run test:contract
117
+ # Frontend tests
118
+ npm run test:frontend
144
119
  ```
145
120
 
146
121
  ## CLI Commands
@@ -166,6 +141,32 @@ node dist/index.js ui
166
141
  node dist/index.js --help
167
142
  ```
168
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
+
169
170
  ## Configuration
170
171
 
171
172
  MCP-HUB-LITE uses a `.mcp-hub.json` file for configuration. Configuration lookup priority:
@@ -177,24 +178,33 @@ MCP-HUB-LITE uses a `.mcp-hub.json` file for configuration. Configuration lookup
177
178
 
178
179
  ```json
179
180
  {
180
- "version": "1.0.0",
181
+ "version": "1.1.0",
181
182
  "servers": [
182
183
  {
183
184
  "id": "server-1",
184
185
  "name": "My MCP Server",
185
186
  "description": "Example server",
187
+ "transport": "streamable-http",
186
188
  "endpoint": "http://localhost:8080",
187
- "transport": "http-stream",
188
189
  "tags": {
189
190
  "env": "development",
190
191
  "category": "api-server",
191
192
  "function": "http-api",
192
193
  "priority": "medium"
193
194
  },
195
+ "allowedTools": [],
196
+ "instances": [
197
+ {
198
+ "index": 0,
199
+ "displayName": "Instance 1",
200
+ "enabled": true,
201
+ "env": {}
202
+ }
203
+ ],
194
204
  "managedProcess": {
195
205
  "command": "npx my-mcp-server",
196
206
  "managedMode": "npx",
197
- "processType": "http-stream"
207
+ "processType": "streamable-http"
198
208
  }
199
209
  }
200
210
  ],
@@ -225,50 +235,11 @@ MCP-HUB-LITE uses a `.mcp-hub.json` file for configuration. Configuration lookup
225
235
 
226
236
  Through the web interface:
227
237
 
228
- 1. Open http://localhost:7788
238
+ 1. Open <http://localhost:7788>
229
239
  2. Navigate to the "Servers" page
230
240
  3. Click "Add Server"
231
241
  4. Fill in server details and save
232
242
 
233
- ### MCP Protocol Usage
234
-
235
- MCP-HUB-LITE exposes the MCP protocol interface on the same port:
236
-
237
- #### List All Tools
238
-
239
- ```json
240
- {
241
- "jsonrpc": "2.0",
242
- "method": "tools/list",
243
- "params": {}
244
- }
245
- ```
246
-
247
- #### Call a Tool
248
-
249
- ```json
250
- {
251
- "jsonrpc": "2.0",
252
- "method": "tool/call",
253
- "params": {
254
- "toolId": "server1:example-tool",
255
- "arguments": {}
256
- }
257
- }
258
- ```
259
-
260
- #### Get Server Status
261
-
262
- ```json
263
- {
264
- "jsonrpc": "2.0",
265
- "method": "server/status",
266
- "params": {
267
- "serverId": "server-1"
268
- }
269
- }
270
- ```
271
-
272
243
  ## Process Management
273
244
 
274
245
  MCP-HUB-LITE supports launching and managing MCP servers using your local environment:
@@ -297,9 +268,15 @@ src/
297
268
  │ └── web-api/ # Web API routes
298
269
  ├── models/ # Data models
299
270
  ├── services/ # Core business logic
271
+ │ ├── gateway/ # MCP gateway service
272
+ │ ├── connection/ # Connection management
273
+ │ └── hub-tools/ # Hub tools service
300
274
  ├── utils/ # Utility functions
275
+ │ ├── logger/ # Logging utilities
276
+ │ └── transports/ # MCP transport implementations
301
277
  ├── config/ # Configuration
302
278
  ├── cli/ # CLI commands
279
+ │ └── commands/ # CLI command implementations
303
280
  ├── pid/ # Process ID management
304
281
  └── server/ # Server runtime
305
282
 
@@ -308,17 +285,21 @@ frontend/
308
285
  │ ├── components/ # Reusable UI components
309
286
  │ ├── views/ # Page view components
310
287
  │ ├── stores/ # Pinia state management
288
+ │ ├── composables/ # Vue composables
311
289
  │ ├── router/ # Vue Router configuration
312
- └── i18n/ # Internationalization
290
+ ├── i18n/ # Internationalization
291
+ │ └── types/ # Frontend type definitions
313
292
 
314
293
  shared/
315
294
  ├── models/ # Shared models
316
- └── types/ # Shared types
295
+ └── types/ # Shared types
317
296
 
318
297
  tests/
319
- ├── unit/ # Unit tests
320
- ├── integration/ # Integration tests
321
- └── contract/ # Contract tests
298
+ ├── unit/ # Unit tests
299
+ ├── integration/ # Integration tests
300
+ ├── contract/ # Contract tests
301
+ ├── helpers/ # Test helpers
302
+ └── types/ # Test types
322
303
  ```
323
304
 
324
305
  ### Adding New Features
@@ -329,14 +310,6 @@ tests/
329
310
  4. Write tests (tests/)
330
311
  5. Update configuration files
331
312
 
332
- ## Constraints and Limits
333
-
334
- - Maximum servers: 50
335
- - Maximum memory usage: 4GB
336
- - CPU usage threshold: 80%
337
- - Search response time: <500ms (90%)
338
- - Gateway latency: <100ms
339
-
340
313
  ## Detailed Technical Documentation
341
314
 
342
315
  Complete project architecture, constraints, and design decisions can be found in:
@@ -352,18 +325,3 @@ MIT
352
325
  Pull Requests and Issues are welcome!
353
326
 
354
327
  <!-- Badges -->
355
-
356
- [license-src]: https://img.shields.io/badge/license-MIT-080f12?style=flat&colorA=080f12&colorB=1fa669
357
- [license-href]: ./LICENSE
358
- [node-src]: https://img.shields.io/badge/Node.js-22.x-080f12?style=flat&logo=nodedotjs&logoColor=white&colorA=080f12&colorB=339933
359
- [node-href]: https://nodejs.org/
360
- [typescript-src]: https://img.shields.io/badge/TypeScript-5.x-080f12?style=flat&logo=typescript&logoColor=white&colorA=080f12&colorB=3178C6
361
- [typescript-href]: https://www.typescriptlang.org/
362
- [vitest-src]: https://img.shields.io/badge/Vitest-Testing-080f12?style=flat&logo=vitest&logoColor=white&colorA=080f12&colorB=6E9F18
363
- [vitest-href]: https://vitest.dev/
364
- [fastify-src]: https://img.shields.io/badge/Fastify-Web-080f12?style=flat&logo=fastify&logoColor=white&colorA=080f12&colorB=000000
365
- [fastify-href]: https://fastify.io/
366
- [vue-src]: https://img.shields.io/badge/Vue.js-3-080f12?style=flat&logo=vuedotjs&logoColor=white&colorA=080f12&colorB=4FC08D
367
- [vue-href]: https://vuejs.org/
368
- [claude-code-src]: https://img.shields.io/badge/Claude-Code-1fa669?style=flat&colorA=080f12&colorB=1fa669
369
- [claude-code-href]: https://claude.ai/code
@@ -1 +1 @@
1
- import{u as t}from"./index-vhkqgpmN.js";import{E as s}from"./index-C2V-ZGji.js";import{t as a,o as n,w as c,A as i,C as l,O as f,a1 as m,y as _}from"./vue-vendor-BLHLXXJK.js";import"./typescript-Bp3YSIOJ.js";const u={class:"flex w-full h-full"},d={class:"flex-1 h-full overflow-hidden bg-gray-50 dark:bg-[#0f172a] relative transition-colors duration-300"},k=a({__name:"HomeView",setup(p){const o=t();return n(()=>{o.fetchServers()}),c(()=>o.error,e=>{e&&s.error(e)}),(e,h)=>{const r=m("router-view");return _(),i("div",u,[l("main",d,[f(r)])])}}});export{k as default};
1
+ import{u as t}from"./index-CTB6oe-9.js";import{E as s}from"./index-ByNBhPAR.js";import{t as a,j as n,h as c,A as i,C as l,O as f,a1 as m,x as _}from"./vue-vendor-CbgVSHIh.js";import"./typescript-Bp3YSIOJ.js";const u={class:"flex w-full h-full"},d={class:"flex-1 h-full overflow-hidden bg-gray-50 dark:bg-[#0f172a] relative transition-colors duration-300"},k=a({__name:"HomeView",setup(p){const o=t();return n(()=>{o.fetchServers()}),c(()=>o.error,e=>{e&&s.error(e)}),(e,h)=>{const r=m("router-view");return _(),i("div",u,[l("main",d,[f(r)])])}}});export{k as default};
@@ -1 +1 @@
1
- import{u as T,H as I,h as O,aK as S,E as $,O as M,J as z,w as G}from"./index-vhkqgpmN.js";import{v as H}from"./el-loading-CIQ5pD5u.js";import{E as P,b as W}from"./el-radio-group-DhXWy7ry.js";import{t as F,a6 as J,c as f,a8 as K,r as g,o as Q,A as n,C as t,H as X,O as l,G as d,u as s,$ as o,a9 as x,a7 as Y,y as c}from"./vue-vendor-BLHLXXJK.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./event-BB_Ol6Sd.js";import"./omit-CqPQN3XP.js";import"./_baseClone-Bp9Rjwd7.js";const ee={class:"resource-detail py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden"},te={class:"flex items-center justify-between mb-6 shrink-0"},oe={class:"flex items-center gap-4"},se={class:"text-2xl font-bold text-gray-900 dark:text-white"},ae={class:"flex-1 flex flex-col gap-6 overflow-hidden"},le={class:"bg-white dark:bg-[#1e1e1e] rounded-lg shadow p-6 shrink-0 border border-gray-200 dark:border-gray-700"},re={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ne={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},ce={class:"font-mono text-sm break-all select-all"},ie={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},de={class:"font-mono text-sm"},ue={class:"md:col-span-2"},fe={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},me={class:"text-sm"},_e={class:"bg-white dark:bg-[#1e1e1e] rounded-lg shadow flex-1 flex flex-col overflow-hidden border border-gray-200 dark:border-gray-700"},ve={class:"px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center bg-gray-50 dark:bg-[#2d2d2d]"},pe={class:"font-medium"},he={class:"flex gap-2"},be={class:"flex-1 overflow-auto p-6 bg-gray-50 dark:bg-[#0f172a]"},ye={key:0,class:"h-full flex items-center justify-center text-gray-400"},ge={key:1,class:"h-full flex flex-col items-center justify-center text-red-500"},xe={key:2,class:"h-full"},we={key:0,class:"h-full"},ke={key:0,class:"h-full flex items-center justify-center"},Re=["src"],je={key:1,class:"bg-white dark:bg-[#1e1e1e] p-4 rounded shadow-sm h-full overflow-auto font-mono text-sm whitespace-pre-wrap"},Ce={key:1,class:"h-full"},Ve={class:"bg-gray-900 text-gray-100 p-4 rounded-lg h-full overflow-auto font-mono text-sm"},Be=F({__name:"ResourceDetailView",setup(Ee){const m=K(),U=Y(),D=T(),{t:r}=J(),V=f(()=>{const e=m.params.name;return e.startsWith("hub://")&&e.replace("hub://","").split("/")[1]||e}),w=f(()=>m.query.uri),B=f(()=>{if(m.query.name)return m.query.name;const e=m.query.uri;if(e){const i=e.split("/"),a=i[i.length-1];if(a&&a.length>0)return a}return"Unknown Resource"}),p=f(()=>m.query.mimeType||"application/octet-stream"),b=g(!1),y=g(null),_=g(null),k=g("preview"),E=f(()=>p.value.startsWith("image/")),R=f(()=>{if(!_.value)return"";const e=_.value;return e&&typeof e=="object"&&"text"in e&&typeof e.text=="string"?e.text:e&&typeof e=="object"&&"blob"in e?"[Binary Data]":""}),N=f(()=>{if(!E.value||!_.value)return"";const e=_.value;return e&&typeof e=="object"&&"blob"in e&&typeof e.blob=="string"?`data:${p.value};base64,${e.blob}`:""});function q(){U.back()}async function A(){b.value=!0,y.value=null;try{_.value=await D.readResource(V.value,w.value)}catch(e){y.value=e.message||"Failed to load resource content"}finally{b.value=!1}}function L(){const e=document.createElement("a"),i=new Blob([R.value],{type:p.value}),a=_.value;if(a&&typeof a=="object"&&"blob"in a&&typeof a.blob=="string"){const u=atob(a.blob),h=new Array(u.length);for(let v=0;v<u.length;v++)h[v]=u.charCodeAt(v);const j=new Uint8Array(h),C=new Blob([j],{type:p.value});e.href=URL.createObjectURL(C)}else e.href=URL.createObjectURL(i);e.download=B.value,document.body.appendChild(e),e.click(),document.body.removeChild(e)}return Q(()=>{w.value&&A()}),(e,i)=>{const a=O,u=$,h=W,j=P,C=H;return c(),n("div",ee,[t("div",te,[t("div",oe,[l(a,{icon:s(I),plain:"",onClick:q,class:"shrink-0"},{default:d(()=>[x(o(s(r)("action.back")),1)]),_:1},8,["icon"]),t("h2",se," Resource Details: "+o(B.value),1)])]),X((c(),n("div",ae,[t("div",le,[t("div",re,[t("div",null,[t("div",ne,o(s(r)("common.uri")),1),t("div",ce,o(w.value),1)]),t("div",null,[t("div",ie,o(s(r)("common.mimeType")),1),t("div",de,o(p.value),1)]),t("div",ue,[t("div",fe,o(s(r)("resources.server")),1),t("div",me,o(V.value),1)])])]),t("div",_e,[t("div",ve,[t("div",pe,o(s(r)("resources.contentPreview")),1),t("div",he,[l(j,{modelValue:k.value,"onUpdate:modelValue":i[0]||(i[0]=v=>k.value=v),size:"small"},{default:d(()=>[l(h,{value:"preview"},{default:d(()=>[l(u,{class:"mr-1"},{default:d(()=>[l(s(M))]),_:1}),x(" "+o(s(r)("resources.preview")),1)]),_:1}),l(h,{value:"source"},{default:d(()=>[l(u,{class:"mr-1"},{default:d(()=>[l(s(z))]),_:1}),x(" "+o(s(r)("resources.source")),1)]),_:1})]),_:1},8,["modelValue"]),l(a,{size:"small",icon:s(S),onClick:L},{default:d(()=>[x(o(s(r)("resources.download")),1)]),_:1},8,["icon"])])]),t("div",be,[b.value?(c(),n("div",ye,o(s(r)("resources.loadingContent")),1)):y.value?(c(),n("div",ge,[l(u,{class:"text-4xl mb-2"},{default:d(()=>[l(s(G))]),_:1}),t("div",null,o(y.value),1)])):(c(),n("div",xe,[k.value==="preview"?(c(),n("div",we,[E.value?(c(),n("div",ke,[t("img",{src:N.value,class:"max-w-full max-h-full object-contain rounded shadow-lg"},null,8,Re)])):(c(),n("div",je,o(R.value),1))])):(c(),n("div",Ce,[t("pre",Ve,[t("code",null,o(R.value),1)])]))]))])])])),[[C,b.value]])])}}}),Oe=Z(Be,[["__scopeId","data-v-a4e1dc63"]]);export{Oe as default};
1
+ import{u as T,H as I,h as O,aK as S,E as $,O as M,J as z,w as G}from"./index-CTB6oe-9.js";import{v as H}from"./el-loading-Dwl9E_Vr.js";import{E as P,b as W}from"./el-radio-group-D8aWBVOT.js";import{t as F,a6 as J,c as f,r as g,j as K,A as n,C as t,O as l,G as d,u as s,$ as o,H as Q,a8 as X,a9 as x,a7 as Y,x as c}from"./vue-vendor-CbgVSHIh.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./event-BB_Ol6Sd.js";import"./omit-CUnDT6sS.js";import"./_baseClone-DO5qfalW.js";const ee={class:"resource-detail py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden"},te={class:"flex items-center justify-between mb-6 shrink-0"},oe={class:"flex items-center gap-4"},se={class:"text-2xl font-bold text-gray-900 dark:text-white"},ae={class:"flex-1 flex flex-col gap-6 overflow-hidden"},le={class:"bg-white dark:bg-[#1e1e1e] rounded-lg shadow p-6 shrink-0 border border-gray-200 dark:border-gray-700"},re={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ne={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},ce={class:"font-mono text-sm break-all select-all"},ie={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},de={class:"font-mono text-sm"},ue={class:"md:col-span-2"},fe={class:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1"},me={class:"text-sm"},_e={class:"bg-white dark:bg-[#1e1e1e] rounded-lg shadow flex-1 flex flex-col overflow-hidden border border-gray-200 dark:border-gray-700"},ve={class:"px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center bg-gray-50 dark:bg-[#2d2d2d]"},pe={class:"font-medium"},he={class:"flex gap-2"},be={class:"flex-1 overflow-auto p-6 bg-gray-50 dark:bg-[#0f172a]"},ye={key:0,class:"h-full flex items-center justify-center text-gray-400"},ge={key:1,class:"h-full flex flex-col items-center justify-center text-red-500"},xe={key:2,class:"h-full"},we={key:0,class:"h-full"},ke={key:0,class:"h-full flex items-center justify-center"},Re=["src"],je={key:1,class:"bg-white dark:bg-[#1e1e1e] p-4 rounded shadow-sm h-full overflow-auto font-mono text-sm whitespace-pre-wrap"},Ce={key:1,class:"h-full"},Ve={class:"bg-gray-900 text-gray-100 p-4 rounded-lg h-full overflow-auto font-mono text-sm"},Be=F({__name:"ResourceDetailView",setup(Ee){const m=X(),U=Y(),D=T(),{t:r}=J(),V=f(()=>{const e=m.params.name;return e.startsWith("hub://")&&e.replace("hub://","").split("/")[1]||e}),w=f(()=>m.query.uri),B=f(()=>{if(m.query.name)return m.query.name;const e=m.query.uri;if(e){const i=e.split("/"),a=i[i.length-1];if(a&&a.length>0)return a}return"Unknown Resource"}),p=f(()=>m.query.mimeType||"application/octet-stream"),b=g(!1),y=g(null),_=g(null),k=g("preview"),E=f(()=>p.value.startsWith("image/")),R=f(()=>{if(!_.value)return"";const e=_.value;return e&&typeof e=="object"&&"text"in e&&typeof e.text=="string"?e.text:e&&typeof e=="object"&&"blob"in e?"[Binary Data]":""}),N=f(()=>{if(!E.value||!_.value)return"";const e=_.value;return e&&typeof e=="object"&&"blob"in e&&typeof e.blob=="string"?`data:${p.value};base64,${e.blob}`:""});function q(){U.back()}async function A(){b.value=!0,y.value=null;try{_.value=await D.readResource(V.value,w.value)}catch(e){y.value=e.message||"Failed to load resource content"}finally{b.value=!1}}function L(){const e=document.createElement("a"),i=new Blob([R.value],{type:p.value}),a=_.value;if(a&&typeof a=="object"&&"blob"in a&&typeof a.blob=="string"){const u=atob(a.blob),h=new Array(u.length);for(let v=0;v<u.length;v++)h[v]=u.charCodeAt(v);const j=new Uint8Array(h),C=new Blob([j],{type:p.value});e.href=URL.createObjectURL(C)}else e.href=URL.createObjectURL(i);e.download=B.value,document.body.appendChild(e),e.click(),document.body.removeChild(e)}return K(()=>{w.value&&A()}),(e,i)=>{const a=O,u=$,h=W,j=P,C=H;return c(),n("div",ee,[t("div",te,[t("div",oe,[l(a,{icon:s(I),plain:"",onClick:q,class:"shrink-0"},{default:d(()=>[x(o(s(r)("action.back")),1)]),_:1},8,["icon"]),t("h2",se," Resource Details: "+o(B.value),1)])]),Q((c(),n("div",ae,[t("div",le,[t("div",re,[t("div",null,[t("div",ne,o(s(r)("common.uri")),1),t("div",ce,o(w.value),1)]),t("div",null,[t("div",ie,o(s(r)("common.mimeType")),1),t("div",de,o(p.value),1)]),t("div",ue,[t("div",fe,o(s(r)("resources.server")),1),t("div",me,o(V.value),1)])])]),t("div",_e,[t("div",ve,[t("div",pe,o(s(r)("resources.contentPreview")),1),t("div",he,[l(j,{modelValue:k.value,"onUpdate:modelValue":i[0]||(i[0]=v=>k.value=v),size:"small"},{default:d(()=>[l(h,{value:"preview"},{default:d(()=>[l(u,{class:"mr-1"},{default:d(()=>[l(s(M))]),_:1}),x(" "+o(s(r)("resources.preview")),1)]),_:1}),l(h,{value:"source"},{default:d(()=>[l(u,{class:"mr-1"},{default:d(()=>[l(s(z))]),_:1}),x(" "+o(s(r)("resources.source")),1)]),_:1})]),_:1},8,["modelValue"]),l(a,{size:"small",icon:s(S),onClick:L},{default:d(()=>[x(o(s(r)("resources.download")),1)]),_:1},8,["icon"])])]),t("div",be,[b.value?(c(),n("div",ye,o(s(r)("resources.loadingContent")),1)):y.value?(c(),n("div",ge,[l(u,{class:"text-4xl mb-2"},{default:d(()=>[l(s(G))]),_:1}),t("div",null,o(y.value),1)])):(c(),n("div",xe,[k.value==="preview"?(c(),n("div",we,[E.value?(c(),n("div",ke,[t("img",{src:N.value,class:"max-w-full max-h-full object-contain rounded shadow-lg"},null,8,Re)])):(c(),n("div",je,o(R.value),1))])):(c(),n("div",Ce,[t("pre",Ve,[t("code",null,o(R.value),1)])]))]))])])])),[[C,b.value]])])}}}),Oe=Z(Be,[["__scopeId","data-v-a4e1dc63"]]);export{Oe as default};
@@ -1 +1 @@
1
- import{u as $,R as C,E,$ as T,J as V,h as B}from"./index-vhkqgpmN.js";import{a as z,b as L}from"./el-table-column-BMWOaLS_.js";import{E as I,a as N}from"./el-input-99gMrutP.js";import{t as S,r as f,o as j,c as q,A as h,C as a,$ as n,O as o,u,x as A,G as s,a9 as y,a7 as O,y as m}from"./vue-vendor-BLHLXXJK.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_baseClone-Bp9Rjwd7.js";import"./omit-CqPQN3XP.js";import"./event-BB_Ol6Sd.js";import"./raf-C2wXzaVU.js";import"./typescript-Bp3YSIOJ.js";const F={class:"resources-view py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden bg-gray-50 dark:bg-[#0f172a] transition-colors duration-300"},G={class:"mb-6 shrink-0"},J={class:"text-2xl font-semibold text-gray-900 dark:text-white mb-4"},M={class:"relative"},P={class:"flex-1 overflow-y-auto custom-scrollbar space-y-4 pr-2"},Q={key:0,class:"flex flex-col items-center justify-center py-12 text-gray-400"},U={class:"flex items-center gap-2"},H=["title"],K=["title"],W=S({__name:"ResourcesView",setup(X){const b=O(),v=$(),c=f(""),d=f({});j(async()=>{await w()});async function w(){try{d.value=await v.fetchAllResources()}catch(e){console.error("Failed to load resources:",e)}}const p=q(()=>{const e=[];for(const[,l]of Object.entries(d.value))e.push(...l);if(!c.value)return e;const r=c.value.toLowerCase();return e.filter(l=>l.name.toLowerCase().includes(r)||l.uri.toLowerCase().includes(r))});function x(e){b.push({name:"resource-detail",params:{name:e.uri},query:{uri:e.uri,name:e.name,mimeType:e.mimeType}})}return(e,r)=>{const l=I,_=E,i=L,g=N,k=B,R=z;return m(),h("div",F,[a("div",G,[a("h2",J,n(e.$t("resources.title")),1),a("div",M,[o(l,{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=t=>c.value=t),placeholder:e.$t("resources.searchPlaceholder"),class:"w-full",size:"large","prefix-icon":u(C),clearable:""},null,8,["modelValue","placeholder","prefix-icon"])])]),a("div",P,[p.value.length===0?(m(),h("div",Q,[o(_,{size:48,class:"mb-4 opacity-50"},{default:s(()=>[o(u(T))]),_:1}),a("p",null,n(e.$t("resources.noResources")),1)])):(m(),A(R,{key:1,data:p.value,style:{width:"100%"},class:"custom-table"},{default:s(()=>[o(i,{prop:"name",label:e.$t("common.name"),"min-width":"350"},{default:s(({row:t})=>[a("div",U,[o(_,null,{default:s(()=>[o(u(V))]),_:1}),a("span",{class:"font-medium truncate",title:t.name},n(t.name),9,H)])]),_:1},8,["label"]),o(i,{prop:"uri",label:e.$t("common.uri"),"min-width":"350"},{default:s(({row:t})=>[a("span",{class:"truncate block",title:t.uri},n(t.uri),9,K)]),_:1},8,["label"]),o(i,{prop:"mimeType",label:e.$t("common.mimeType"),width:"180"},{default:s(({row:t})=>[o(g,{size:"small",type:"success",effect:"plain"},{default:s(()=>[y(n(t.mimeType||"unknown"),1)]),_:2},1024)]),_:1},8,["label"]),o(i,{label:"",width:"100",align:"right"},{default:s(({row:t})=>[o(k,{size:"small",plain:"",onClick:Y=>x(t)},{default:s(()=>[y(n(e.$t("action.view")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]))])])}}}),ie=D(W,[["__scopeId","data-v-8388c5cb"]]);export{ie as default};
1
+ import{u as $,R as C,E,$ as T,J as V,h as B}from"./index-CTB6oe-9.js";import{a as z,b as L}from"./el-table-column-Cog6uCh-.js";import{E as j,a as I}from"./el-input-tYgeiaCT.js";import{t as N,r as f,j as S,c as q,A as h,C as a,$ as n,O as o,u,G as s,y as A,a9 as y,a7 as O,x as m}from"./vue-vendor-CbgVSHIh.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_baseClone-DO5qfalW.js";import"./omit-CUnDT6sS.js";import"./event-BB_Ol6Sd.js";import"./raf-CmzeRPMd.js";import"./typescript-Bp3YSIOJ.js";const F={class:"resources-view py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden bg-gray-50 dark:bg-[#0f172a] transition-colors duration-300"},G={class:"mb-6 shrink-0"},J={class:"text-2xl font-semibold text-gray-900 dark:text-white mb-4"},M={class:"relative"},P={class:"flex-1 overflow-y-auto custom-scrollbar space-y-4 pr-2"},Q={key:0,class:"flex flex-col items-center justify-center py-12 text-gray-400"},U={class:"flex items-center gap-2"},H=["title"],K=["title"],W=N({__name:"ResourcesView",setup(X){const b=O(),v=$(),c=f(""),d=f({});S(async()=>{await w()});async function w(){try{d.value=await v.fetchAllResources()}catch(e){console.error("Failed to load resources:",e)}}const p=q(()=>{const e=[];for(const[,l]of Object.entries(d.value))e.push(...l);if(!c.value)return e;const r=c.value.toLowerCase();return e.filter(l=>l.name.toLowerCase().includes(r)||l.uri.toLowerCase().includes(r))});function x(e){b.push({name:"resource-detail",params:{name:e.uri},query:{uri:e.uri,name:e.name,mimeType:e.mimeType}})}return(e,r)=>{const l=j,_=E,i=L,g=I,k=B,R=z;return m(),h("div",F,[a("div",G,[a("h2",J,n(e.$t("resources.title")),1),a("div",M,[o(l,{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=t=>c.value=t),placeholder:e.$t("resources.searchPlaceholder"),class:"w-full",size:"large","prefix-icon":u(C),clearable:""},null,8,["modelValue","placeholder","prefix-icon"])])]),a("div",P,[p.value.length===0?(m(),h("div",Q,[o(_,{size:48,class:"mb-4 opacity-50"},{default:s(()=>[o(u(T))]),_:1}),a("p",null,n(e.$t("resources.noResources")),1)])):(m(),A(R,{key:1,data:p.value,style:{width:"100%"},class:"custom-table"},{default:s(()=>[o(i,{prop:"name",label:e.$t("common.name"),"min-width":"350"},{default:s(({row:t})=>[a("div",U,[o(_,null,{default:s(()=>[o(u(V))]),_:1}),a("span",{class:"font-medium truncate",title:t.name},n(t.name),9,H)])]),_:1},8,["label"]),o(i,{prop:"uri",label:e.$t("common.uri"),"min-width":"350"},{default:s(({row:t})=>[a("span",{class:"truncate block",title:t.uri},n(t.uri),9,K)]),_:1},8,["label"]),o(i,{prop:"mimeType",label:e.$t("common.mimeType"),width:"180"},{default:s(({row:t})=>[o(g,{size:"small",type:"success",effect:"plain"},{default:s(()=>[y(n(t.mimeType||"unknown"),1)]),_:2},1024)]),_:1},8,["label"]),o(i,{label:"",width:"100",align:"right"},{default:s(({row:t})=>[o(k,{size:"small",plain:"",onClick:Y=>x(t)},{default:s(()=>[y(n(e.$t("action.view")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]))])])}}}),ie=D(W,[["__scopeId","data-v-8388c5cb"]]);export{ie as default};
@@ -1 +1 @@
1
- import{u as y,a as E,E as $,i as D,c as g,w as x,v as I}from"./index-vhkqgpmN.js";import{E as N,a as A}from"./el-skeleton-item-DJz-Us12.js";import{f as V}from"./ServerStatusTags.vue_vue_type_script_setup_true_lang-D-ooYNdN.js";import{t as v,r as B,o as z,w as b,c as L,A as n,C as t,$ as s,u as d,O as l,G as h,U as T,P as O,af as j,y as a,x as p,V as F,J as G,n as H}from"./vue-vendor-BLHLXXJK.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";import M from"./ServerDetail-BKV-M4qT.js";import"./el-tab-pane-BnGMaV56.js";import"./raf-C2wXzaVU.js";import"./typescript-Bp3YSIOJ.js";import"./el-overlay-BVM6msGX.js";import"./event-BB_Ol6Sd.js";import"./el-input-99gMrutP.js";import"./omit-CqPQN3XP.js";import"./_baseClone-Bp9Rjwd7.js";import"./el-switch-Bu8AQ5uM.js";import"./el-radio-group-DhXWy7ry.js";import"./el-table-column-BMWOaLS_.js";import"./index-C2V-ZGji.js";import"./ToolCallDialog-Bf4Xe4gH.js";const P={class:"dashboard py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden transition-colors duration-300"},U={class:"text-2xl font-semibold text-gray-900 dark:text-white mb-6 shrink-0"},W={key:0,class:"grid grid-cols-3 gap-6 mb-8 shrink-0"},q={class:"p-6 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-[#1e293b] h-32"},K={key:1,class:"grid grid-cols-3 gap-6 mb-8 shrink-0"},Q={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},R={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},X={class:"text-4xl font-bold text-gray-900 dark:text-white"},Y={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},Z={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},tt={class:"text-4xl font-bold text-gray-900 dark:text-white"},et={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},rt={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},st={class:"text-4xl font-bold text-red-500"},at={class:"activity-section bg-white dark:bg-[#1e293b] rounded-xl border border-gray-200 dark:border-gray-700 flex flex-col flex-1 min-h-0 shadow-sm transition-colors duration-300"},ot={class:"p-4 border-b border-gray-200 dark:border-gray-700"},it={class:"text-lg font-medium text-gray-900 dark:text-white"},nt={class:"flex items-center gap-2 mb-1"},dt={class:"font-medium text-gray-700 dark:text-gray-200"},lt={class:"text-xs text-gray-400 ml-auto"},ct={class:"text-sm text-gray-600 dark:text-gray-400 font-mono pl-6 break-words"},mt={key:0,class:"flex flex-col items-center justify-center h-full text-gray-400 dark:text-gray-500"},ut=v({__name:"DashboardView",setup(k){const e=y();E();const c=B(null);z(()=>{!e.loading&&e.servers.length>0&&e.fetchAllLogs()}),b(()=>e.loading,r=>{!r&&e.servers.length>0&&e.fetchAllLogs()});const u=L(()=>{const r=[];return e.servers.forEach(o=>{o.logs.forEach((i,_)=>{r.push({serverName:o.name,serverStatus:o.status,message:i.message,time:V(i.timestamp),timestamp:i.timestamp,originalIndex:_})})}),r.sort((o,i)=>o.timestamp-i.timestamp)});b(()=>u.value.length,()=>{H(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)})});function w(r){switch(r){case"online":return I;case"offline":return g;case"stopping":return g;case"error":return x;case"starting":return x;default:return g}}function S(r){switch(r){case"online":return"text-green-500";case"offline":return"text-gray-400";case"stopping":return"text-gray-400";case"error":return"text-yellow-500";case"starting":return"text-yellow-500";default:return"text-gray-400"}}return(r,o)=>{const i=A,_=N,f=$;return a(),n("div",P,[t("h2",U,s(r.$t("dashboard.title")),1),d(e).loading&&d(e).servers.length===0?(a(),n("div",W,[l(_,{animated:"",count:3,class:"w-full h-full"},{template:h(()=>[t("div",q,[l(i,{variant:"text",style:{width:"30%"},class:"mb-2"}),l(i,{variant:"h1",style:{width:"50%"}})])]),_:1})])):(a(),n("div",K,[t("div",Q,[t("div",R,s(r.$t("dashboard.totalServers")),1),t("div",X,s(d(e).stats.total),1)]),t("div",Y,[t("div",Z,s(r.$t("dashboard.running")),1),t("div",tt,s(d(e).stats.online),1)]),t("div",et,[t("div",rt,s(r.$t("dashboard.errors")),1),t("div",st,s(d(e).stats.errors),1)])])),t("div",at,[t("div",ot,[t("h3",it,s(r.$t("dashboard.recentActivity")),1)]),t("div",{ref_key:"activityContainer",ref:c,class:"p-4 overflow-y-auto flex-1 custom-scrollbar"},[(a(!0),n(O,null,j(u.value,(m,C)=>(a(),n("div",{key:C,class:"activity-item mb-4 pb-4 border-b border-gray-100 dark:border-gray-700/50 last:border-0"},[t("div",nt,[l(f,{size:16,class:G(S(m.serverStatus))},{default:h(()=>[(a(),p(F(w(m.serverStatus))))]),_:2},1032,["class"]),t("span",dt,s(m.serverName),1),t("span",lt,s(m.time),1)]),t("div",ct,s(m.message),1)]))),128)),u.value.length===0?(a(),n("div",mt,[l(f,{size:40,class:"mb-2 opacity-50"},{default:h(()=>[l(d(D))]),_:1}),o[0]||(o[0]=t("span",null,"No recent activity",-1))])):T("",!0)],512)])])}}}),_t=J(ut,[["__scopeId","data-v-37e9c2c3"]]),gt={class:"h-full w-full"},zt=v({__name:"ServerDashboard",setup(k){const e=y();return(c,u)=>(a(),n("div",gt,[d(e).selectedServerId?(a(),p(M,{key:1})):(a(),p(_t,{key:0}))]))}});export{zt as default};
1
+ import{u as y,a as E,i as $,E as D,c as g,w as x,v as I}from"./index-CTB6oe-9.js";import{E as N,a as A}from"./el-skeleton-item-BRwIFspE.js";import{f as V}from"./ServerStatusTags.vue_vue_type_script_setup_true_lang-BHhwEuGe.js";import{t as v,r as B,j as z,h as b,c as L,A as n,C as t,$ as s,u as d,O as l,G as h,P as T,af as j,V as O,x as a,y as p,U as F,J as G,n as H}from"./vue-vendor-CbgVSHIh.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";import M from"./ServerDetail-BLQ-a4cO.js";import"./el-tab-pane-C4Ep94cd.js";import"./raf-CmzeRPMd.js";import"./typescript-Bp3YSIOJ.js";import"./el-overlay-kqX_BABo.js";import"./event-BB_Ol6Sd.js";import"./el-input-tYgeiaCT.js";import"./omit-CUnDT6sS.js";import"./_baseClone-DO5qfalW.js";import"./el-switch-BF8c-xeU.js";import"./el-radio-group-D8aWBVOT.js";import"./el-table-column-Cog6uCh-.js";import"./index-ByNBhPAR.js";import"./ToolCallDialog-BfPjLxfV.js";const P={class:"dashboard py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden transition-colors duration-300"},U={class:"text-2xl font-semibold text-gray-900 dark:text-white mb-6 shrink-0"},W={key:0,class:"grid grid-cols-3 gap-6 mb-8 shrink-0"},q={class:"p-6 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-[#1e293b] h-32"},K={key:1,class:"grid grid-cols-3 gap-6 mb-8 shrink-0"},Q={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},R={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},X={class:"text-4xl font-bold text-gray-900 dark:text-white"},Y={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},Z={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},tt={class:"text-4xl font-bold text-gray-900 dark:text-white"},et={class:"stat-card bg-white dark:bg-[#1e293b] p-6 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm transition-colors duration-300"},rt={class:"text-gray-500 dark:text-gray-400 text-sm mb-2"},st={class:"text-4xl font-bold text-red-500"},at={class:"activity-section bg-white dark:bg-[#1e293b] rounded-xl border border-gray-200 dark:border-gray-700 flex flex-col flex-1 min-h-0 shadow-sm transition-colors duration-300"},ot={class:"p-4 border-b border-gray-200 dark:border-gray-700"},it={class:"text-lg font-medium text-gray-900 dark:text-white"},nt={class:"flex items-center gap-2 mb-1"},dt={class:"font-medium text-gray-700 dark:text-gray-200"},lt={class:"text-xs text-gray-400 ml-auto"},ct={class:"text-sm text-gray-600 dark:text-gray-400 font-mono pl-6 break-words"},mt={key:0,class:"flex flex-col items-center justify-center h-full text-gray-400 dark:text-gray-500"},ut=v({__name:"DashboardView",setup(k){const e=y();E();const c=B(null);z(()=>{!e.loading&&e.servers.length>0&&e.fetchAllLogs()}),b(()=>e.loading,r=>{!r&&e.servers.length>0&&e.fetchAllLogs()});const u=L(()=>{const r=[];return e.servers.forEach(o=>{o.logs.forEach((i,_)=>{r.push({serverName:o.name,serverStatus:o.status,message:i.message,time:V(i.timestamp),timestamp:i.timestamp,originalIndex:_})})}),r.sort((o,i)=>o.timestamp-i.timestamp)});b(()=>u.value.length,()=>{H(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)})});function w(r){switch(r){case"online":return I;case"offline":return g;case"stopping":return g;case"error":return x;case"starting":return x;default:return g}}function S(r){switch(r){case"online":return"text-green-500";case"offline":return"text-gray-400";case"stopping":return"text-gray-400";case"error":return"text-yellow-500";case"starting":return"text-yellow-500";default:return"text-gray-400"}}return(r,o)=>{const i=N,_=A,f=D;return a(),n("div",P,[t("h2",U,s(r.$t("dashboard.title")),1),d(e).loading&&d(e).servers.length===0?(a(),n("div",W,[l(_,{animated:"",count:3,class:"w-full h-full"},{template:h(()=>[t("div",q,[l(i,{variant:"text",style:{width:"30%"},class:"mb-2"}),l(i,{variant:"h1",style:{width:"50%"}})])]),_:1})])):(a(),n("div",K,[t("div",Q,[t("div",R,s(r.$t("dashboard.totalServers")),1),t("div",X,s(d(e).stats.total),1)]),t("div",Y,[t("div",Z,s(r.$t("dashboard.running")),1),t("div",tt,s(d(e).stats.online),1)]),t("div",et,[t("div",rt,s(r.$t("dashboard.errors")),1),t("div",st,s(d(e).stats.errors),1)])])),t("div",at,[t("div",ot,[t("h3",it,s(r.$t("dashboard.recentActivity")),1)]),t("div",{ref_key:"activityContainer",ref:c,class:"p-4 overflow-y-auto flex-1 custom-scrollbar"},[(a(!0),n(T,null,j(u.value,(m,C)=>(a(),n("div",{key:C,class:"activity-item mb-4 pb-4 border-b border-gray-100 dark:border-gray-700/50 last:border-0"},[t("div",nt,[l(f,{size:16,class:G(S(m.serverStatus))},{default:h(()=>[(a(),p(F(w(m.serverStatus))))]),_:2},1032,["class"]),t("span",dt,s(m.serverName),1),t("span",lt,s(m.time),1)]),t("div",ct,s(m.message),1)]))),128)),u.value.length===0?(a(),n("div",mt,[l(f,{size:40,class:"mb-2 opacity-50"},{default:h(()=>[l(d($))]),_:1}),o[0]||(o[0]=t("span",null,"No recent activity",-1))])):O("",!0)],512)])])}}}),_t=J(ut,[["__scopeId","data-v-37e9c2c3"]]),gt={class:"h-full w-full"},zt=v({__name:"ServerDashboard",setup(k){const e=y();return(c,u)=>(a(),n("div",gt,[d(e).selectedServerId?(a(),p(M,{key:1})):(a(),p(_t,{key:0}))]))}});export{zt as default};