@loop_ouroboros/mcp-hub-lite 1.2.3 → 1.2.5
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.
- package/CHANGELOG.md +36 -0
- package/dist/client/assets/{HomeView-V1fKvWQ8.js → HomeView-BnO4yIT9.js} +1 -1
- package/dist/client/assets/{ResourceDetailView-DHGHssrh.js → ResourceDetailView-BGBtmsyc.js} +1 -1
- package/dist/client/assets/{ResourcesView-B1bvkmQD.js → ResourcesView-B5Xg0ynh.js} +1 -1
- package/dist/client/assets/{ServerDashboard-CZCByd7y.js → ServerDashboard-DYAVrrUk.js} +1 -1
- package/dist/client/assets/{ServerDetail-CI5UD8gj.js → ServerDetail-q94ZFfjL.js} +1 -1
- package/dist/client/assets/ServerListView-C7kcd4GC.js +36 -0
- package/dist/client/assets/{ServerListView-B-bPljsO.css → ServerListView-DshgDGSc.css} +1 -1
- package/dist/client/assets/{SettingsView-C-ae0-zz.js → SettingsView-BM6P5yrT.js} +1 -1
- package/dist/client/assets/{ToolCallDialog-BudOyGvS.js → ToolCallDialog-BoAGxlB5.js} +1 -1
- package/dist/client/assets/{ToolsView-CbQkgTAu.js → ToolsView-lqFhr7Bk.js} +1 -1
- package/dist/client/assets/{_baseClone-e9R6V78L.js → _baseClone-kbJbcBJT.js} +1 -1
- package/dist/client/assets/{el-form-item-Dyx5MiWB.js → el-form-item-iQ0G8e97.js} +1 -1
- package/dist/client/assets/{el-input-CL9HPfdW.js → el-input-DkJq57wP.js} +1 -1
- package/dist/client/assets/{el-loading-2TW6JdfY.js → el-loading-C3v6a9xV.js} +1 -1
- package/dist/client/assets/{el-overlay-B5ZGCmXY.js → el-overlay-Cy5xg31y.js} +1 -1
- package/dist/client/assets/{el-radio-group-Cr2ScjjJ.js → el-radio-group-C9QUL5mm.js} +1 -1
- package/dist/client/assets/{el-skeleton-item-CdAfEgVR.js → el-skeleton-item-Bbmpc0Xz.js} +1 -1
- package/dist/client/assets/{el-switch-DnN1s0Wb.js → el-switch-KpjV93lm.js} +1 -1
- package/dist/client/assets/{el-tab-pane-BebZh0XF.js → el-tab-pane-YsYuBcem.js} +1 -1
- package/dist/client/assets/{el-table-column-CV2zp3yI.js → el-table-column-fofd_2n-.js} +1 -1
- package/dist/client/assets/{index-Ci5n5dA9.js → index-5tzIwwtS.js} +1 -1
- package/dist/client/assets/{index-DTZ9o3XO.js → index-MqHvQjDP.js} +2 -2
- package/dist/client/assets/{omit-DlmW8Yd6.js → omit-CB4hTeTH.js} +1 -1
- package/dist/client/assets/{raf-CeCd08aN.js → raf-MWAHt9ca.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/src/api/web/hub-tools.d.ts.map +1 -1
- package/dist/server/src/api/web/hub-tools.js +15 -0
- package/dist/server/src/api/web/mcp-status.d.ts.map +1 -1
- package/dist/server/src/api/web/mcp-status.js +4 -0
- package/dist/server/src/cli/commands/status.js +13 -3
- package/dist/server/src/cli/commands/tool-use.d.ts +5 -1
- package/dist/server/src/cli/commands/tool-use.d.ts.map +1 -1
- package/dist/server/src/cli/commands/tool-use.js +27 -4
- package/dist/server/src/cli/server.d.ts +2 -0
- package/dist/server/src/cli/server.d.ts.map +1 -1
- package/dist/server/src/cli/server.js +2 -0
- package/dist/server/src/models/system-tools.constants.d.ts +6 -2
- package/dist/server/src/models/system-tools.constants.d.ts.map +1 -1
- package/dist/server/src/models/system-tools.constants.js +3 -1
- package/dist/server/src/services/gateway/request-handlers/system-tools-handler.d.ts.map +1 -1
- package/dist/server/src/services/gateway/request-handlers/system-tools-handler.js +28 -1
- package/dist/server/src/services/gateway/tool-list-generator.js +1 -1
- package/dist/server/src/services/hub-tools/instance-selector.js +1 -1
- package/dist/server/src/services/hub-tools/resource-generator.d.ts.map +1 -1
- package/dist/server/src/services/hub-tools/resource-generator.js +32 -13
- package/dist/server/src/services/hub-tools/server-selector.d.ts +2 -2
- package/dist/server/src/services/hub-tools/server-selector.d.ts.map +1 -1
- package/dist/server/src/services/hub-tools/server-selector.js +4 -3
- package/dist/server/src/services/hub-tools/system-tool-definitions.d.ts.map +1 -1
- package/dist/server/src/services/hub-tools/system-tool-definitions.js +23 -3
- package/dist/server/src/services/hub-tools.service.d.ts +29 -7
- package/dist/server/src/services/hub-tools.service.d.ts.map +1 -1
- package/dist/server/src/services/hub-tools.service.js +80 -33
- package/dist/server/src/services/system-tool-handler.d.ts.map +1 -1
- package/dist/server/src/services/system-tool-handler.js +21 -8
- package/dist/server/src/utils/name-converter.d.ts.map +1 -1
- package/dist/server/src/utils/name-converter.js +2 -0
- package/dist/server/tests/unit/services/hub-tools.service.test.js +6 -5
- package/package.json +1 -1
- package/dist/client/assets/ServerListView-D8qv-xYg.js +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as c,bw as f,bs as s,bx as a,bq as l,by as g,ah as b}from"./index-
|
|
1
|
+
import{aa as c,bw as f,bs as s,bx as a,bq as l,by as g,ah as b}from"./index-MqHvQjDP.js";import{g as v,c as O,f as _,e as p}from"./_baseClone-kbJbcBJT.js";var y="[object Object]",P=Function.prototype,L=Object.prototype,u=P.toString,w=L.hasOwnProperty,h=u.call(Object);function j(e){if(!c(e)||f(e)!=y)return!1;var r=v(e);if(r===null)return!0;var t=w.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&u.call(t)==h}function m(e,r,t){var o=-1,n=e.length;r<0&&(r=-r>n?0:n+r),t=t>n?n:t,t<0&&(t+=n),n=r>t?0:t-r>>>0,r>>>=0;for(var i=Array(n);++o<n;)i[o]=e[o+r];return i}function C(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}function A(e,r){return r.length<2?e:s(e,m(r,0,-1))}var S=Object.prototype,E=S.hasOwnProperty;function F(e,r){r=a(r,e);var t=-1,o=r.length;if(!o)return!0;for(;++t<o;){var n=l(r[t]);if(n==="__proto__"&&!E.call(e,"__proto__")||(n==="constructor"||n==="prototype")&&t<o-1)return!1}var i=A(e,r);return i==null||delete i[l(C(r))]}function G(e){return j(e)?void 0:e}var x=1,T=2,N=4,M=g(function(e,r){var t={};if(e==null)return t;var o=!1;r=b(r,function(i){return i=a(i,e),o||(o=i.length>1),i}),O(e,_(e),t),o&&(t=p(t,x|T|N,G));for(var n=r.length;n--;)F(t,r[n]);return t});export{j as i,M as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o}from"./index-
|
|
1
|
+
import{D as o}from"./index-MqHvQjDP.js";const e=i=>o?window.requestAnimationFrame(i):setTimeout(i,16),r=i=>o?window.cancelAnimationFrame(i):clearTimeout(i);export{r as c,e as r};
|
package/dist/client/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCP Server Manager</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-MqHvQjDP.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-CbgVSHIh.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DpH6ZSbs.css">
|
|
11
11
|
</head>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-tools.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/hub-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hub-tools.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/hub-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAqB1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,eAAe,iBAuK/D"}
|
|
@@ -77,6 +77,21 @@ export async function webHubToolsRoutes(fastify) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
+
// GET /web/hub-tools/servers/:serverName/tags - List all instance tags for a specific server
|
|
81
|
+
fastify.get('/web/hub-tools/servers/:serverName/tags', async (request, reply) => {
|
|
82
|
+
try {
|
|
83
|
+
const { serverName } = request.params;
|
|
84
|
+
const params = { serverName };
|
|
85
|
+
const result = await hubToolsService.listTags(params);
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return reply.code(404).send({
|
|
90
|
+
error: 'Server not found',
|
|
91
|
+
message: error instanceof Error ? error.message : 'Unknown error'
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
80
95
|
// GET /web/hub-tools/servers/:serverName/tools/:toolName - Get specific tool details
|
|
81
96
|
fastify.get('/web/hub-tools/servers/:serverName/tools/:toolName', async (request, reply) => {
|
|
82
97
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-status.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/mcp-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"mcp-status.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/mcp-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,eAAe,iBA6KhE"}
|
|
@@ -43,6 +43,8 @@ export async function webMcpStatusRoutes(fastify) {
|
|
|
43
43
|
id: server.name,
|
|
44
44
|
name: server.name,
|
|
45
45
|
type: server.config.template.type,
|
|
46
|
+
displayName: undefined,
|
|
47
|
+
tags: {},
|
|
46
48
|
status: {
|
|
47
49
|
connected: false,
|
|
48
50
|
lastCheck: Date.now(),
|
|
@@ -60,6 +62,8 @@ export async function webMcpStatusRoutes(fastify) {
|
|
|
60
62
|
id: instance.id || '',
|
|
61
63
|
name: server.name,
|
|
62
64
|
type: resolvedConfig?.type || server.config.template.type,
|
|
65
|
+
displayName: instance.displayName,
|
|
66
|
+
tags: instance.tags,
|
|
63
67
|
status: mcpConnectionManager.getStatus(server.name, instance.index ?? 0) || {
|
|
64
68
|
connected: false,
|
|
65
69
|
lastCheck: Date.now(),
|
|
@@ -97,16 +97,24 @@ function printFormattedStatus(status) {
|
|
|
97
97
|
let maxNameLen = 'Server Name'.length;
|
|
98
98
|
let maxTypeLen = 'Type'.length;
|
|
99
99
|
const maxStatusLen = 'Disconnected'.length;
|
|
100
|
+
let maxDisplayNameLen = 'DisplayName'.length;
|
|
101
|
+
let maxTagsLen = 'Tags'.length;
|
|
100
102
|
for (const server of servers) {
|
|
101
103
|
maxNameLen = Math.max(maxNameLen, (server.name || '').length);
|
|
102
104
|
maxTypeLen = Math.max(maxTypeLen, (server.type || '').length);
|
|
105
|
+
const displayName = server.displayName || '';
|
|
106
|
+
const tags = JSON.stringify(server.tags || {});
|
|
107
|
+
maxDisplayNameLen = Math.max(maxDisplayNameLen, displayName.length);
|
|
108
|
+
maxTagsLen = Math.max(maxTagsLen, tags.length);
|
|
103
109
|
}
|
|
104
110
|
// Simple table without complex borders
|
|
105
111
|
const headerName = 'Server Name'.padEnd(maxNameLen);
|
|
106
112
|
const headerType = 'Type'.padEnd(maxTypeLen);
|
|
107
113
|
const headerStatus = 'Status'.padEnd(maxStatusLen);
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
const headerDisplayName = 'DisplayName'.padEnd(maxDisplayNameLen);
|
|
115
|
+
const headerTags = 'Tags'.padEnd(maxTagsLen);
|
|
116
|
+
console.log(`${cyan}${headerName} ${headerType} ${headerStatus} Tools Resources ${headerDisplayName} ${headerTags}${reset}`);
|
|
117
|
+
console.log(`${dim}${'─'.repeat(maxNameLen + maxTypeLen + maxStatusLen + 26 + maxDisplayNameLen + maxTagsLen)}${reset}`);
|
|
110
118
|
for (const server of servers) {
|
|
111
119
|
const name = (server.name || '').padEnd(maxNameLen);
|
|
112
120
|
const type = (server.type || '').padEnd(maxTypeLen);
|
|
@@ -115,7 +123,9 @@ function printFormattedStatus(status) {
|
|
|
115
123
|
: `${red}Disconnected${reset}`.padEnd(maxStatusLen + 9);
|
|
116
124
|
const tools = server.toolsCount.toString().padStart(5);
|
|
117
125
|
const resources = server.resourcesCount.toString().padStart(9);
|
|
118
|
-
|
|
126
|
+
const displayName = (server.displayName || '').padEnd(maxDisplayNameLen);
|
|
127
|
+
const tags = JSON.stringify(server.tags || {}).padEnd(maxTagsLen);
|
|
128
|
+
console.log(`${name} ${type} ${statusText} ${tools} ${resources} ${displayName} ${tags}`);
|
|
119
129
|
if (server.error) {
|
|
120
130
|
console.log(` ${red}Error: ${server.error}${reset}`);
|
|
121
131
|
}
|
|
@@ -3,7 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
* CLI command for dynamic MCP server tool operations via API.
|
|
4
4
|
*
|
|
5
5
|
* This command provides a simplified CLI interface for interacting with MCP server tools,
|
|
6
|
-
* supporting
|
|
6
|
+
* supporting five actions: list-servers, list-tools, list-tags, get-tool, and call-tool. It wraps
|
|
7
7
|
* the HTTP API endpoints and requires the MCP Hub Lite server to be running.
|
|
8
8
|
*
|
|
9
9
|
* ## Command Format
|
|
@@ -21,6 +21,7 @@ import { Command } from 'commander';
|
|
|
21
21
|
*
|
|
22
22
|
* - `list-servers` - List all connected MCP servers
|
|
23
23
|
* - `list-tools` - List all tools from the specified server
|
|
24
|
+
* - `list-tags` - List all instance tags for a specific MCP server
|
|
24
25
|
* - `get-tool` - Get complete schema for a specific tool (requires --tool)
|
|
25
26
|
* - `call-tool` - Call a tool on the specified server (requires --tool)
|
|
26
27
|
*
|
|
@@ -55,6 +56,9 @@ import { Command } from 'commander';
|
|
|
55
56
|
* # List third-party server tools
|
|
56
57
|
* mcp-hub-lite tool-use list-tools --server baidu-search
|
|
57
58
|
*
|
|
59
|
+
* # List instance tags for a server
|
|
60
|
+
* mcp-hub-lite tool-use list-tags --server chrome-devtools
|
|
61
|
+
*
|
|
58
62
|
* # Get system tool schema
|
|
59
63
|
* mcp-hub-lite tool-use get-tool --tool list_tools --server mcp-hub-lite
|
|
60
64
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-use.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/tool-use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC
|
|
1
|
+
{"version":3,"file":"tool-use.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/tool-use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,eAAO,MAAM,cAAc,SAkNvB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { getServerStatus } from '../server.js';
|
|
|
4
4
|
* CLI command for dynamic MCP server tool operations via API.
|
|
5
5
|
*
|
|
6
6
|
* This command provides a simplified CLI interface for interacting with MCP server tools,
|
|
7
|
-
* supporting
|
|
7
|
+
* supporting five actions: list-servers, list-tools, list-tags, get-tool, and call-tool. It wraps
|
|
8
8
|
* the HTTP API endpoints and requires the MCP Hub Lite server to be running.
|
|
9
9
|
*
|
|
10
10
|
* ## Command Format
|
|
@@ -22,6 +22,7 @@ import { getServerStatus } from '../server.js';
|
|
|
22
22
|
*
|
|
23
23
|
* - `list-servers` - List all connected MCP servers
|
|
24
24
|
* - `list-tools` - List all tools from the specified server
|
|
25
|
+
* - `list-tags` - List all instance tags for a specific MCP server
|
|
25
26
|
* - `get-tool` - Get complete schema for a specific tool (requires --tool)
|
|
26
27
|
* - `call-tool` - Call a tool on the specified server (requires --tool)
|
|
27
28
|
*
|
|
@@ -56,6 +57,9 @@ import { getServerStatus } from '../server.js';
|
|
|
56
57
|
* # List third-party server tools
|
|
57
58
|
* mcp-hub-lite tool-use list-tools --server baidu-search
|
|
58
59
|
*
|
|
60
|
+
* # List instance tags for a server
|
|
61
|
+
* mcp-hub-lite tool-use list-tags --server chrome-devtools
|
|
62
|
+
*
|
|
59
63
|
* # Get system tool schema
|
|
60
64
|
* mcp-hub-lite tool-use get-tool --tool list_tools --server mcp-hub-lite
|
|
61
65
|
*
|
|
@@ -93,8 +97,8 @@ import { getServerStatus } from '../server.js';
|
|
|
93
97
|
* @returns {Command} The configured mcp-tool-use command instance for registration with Commander.js
|
|
94
98
|
*/
|
|
95
99
|
export const toolUseCommand = new Command('tool-use')
|
|
96
|
-
.description('Manage MCP server tools via API (list-servers, list-tools, get-tool, call-tool)')
|
|
97
|
-
.argument('<action>', 'Action: list-servers, list-tools, get-tool, call-tool')
|
|
100
|
+
.description('Manage MCP server tools via API (list-servers, list-tools, list-tags, get-tool, call-tool)')
|
|
101
|
+
.argument('<action>', 'Action: list-servers, list-tools, list-tags, get-tool, call-tool')
|
|
98
102
|
.option('--server <serverName>', 'Server name to target (omit or empty for system tools)')
|
|
99
103
|
.option('--tool <toolName>', 'Tool name (required for get-tool and call-tool actions)')
|
|
100
104
|
.option('--args <json>', 'JSON string of tool arguments, or combined JSON with server/tool/args fields')
|
|
@@ -111,6 +115,9 @@ Examples:
|
|
|
111
115
|
# List third-party server tools
|
|
112
116
|
mcp-hub-lite tool-use list-tools --server baidu-search
|
|
113
117
|
|
|
118
|
+
# List instance tags for a server
|
|
119
|
+
mcp-hub-lite tool-use list-tags --server chrome-devtools
|
|
120
|
+
|
|
114
121
|
# Get system tool schema
|
|
115
122
|
mcp-hub-lite tool-use get-tool --tool list_tools
|
|
116
123
|
|
|
@@ -208,6 +215,22 @@ Examples:
|
|
|
208
215
|
console.log(JSON.stringify(result, null, 2));
|
|
209
216
|
break;
|
|
210
217
|
}
|
|
218
|
+
case 'list-tags': {
|
|
219
|
+
if (!effectiveServer || effectiveServer === defaultServer) {
|
|
220
|
+
effectiveServer = 'mcp-hub-lite';
|
|
221
|
+
}
|
|
222
|
+
const tagsParam = options.tags ? `?tags=${encodeURIComponent(options.tags)}` : '';
|
|
223
|
+
const response = await fetch(`${baseUrl}/web/hub-tools/servers/${effectiveServer}/tags${tagsParam}`, {
|
|
224
|
+
headers: { Accept: 'application/json' }
|
|
225
|
+
});
|
|
226
|
+
if (!response.ok) {
|
|
227
|
+
const error = await response.json().catch(() => ({ message: response.statusText }));
|
|
228
|
+
throw new Error(error.message || `API error: ${response.status}`);
|
|
229
|
+
}
|
|
230
|
+
const result = await response.json();
|
|
231
|
+
console.log(JSON.stringify(result, null, 2));
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
211
234
|
case 'call-tool': {
|
|
212
235
|
if (!effectiveTool) {
|
|
213
236
|
console.error('Error: toolName is required for call-tool action');
|
|
@@ -242,7 +265,7 @@ Examples:
|
|
|
242
265
|
}
|
|
243
266
|
default: {
|
|
244
267
|
console.error(`Unknown action: ${action}`);
|
|
245
|
-
console.error('Valid actions: list-servers, list-tools, get-tool, call-tool');
|
|
268
|
+
console.error('Valid actions: list-servers, list-tools, list-tags, get-tool, call-tool');
|
|
246
269
|
process.exit(1);
|
|
247
270
|
}
|
|
248
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/cli/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,iBAO5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0CjF;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/cli/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,iBAO5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0CjF;AAoED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW;;;;;;;;;;;;;;;;;;;KAUhC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,GAAG,KAAK,GAAG,iBAAiB,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,yBAAyB,EAAE,QAAQ,GAAG,aAAa,GAAG,kBAAkB,CAAC;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CA0Df;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB1E"}
|
|
@@ -173,6 +173,8 @@ async function fetchRuntimeStatus(host, port) {
|
|
|
173
173
|
const result = statusData.map((item) => ({
|
|
174
174
|
name: item.name,
|
|
175
175
|
type: item.type,
|
|
176
|
+
displayName: item.displayName,
|
|
177
|
+
tags: item.tags,
|
|
176
178
|
connected: item.status.connected,
|
|
177
179
|
toolsCount: item.status.toolsCount,
|
|
178
180
|
resourcesCount: item.status.resourcesCount,
|
|
@@ -32,17 +32,21 @@ export interface UpdateServerDescriptionParams {
|
|
|
32
32
|
serverName: string;
|
|
33
33
|
description: string;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export interface ListTagsParams {
|
|
36
|
+
serverName: string;
|
|
37
|
+
}
|
|
38
|
+
export type SystemToolArgs = ListServersParams | ListToolsInServerParams | GetToolParams | CallToolParams | UpdateServerDescriptionParams | ListTagsParams;
|
|
36
39
|
export declare const LIST_SERVERS_TOOL = "list_servers";
|
|
37
40
|
export declare const LIST_TOOLS_TOOL = "list_tools";
|
|
38
41
|
export declare const GET_TOOL_TOOL = "get_tool";
|
|
39
42
|
export declare const CALL_TOOL_TOOL = "call_tool";
|
|
40
43
|
export declare const UPDATE_SERVER_DESCRIPTION_TOOL = "update_server_description";
|
|
44
|
+
export declare const LIST_TAGS_TOOL = "list_tags";
|
|
41
45
|
/**
|
|
42
46
|
* List of all system tool names
|
|
43
47
|
* This array is used to identify system tools across the application
|
|
44
48
|
*/
|
|
45
|
-
export declare const SYSTEM_TOOL_NAMES: readonly ["list_servers", "list_tools", "get_tool", "call_tool", "update_server_description"];
|
|
49
|
+
export declare const SYSTEM_TOOL_NAMES: readonly ["list_servers", "list_tools", "get_tool", "call_tool", "update_server_description", "list_tags"];
|
|
46
50
|
/**
|
|
47
51
|
* Type definition for system tool names
|
|
48
52
|
* Provides type safety when working with system tool names
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-tools.constants.d.ts","sourceRoot":"","sources":["../../../../src/models/system-tools.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,uBAAuB,GACvB,aAAa,GACb,cAAc,GACd,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"system-tools.constants.d.ts","sourceRoot":"","sources":["../../../../src/models/system-tools.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,uBAAuB,GACvB,aAAa,GACb,cAAc,GACd,6BAA6B,GAC7B,cAAc,CAAC;AAGnB,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,8BAA8B,8BAA8B,CAAC;AAC1E,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,4GAOpB,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAGhE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC"}
|
|
@@ -8,6 +8,7 @@ export const LIST_TOOLS_TOOL = 'list_tools';
|
|
|
8
8
|
export const GET_TOOL_TOOL = 'get_tool';
|
|
9
9
|
export const CALL_TOOL_TOOL = 'call_tool';
|
|
10
10
|
export const UPDATE_SERVER_DESCRIPTION_TOOL = 'update_server_description';
|
|
11
|
+
export const LIST_TAGS_TOOL = 'list_tags';
|
|
11
12
|
/**
|
|
12
13
|
* List of all system tool names
|
|
13
14
|
* This array is used to identify system tools across the application
|
|
@@ -17,7 +18,8 @@ export const SYSTEM_TOOL_NAMES = [
|
|
|
17
18
|
LIST_TOOLS_TOOL,
|
|
18
19
|
GET_TOOL_TOOL,
|
|
19
20
|
CALL_TOOL_TOOL,
|
|
20
|
-
UPDATE_SERVER_DESCRIPTION_TOOL
|
|
21
|
+
UPDATE_SERVER_DESCRIPTION_TOOL,
|
|
22
|
+
LIST_TAGS_TOOL
|
|
21
23
|
];
|
|
22
24
|
// Individual gateway server name constant
|
|
23
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-tools-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/services/gateway/request-handlers/system-tools-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"system-tools-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/services/gateway/request-handlers/system-tools-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAazE;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmNnE"}
|
|
@@ -6,7 +6,7 @@ import { McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
|
6
6
|
import { logger } from '../../../utils/index.js';
|
|
7
7
|
import { LOG_MODULES } from '../../../utils/logger/log-modules.js';
|
|
8
8
|
import { hubToolsService } from '../../hub-tools.service.js';
|
|
9
|
-
import { LIST_SERVERS_TOOL, LIST_TOOLS_TOOL, GET_TOOL_TOOL, CALL_TOOL_TOOL, UPDATE_SERVER_DESCRIPTION_TOOL } from '../../../models/system-tools.constants.js';
|
|
9
|
+
import { LIST_SERVERS_TOOL, LIST_TOOLS_TOOL, GET_TOOL_TOOL, CALL_TOOL_TOOL, UPDATE_SERVER_DESCRIPTION_TOOL, LIST_TAGS_TOOL } from '../../../models/system-tools.constants.js';
|
|
10
10
|
/**
|
|
11
11
|
* Register system tools handlers on the MCP server.
|
|
12
12
|
*
|
|
@@ -192,4 +192,31 @@ export function registerSystemToolsHandlers(server) {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
+
// List tags
|
|
196
|
+
const ListTagsRequestSchema = z.object({
|
|
197
|
+
method: z.literal(LIST_TAGS_TOOL),
|
|
198
|
+
params: z.object({
|
|
199
|
+
serverName: z.string()
|
|
200
|
+
}),
|
|
201
|
+
id: z.union([z.string(), z.number()]),
|
|
202
|
+
jsonrpc: z.literal('2.0')
|
|
203
|
+
});
|
|
204
|
+
server.server.setRequestHandler(ListTagsRequestSchema, async (request) => {
|
|
205
|
+
try {
|
|
206
|
+
const result = await hubToolsService.listTags(request.params);
|
|
207
|
+
return result;
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
logger.error(`List tags error:`, error, LOG_MODULES.SYSTEM_TOOLS_HANDLER);
|
|
211
|
+
if (error instanceof McpError) {
|
|
212
|
+
throw error;
|
|
213
|
+
}
|
|
214
|
+
else if (error instanceof Error) {
|
|
215
|
+
throw new McpError(-32802, error.message);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
throw new McpError(-32802, String(error));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
195
222
|
}
|
|
@@ -43,7 +43,7 @@ export class InstanceSelector {
|
|
|
43
43
|
static selectInstance(serverName, serverConfig, requestOptions) {
|
|
44
44
|
const { instances } = serverConfig;
|
|
45
45
|
const instanceSelectionStrategy = serverConfig.template.instanceSelectionStrategy || InstanceSelectionStrategy.RANDOM;
|
|
46
|
-
// Filter enabled instances
|
|
46
|
+
// Filter instances - only use enabled instances
|
|
47
47
|
const enabledInstances = instances.filter((instance) => instance.enabled !== false);
|
|
48
48
|
if (enabledInstances.length === 0) {
|
|
49
49
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-generator.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/resource-generator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAUlE;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AA6ID;;GAEG;AACH,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,cAAc,2BAA2B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,IAAI,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"resource-generator.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/resource-generator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAUlE;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AA6ID;;GAEG;AACH,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,cAAc,2BAA2B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,IAAI,QAAQ,EAAE,CAuFrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,cAAc,GAAG,QAAQ,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,CAyGzD"}
|
|
@@ -178,36 +178,55 @@ export function generateDynamicResources() {
|
|
|
178
178
|
if (!hasValidId(server)) {
|
|
179
179
|
continue;
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
let hasAnyConnectedInstance = false;
|
|
182
|
+
let firstConnectedInstanceIndex;
|
|
183
|
+
// First pass: check which instances are connected (consistent with /web/mcp/status API)
|
|
184
|
+
for (const instance of server.config.instances) {
|
|
185
|
+
const idx = instance.index;
|
|
186
|
+
if (idx === undefined) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const instanceStatus = mcpConnectionManager.getStatus(server.name, idx);
|
|
190
|
+
if (instanceStatus?.connected) {
|
|
191
|
+
hasAnyConnectedInstance = true;
|
|
192
|
+
if (firstConnectedInstanceIndex === undefined) {
|
|
193
|
+
firstConnectedInstanceIndex = idx;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Skip server if no instances are connected
|
|
198
|
+
if (!hasAnyConnectedInstance) {
|
|
184
199
|
continue;
|
|
185
200
|
}
|
|
186
|
-
//
|
|
201
|
+
// Second pass: generate resources for each connected instance
|
|
187
202
|
for (const instance of server.config.instances) {
|
|
188
|
-
|
|
203
|
+
const idx = instance.index;
|
|
204
|
+
if (idx === undefined) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const instanceStatus = mcpConnectionManager.getStatus(server.name, idx);
|
|
208
|
+
if (!instanceStatus?.connected) {
|
|
189
209
|
continue;
|
|
190
210
|
}
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
if (
|
|
211
|
+
// Server metadata resource (one per server, using first connected instance's index)
|
|
212
|
+
// Only generate once when we hit the first connected instance
|
|
213
|
+
if (idx === firstConnectedInstanceIndex) {
|
|
194
214
|
resources.push({
|
|
195
215
|
uri: `hub://servers/${server.name}`,
|
|
196
216
|
name: `Server: ${server.name}`,
|
|
197
217
|
description: getServerDescription(server.config, server.name),
|
|
198
218
|
mimeType: 'application/json',
|
|
199
219
|
serverName: server.name,
|
|
200
|
-
serverIndex:
|
|
220
|
+
serverIndex: idx
|
|
201
221
|
});
|
|
202
222
|
}
|
|
203
223
|
// Get MCP native resources and map to hub format
|
|
204
|
-
const
|
|
205
|
-
const mcpResources = mcpConnectionManager.getResources(server.name, instanceIdx);
|
|
224
|
+
const mcpResources = mcpConnectionManager.getResources(server.name, idx);
|
|
206
225
|
for (const res of mcpResources) {
|
|
207
226
|
// Format: Resource: {ServerName} - {Index}: {Native Name}
|
|
208
|
-
const displayName = `Resource:${server.name} - ${
|
|
227
|
+
const displayName = `Resource:${server.name} - ${idx}:${res.name}`;
|
|
209
228
|
resources.push({
|
|
210
|
-
uri: mapMcpUriToHub(server.name,
|
|
229
|
+
uri: mapMcpUriToHub(server.name, idx, res.uri),
|
|
211
230
|
name: displayName,
|
|
212
231
|
description: res.description,
|
|
213
232
|
mimeType: res.mimeType
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { RequestOptions, ServerInstanceInfo, ValidServer } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Gets the description for a server, using
|
|
3
|
+
* Gets the description for a server, using the server name as default if none is provided.
|
|
4
4
|
*
|
|
5
5
|
* @param serverConfig - Server configuration object (may contain description in template)
|
|
6
6
|
* @param serverName - Name of the server
|
|
7
|
-
* @returns The server description or
|
|
7
|
+
* @returns The server description or the server name with usage note if no description is configured
|
|
8
8
|
*/
|
|
9
9
|
export declare function getServerDescription(serverConfig: {
|
|
10
10
|
template?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-selector.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/server-selector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE;IAAE,QAAQ,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,SAAS,EACjE,UAAU,EAAE,MAAM,GACjB,MAAM,
|
|
1
|
+
{"version":3,"file":"server-selector.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/server-selector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE;IAAE,QAAQ,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,SAAS,EACjE,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,WAAW,CAMjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,cAAc,EAC/B,UAAU,GAAE,OAAc,GACzB,kBAAkB,GAAG,SAAS,CA8ChC"}
|
|
@@ -3,14 +3,15 @@ import { InstanceSelector, TagMatchUniqueError } from './instance-selector.js';
|
|
|
3
3
|
import { logger } from '../../utils/logger.js';
|
|
4
4
|
import { LOG_MODULES } from '../../utils/logger/log-modules.js';
|
|
5
5
|
/**
|
|
6
|
-
* Gets the description for a server, using
|
|
6
|
+
* Gets the description for a server, using the server name as default if none is provided.
|
|
7
7
|
*
|
|
8
8
|
* @param serverConfig - Server configuration object (may contain description in template)
|
|
9
9
|
* @param serverName - Name of the server
|
|
10
|
-
* @returns The server description or
|
|
10
|
+
* @returns The server description or the server name with usage note if no description is configured
|
|
11
11
|
*/
|
|
12
12
|
export function getServerDescription(serverConfig, serverName) {
|
|
13
|
-
return serverConfig?.template?.description ||
|
|
13
|
+
return (serverConfig?.template?.description ||
|
|
14
|
+
`${serverName} (You can check the tool list to understand its capabilities and update the description.)`);
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Type guard to validate that a server object has valid name and configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-tool-definitions.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/system-tool-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"system-tool-definitions.d.ts","sourceRoot":"","sources":["../../../../../src/services/hub-tools/system-tool-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAW/D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,EAAE,CAiKvD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SYSTEM_TOOL_NAMES, LIST_SERVERS_TOOL, LIST_TOOLS_TOOL, GET_TOOL_TOOL, CALL_TOOL_TOOL, UPDATE_SERVER_DESCRIPTION_TOOL } from '../../models/system-tools.constants.js';
|
|
1
|
+
import { SYSTEM_TOOL_NAMES, LIST_SERVERS_TOOL, LIST_TOOLS_TOOL, GET_TOOL_TOOL, CALL_TOOL_TOOL, UPDATE_SERVER_DESCRIPTION_TOOL, LIST_TAGS_TOOL } from '../../models/system-tools.constants.js';
|
|
2
2
|
/**
|
|
3
3
|
* Retrieves the complete list of system tools provided by this service.
|
|
4
4
|
*
|
|
@@ -91,7 +91,7 @@ export function getSystemTools() {
|
|
|
91
91
|
required: ['serverName', 'toolName']
|
|
92
92
|
},
|
|
93
93
|
annotations: {
|
|
94
|
-
title: 'Get Tool
|
|
94
|
+
title: 'Get Tool Schema',
|
|
95
95
|
readOnlyHint: true,
|
|
96
96
|
destructiveHint: false,
|
|
97
97
|
idempotentHint: true,
|
|
@@ -103,7 +103,7 @@ export function getSystemTools() {
|
|
|
103
103
|
systemTools.push({
|
|
104
104
|
name: toolName,
|
|
105
105
|
description: 'Call a specific tool from an external MCP server. ' +
|
|
106
|
-
'System tools (list_servers, list_tools, get_tool, update_server_description) ' +
|
|
106
|
+
'System tools (list_servers, list_tools, get_tool, list_tags, update_server_description) ' +
|
|
107
107
|
'must be called directly via tools/call, not through this tool.',
|
|
108
108
|
inputSchema: {
|
|
109
109
|
type: 'object',
|
|
@@ -154,6 +154,26 @@ export function getSystemTools() {
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
break;
|
|
157
|
+
case LIST_TAGS_TOOL:
|
|
158
|
+
systemTools.push({
|
|
159
|
+
name: toolName,
|
|
160
|
+
description: 'List all instance tags for a specific MCP server',
|
|
161
|
+
inputSchema: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {
|
|
164
|
+
serverName: { type: 'string', description: 'Name of the MCP server' }
|
|
165
|
+
},
|
|
166
|
+
required: ['serverName']
|
|
167
|
+
},
|
|
168
|
+
annotations: {
|
|
169
|
+
title: 'List Instance Tags',
|
|
170
|
+
readOnlyHint: true,
|
|
171
|
+
destructiveHint: false,
|
|
172
|
+
idempotentHint: true,
|
|
173
|
+
openWorldHint: false
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
break;
|
|
157
177
|
default:
|
|
158
178
|
// This should never happen due to TypeScript type checking
|
|
159
179
|
throw new Error(`Unknown system tool: ${toolName}`);
|