@samanhappy/mcphub 0.12.4 → 0.12.6
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/dist/config/index.js +6 -1
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/builtinPromptController.js +119 -0
- package/dist/controllers/builtinPromptController.js.map +1 -0
- package/dist/controllers/builtinResourceController.js +142 -0
- package/dist/controllers/builtinResourceController.js.map +1 -0
- package/dist/controllers/serverController.js +134 -8
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/dao/BuiltinPromptDao.js +72 -0
- package/dist/dao/BuiltinPromptDao.js.map +1 -0
- package/dist/dao/BuiltinPromptDaoDbImpl.js +76 -0
- package/dist/dao/BuiltinPromptDaoDbImpl.js.map +1 -0
- package/dist/dao/BuiltinResourceDao.js +72 -0
- package/dist/dao/BuiltinResourceDao.js.map +1 -0
- package/dist/dao/BuiltinResourceDaoDbImpl.js +76 -0
- package/dist/dao/BuiltinResourceDaoDbImpl.js.map +1 -0
- package/dist/dao/DaoFactory.js +24 -0
- package/dist/dao/DaoFactory.js.map +1 -1
- package/dist/dao/DatabaseDaoFactory.js +18 -0
- package/dist/dao/DatabaseDaoFactory.js.map +1 -1
- package/dist/dao/ServerDao.js +4 -0
- package/dist/dao/ServerDao.js.map +1 -1
- package/dist/dao/ServerDaoDbImpl.js +7 -0
- package/dist/dao/ServerDaoDbImpl.js.map +1 -1
- package/dist/dao/index.js +4 -0
- package/dist/dao/index.js.map +1 -1
- package/dist/db/connection.js +33 -14
- package/dist/db/connection.js.map +1 -1
- package/dist/db/entities/BuiltinPrompt.js +57 -0
- package/dist/db/entities/BuiltinPrompt.js.map +1 -0
- package/dist/db/entities/BuiltinResource.js +57 -0
- package/dist/db/entities/BuiltinResource.js.map +1 -0
- package/dist/db/entities/Server.js +4 -0
- package/dist/db/entities/Server.js.map +1 -1
- package/dist/db/entities/VectorEmbedding.js +1 -2
- package/dist/db/entities/VectorEmbedding.js.map +1 -1
- package/dist/db/entities/index.js +5 -1
- package/dist/db/entities/index.js.map +1 -1
- package/dist/db/repositories/BuiltinPromptRepository.js +40 -0
- package/dist/db/repositories/BuiltinPromptRepository.js.map +1 -0
- package/dist/db/repositories/BuiltinResourceRepository.js +40 -0
- package/dist/db/repositories/BuiltinResourceRepository.js.map +1 -0
- package/dist/db/repositories/index.js +3 -1
- package/dist/db/repositories/index.js.map +1 -1
- package/dist/routes/index.js +18 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/services/mcpService.js +176 -8
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/sseService.js +13 -0
- package/dist/services/sseService.js.map +1 -1
- package/dist/services/vectorSearchService.js +35 -1
- package/dist/services/vectorSearchService.js.map +1 -1
- package/dist/utils/base64.js +59 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/migration.js +47 -0
- package/dist/utils/migration.js.map +1 -1
- package/dist/utils/smartRouting.js +9 -0
- package/dist/utils/smartRouting.js.map +1 -1
- package/frontend/dist/assets/index-BT845f3p.js +314 -0
- package/frontend/dist/assets/index-BT845f3p.js.map +1 -0
- package/frontend/dist/assets/index-Cf9Rz7Uy.css +1 -0
- package/frontend/dist/assets/resourceService-B7vWfjLj.js +2 -0
- package/frontend/dist/assets/resourceService-B7vWfjLj.js.map +1 -0
- package/frontend/dist/index.html +2 -2
- package/mcp_settings.json +3 -1
- package/package.json +2 -2
- package/frontend/dist/assets/index-CtcblSpA.js +0 -294
- package/frontend/dist/assets/index-CtcblSpA.js.map +0 -1
- package/frontend/dist/assets/index-DM2_JGfR.css +0 -1
|
@@ -8,6 +8,8 @@ import { OAuthClientRepository } from './OAuthClientRepository.js';
|
|
|
8
8
|
import { OAuthTokenRepository } from './OAuthTokenRepository.js';
|
|
9
9
|
import { BearerKeyRepository } from './BearerKeyRepository.js';
|
|
10
10
|
import { ActivityRepository } from './ActivityRepository.js';
|
|
11
|
+
import { BuiltinPromptRepository } from './BuiltinPromptRepository.js';
|
|
12
|
+
import { BuiltinResourceRepository } from './BuiltinResourceRepository.js';
|
|
11
13
|
// Export all repositories
|
|
12
|
-
export { VectorEmbeddingRepository, UserRepository, ServerRepository, GroupRepository, SystemConfigRepository, UserConfigRepository, OAuthClientRepository, OAuthTokenRepository, BearerKeyRepository, ActivityRepository, };
|
|
14
|
+
export { VectorEmbeddingRepository, UserRepository, ServerRepository, GroupRepository, SystemConfigRepository, UserConfigRepository, OAuthClientRepository, OAuthTokenRepository, BearerKeyRepository, ActivityRepository, BuiltinPromptRepository, BuiltinResourceRepository, };
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/repositories/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/repositories/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,0BAA0B;AAC1B,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,GAC1B,CAAC"}
|
package/dist/routes/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { check } from 'express-validator';
|
|
3
3
|
import config from '../config/index.js';
|
|
4
|
-
import { getAllServers, getAllSettings, getServerConfig, createServer, batchCreateServers, updateServer, deleteServer, toggleServer, reloadServer, toggleTool, updateToolDescription, togglePrompt, updatePromptDescription, updateSystemConfig, } from '../controllers/serverController.js';
|
|
4
|
+
import { getAllServers, getAllSettings, getServerConfig, createServer, batchCreateServers, updateServer, deleteServer, toggleServer, reloadServer, toggleTool, updateToolDescription, togglePrompt, updatePromptDescription, toggleResource, updateResourceDescription, updateSystemConfig, } from '../controllers/serverController.js';
|
|
5
5
|
import { getGroups, getGroup, createNewGroup, batchCreateGroups, updateExistingGroup, deleteExistingGroup, addServerToExistingGroup, removeServerFromExistingGroup, getGroupServers, updateGroupServersBatch, getGroupServerConfigs, getGroupServerConfig, updateGroupServerTools, } from '../controllers/groupController.js';
|
|
6
6
|
import { getUsers, getUser, createUser, updateExistingUser, deleteExistingUser, getUserStats, } from '../controllers/userController.js';
|
|
7
7
|
import { getAllMarketServers, getMarketServer, getAllMarketCategories, getAllMarketTags, searchMarketServersByQuery, getMarketServersByCategory, getMarketServersByTag, } from '../controllers/marketController.js';
|
|
@@ -12,6 +12,8 @@ import { getAllLogs, clearLogs, streamLogs } from '../controllers/logController.
|
|
|
12
12
|
import { getRuntimeConfig, getPublicConfig, getMcpSettingsJson, } from '../controllers/configController.js';
|
|
13
13
|
import { callTool } from '../controllers/toolController.js';
|
|
14
14
|
import { getPrompt } from '../controllers/promptController.js';
|
|
15
|
+
import { listBuiltinPrompts, getBuiltinPrompt, createBuiltinPrompt, updateBuiltinPrompt, deleteBuiltinPrompt, } from '../controllers/builtinPromptController.js';
|
|
16
|
+
import { listBuiltinResources, getBuiltinResource, createBuiltinResource, updateBuiltinResource, deleteBuiltinResource, readResource, } from '../controllers/builtinResourceController.js';
|
|
15
17
|
import { uploadMcpbFile, uploadMiddleware } from '../controllers/mcpbController.js';
|
|
16
18
|
import { healthCheck } from '../controllers/healthController.js';
|
|
17
19
|
import { getBetterAuthUser } from '../controllers/betterAuthController.js';
|
|
@@ -70,6 +72,8 @@ export const initRoutes = async (app) => {
|
|
|
70
72
|
router.put('/servers/:serverName/tools/:toolName/description', updateToolDescription);
|
|
71
73
|
router.post('/servers/:serverName/prompts/:promptName/toggle', togglePrompt);
|
|
72
74
|
router.put('/servers/:serverName/prompts/:promptName/description', updatePromptDescription);
|
|
75
|
+
router.post('/servers/:serverName/resources/:resourceUri/toggle', toggleResource);
|
|
76
|
+
router.put('/servers/:serverName/resources/:resourceUri/description', updateResourceDescription);
|
|
73
77
|
router.put('/system-config', updateSystemConfig);
|
|
74
78
|
// Group management routes
|
|
75
79
|
router.get('/groups', getGroups);
|
|
@@ -120,6 +124,19 @@ export const initRoutes = async (app) => {
|
|
|
120
124
|
router.post('/tools/call/:server', callTool);
|
|
121
125
|
// Prompt management routes
|
|
122
126
|
router.post('/mcp/:serverName/prompts/:promptName', getPrompt);
|
|
127
|
+
// Built-in prompt management routes
|
|
128
|
+
router.get('/prompts', listBuiltinPrompts);
|
|
129
|
+
router.get('/prompts/:id', getBuiltinPrompt);
|
|
130
|
+
router.post('/prompts', createBuiltinPrompt);
|
|
131
|
+
router.put('/prompts/:id', updateBuiltinPrompt);
|
|
132
|
+
router.delete('/prompts/:id', deleteBuiltinPrompt);
|
|
133
|
+
// Built-in resource management routes
|
|
134
|
+
router.get('/resources', listBuiltinResources);
|
|
135
|
+
router.get('/resources/:id', getBuiltinResource);
|
|
136
|
+
router.post('/resources', createBuiltinResource);
|
|
137
|
+
router.put('/resources/:id', updateBuiltinResource);
|
|
138
|
+
router.delete('/resources/:id', deleteBuiltinResource);
|
|
139
|
+
router.post('/resources/read', readResource);
|
|
123
140
|
// MCPB upload routes
|
|
124
141
|
router.post('/mcpb/upload', uploadMiddleware, uploadMcpbFile);
|
|
125
142
|
// Market routes
|
package/dist/routes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,6BAA6B,EAC7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,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kCAAkC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AkC,EAAE,qBAAqB,CAAC,CAAC;IACrF,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,kCAAkC,EAAE,qBAAqB,CAAC,CAAC;IACtF,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,wCAAwC,EAAE,qBAAqB,CAAC,CAAC;IAC3F,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,wCAAwC,EAAE,qBAAqB,CAAC,CAAC;IAE5F,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -2,7 +2,7 @@ import os from 'os';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
7
7
|
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
8
8
|
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -16,7 +16,7 @@ import { removeServerToolEmbeddings, saveToolsAsVectorEmbeddings } from './vecto
|
|
|
16
16
|
import { OpenAPIClient } from '../clients/openapi.js';
|
|
17
17
|
import { RequestContextService } from './requestContextService.js';
|
|
18
18
|
import { getDataService } from './services.js';
|
|
19
|
-
import { getServerDao, getSystemConfigDao } from '../dao/index.js';
|
|
19
|
+
import { getServerDao, getSystemConfigDao, getBuiltinPromptDao, getBuiltinResourceDao, } from '../dao/index.js';
|
|
20
20
|
import { initializeAllOAuthClients } from './oauthService.js';
|
|
21
21
|
import { createOAuthProvider } from './mcpOAuthProvider.js';
|
|
22
22
|
import { initSmartRoutingService, getSmartRoutingTools, handleSearchToolsRequest, handleDescribeToolRequest, isSmartRoutingGroup, } from './smartRoutingService.js';
|
|
@@ -199,6 +199,24 @@ const cleanInputSchema = (schema) => {
|
|
|
199
199
|
delete cleanedSchema.$schema;
|
|
200
200
|
return cleanedSchema;
|
|
201
201
|
};
|
|
202
|
+
// Normalize prompt payload to satisfy MCP ListPrompts response schema
|
|
203
|
+
const normalizePromptForList = (prompt) => {
|
|
204
|
+
return {
|
|
205
|
+
name: prompt.name,
|
|
206
|
+
title: prompt.title || prompt.name,
|
|
207
|
+
description: prompt.description || '',
|
|
208
|
+
arguments: Array.isArray(prompt.arguments) ? prompt.arguments : [],
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
// Normalize resource payload to avoid nullable DB fields violating MCP schema
|
|
212
|
+
const normalizeResourceForList = (resource) => {
|
|
213
|
+
return {
|
|
214
|
+
uri: resource.uri,
|
|
215
|
+
name: resource.name || '',
|
|
216
|
+
description: resource.description || '',
|
|
217
|
+
mimeType: resource.mimeType || '',
|
|
218
|
+
};
|
|
219
|
+
};
|
|
202
220
|
// Store all server information
|
|
203
221
|
let serverInfos = [];
|
|
204
222
|
// Normalize and infer server type for safe client display
|
|
@@ -444,6 +462,7 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
444
462
|
error: null,
|
|
445
463
|
tools: [],
|
|
446
464
|
prompts: [],
|
|
465
|
+
resources: [],
|
|
447
466
|
createTime: Date.now(),
|
|
448
467
|
enabled: false,
|
|
449
468
|
});
|
|
@@ -472,6 +491,7 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
472
491
|
error: 'Missing OpenAPI specification URL or schema',
|
|
473
492
|
tools: [],
|
|
474
493
|
prompts: [],
|
|
494
|
+
resources: [],
|
|
475
495
|
createTime: Date.now(),
|
|
476
496
|
});
|
|
477
497
|
continue;
|
|
@@ -484,6 +504,7 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
484
504
|
error: null,
|
|
485
505
|
tools: [],
|
|
486
506
|
prompts: [],
|
|
507
|
+
resources: [],
|
|
487
508
|
createTime: Date.now(),
|
|
488
509
|
enabled: expandedConf.enabled === undefined ? true : expandedConf.enabled,
|
|
489
510
|
config: expandedConf, // Store reference to expanded config for OpenAPI passthrough headers
|
|
@@ -548,6 +569,7 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
548
569
|
error: null,
|
|
549
570
|
tools: [],
|
|
550
571
|
prompts: [],
|
|
572
|
+
resources: [],
|
|
551
573
|
client,
|
|
552
574
|
transport,
|
|
553
575
|
options: requestOptions,
|
|
@@ -595,7 +617,7 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
595
617
|
.listPrompts({}, initRequestOptions || requestOptions)
|
|
596
618
|
.then((prompts) => {
|
|
597
619
|
console.log(`Successfully listed ${prompts.prompts.length} prompts for server: ${name}`);
|
|
598
|
-
serverInfo.prompts = prompts.prompts.map((prompt) => ({
|
|
620
|
+
serverInfo.prompts = prompts.prompts.map((prompt) => normalizePromptForList({
|
|
599
621
|
name: `${name}${getNameSeparator()}${prompt.name}`,
|
|
600
622
|
title: prompt.title,
|
|
601
623
|
description: prompt.description,
|
|
@@ -607,6 +629,23 @@ export const initializeClientsFromSettings = async (isInit, serverName) => {
|
|
|
607
629
|
dataError = error;
|
|
608
630
|
});
|
|
609
631
|
}
|
|
632
|
+
if (capabilities?.resources) {
|
|
633
|
+
client
|
|
634
|
+
.listResources({}, initRequestOptions || requestOptions)
|
|
635
|
+
.then((resources) => {
|
|
636
|
+
console.log(`Successfully listed ${resources.resources.length} resources for server: ${name}`);
|
|
637
|
+
serverInfo.resources = resources.resources.map((resource) => normalizeResourceForList({
|
|
638
|
+
uri: resource.uri,
|
|
639
|
+
name: resource.name,
|
|
640
|
+
description: resource.description,
|
|
641
|
+
mimeType: resource.mimeType,
|
|
642
|
+
}));
|
|
643
|
+
})
|
|
644
|
+
.catch((error) => {
|
|
645
|
+
console.error(`Failed to list resources for server ${name} by error: ${error} with stack: ${error.stack}`);
|
|
646
|
+
dataError = error;
|
|
647
|
+
});
|
|
648
|
+
}
|
|
610
649
|
if (!dataError) {
|
|
611
650
|
serverInfo.status = 'connected';
|
|
612
651
|
serverInfo.error = null;
|
|
@@ -689,6 +728,7 @@ export const getServersInfo = async (page, limit, user) => {
|
|
|
689
728
|
error: null,
|
|
690
729
|
tools: [],
|
|
691
730
|
prompts: [],
|
|
731
|
+
resources: [],
|
|
692
732
|
createTime: Date.now(),
|
|
693
733
|
enabled: isEnabled,
|
|
694
734
|
});
|
|
@@ -702,7 +742,7 @@ export const getServersInfo = async (page, limit, user) => {
|
|
|
702
742
|
: filteredServerInfos;
|
|
703
743
|
const infos = filterServerInfos
|
|
704
744
|
.filter((info) => requestedServerNames.has(info.name)) // Only include requested servers
|
|
705
|
-
.map(({ name, status, tools, prompts, createTime, error, oauth }) => {
|
|
745
|
+
.map(({ name, status, tools, prompts, resources, createTime, error, oauth }) => {
|
|
706
746
|
const serverConfig = allServers.find((server) => server.name === name);
|
|
707
747
|
const enabled = serverConfig ? serverConfig.enabled !== false : true;
|
|
708
748
|
const resolvedType = inferServerType(serverConfig);
|
|
@@ -729,6 +769,7 @@ export const getServersInfo = async (page, limit, user) => {
|
|
|
729
769
|
error,
|
|
730
770
|
tools: toolsWithEnabled,
|
|
731
771
|
prompts: promptsWithEnabled,
|
|
772
|
+
resources,
|
|
732
773
|
createTime,
|
|
733
774
|
enabled,
|
|
734
775
|
oauth: oauth
|
|
@@ -1262,12 +1303,31 @@ export const handleCallToolRequest = async (request, extra) => {
|
|
|
1262
1303
|
export const handleGetPromptRequest = async (request, extra) => {
|
|
1263
1304
|
try {
|
|
1264
1305
|
const { name, arguments: promptArgs } = request.params;
|
|
1306
|
+
// Check built-in prompts first
|
|
1307
|
+
const builtinPrompt = await getBuiltinPromptDao().findByName(name);
|
|
1308
|
+
if (builtinPrompt && builtinPrompt.enabled !== false) {
|
|
1309
|
+
// Perform {{param}} template substitution
|
|
1310
|
+
let content = builtinPrompt.template;
|
|
1311
|
+
if (promptArgs) {
|
|
1312
|
+
for (const [key, value] of Object.entries(promptArgs)) {
|
|
1313
|
+
content = content.replace(new RegExp(`\\{\\{${key}\\}\\}`, 'g'), String(value));
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return {
|
|
1317
|
+
messages: [
|
|
1318
|
+
{
|
|
1319
|
+
role: 'user',
|
|
1320
|
+
content: { type: 'text', text: content },
|
|
1321
|
+
},
|
|
1322
|
+
],
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1265
1325
|
let server;
|
|
1266
1326
|
if (extra && extra.server) {
|
|
1267
1327
|
server = getServerByName(extra.server);
|
|
1268
1328
|
}
|
|
1269
1329
|
else {
|
|
1270
|
-
// Find the first server that has this
|
|
1330
|
+
// Find the first server that has this prompt
|
|
1271
1331
|
server = serverInfos.find((serverInfo) => serverInfo.status === 'connected' &&
|
|
1272
1332
|
serverInfo.enabled !== false &&
|
|
1273
1333
|
serverInfo.prompts.find((prompt) => prompt.name === name));
|
|
@@ -1309,6 +1369,14 @@ export const handleListPromptsRequest = async (_, extra) => {
|
|
|
1309
1369
|
const sessionId = extra.sessionId || '';
|
|
1310
1370
|
const group = getGroup(sessionId);
|
|
1311
1371
|
console.log(`Handling ListPromptsRequest for group: ${group}`);
|
|
1372
|
+
// Start with built-in prompts (only enabled ones)
|
|
1373
|
+
const builtinPrompts = await getBuiltinPromptDao().findEnabled();
|
|
1374
|
+
const allPrompts = builtinPrompts.map((bp) => normalizePromptForList({
|
|
1375
|
+
name: bp.name,
|
|
1376
|
+
title: bp.title,
|
|
1377
|
+
description: bp.description,
|
|
1378
|
+
arguments: bp.arguments,
|
|
1379
|
+
}));
|
|
1312
1380
|
// Need to filter servers based on group asynchronously
|
|
1313
1381
|
const filteredServerInfos = [];
|
|
1314
1382
|
for (const serverInfo of getDataService().filterData(serverInfos)) {
|
|
@@ -1328,7 +1396,6 @@ export const handleListPromptsRequest = async (_, extra) => {
|
|
|
1328
1396
|
filteredServerInfos.push(serverInfo);
|
|
1329
1397
|
}
|
|
1330
1398
|
}
|
|
1331
|
-
const allPrompts = [];
|
|
1332
1399
|
for (const serverInfo of filteredServerInfos) {
|
|
1333
1400
|
if (serverInfo.prompts && serverInfo.prompts.length > 0) {
|
|
1334
1401
|
// Filter prompts based on server configuration
|
|
@@ -1354,10 +1421,10 @@ export const handleListPromptsRequest = async (_, extra) => {
|
|
|
1354
1421
|
// Apply custom descriptions from server configuration
|
|
1355
1422
|
const promptsWithCustomDescriptions = enabledPrompts.map((prompt) => {
|
|
1356
1423
|
const promptConfig = serverConfig?.prompts?.[prompt.name];
|
|
1357
|
-
return {
|
|
1424
|
+
return normalizePromptForList({
|
|
1358
1425
|
...prompt,
|
|
1359
1426
|
description: promptConfig?.description || prompt.description, // Use custom description if available
|
|
1360
|
-
};
|
|
1427
|
+
});
|
|
1361
1428
|
});
|
|
1362
1429
|
allPrompts.push(...promptsWithCustomDescriptions);
|
|
1363
1430
|
}
|
|
@@ -1366,6 +1433,105 @@ export const handleListPromptsRequest = async (_, extra) => {
|
|
|
1366
1433
|
prompts: allPrompts,
|
|
1367
1434
|
};
|
|
1368
1435
|
};
|
|
1436
|
+
export const handleListResourcesRequest = async (_, extra) => {
|
|
1437
|
+
const sessionId = extra.sessionId || '';
|
|
1438
|
+
const group = getGroup(sessionId);
|
|
1439
|
+
console.log(`Handling ListResourcesRequest for group: ${group}`);
|
|
1440
|
+
// Start with built-in resources (only enabled ones)
|
|
1441
|
+
const builtinResources = await getBuiltinResourceDao().findEnabled();
|
|
1442
|
+
const allResources = builtinResources.map((br) => normalizeResourceForList({
|
|
1443
|
+
uri: br.uri,
|
|
1444
|
+
name: br.name,
|
|
1445
|
+
description: br.description,
|
|
1446
|
+
mimeType: br.mimeType,
|
|
1447
|
+
}));
|
|
1448
|
+
// Add resources from connected MCP servers
|
|
1449
|
+
const filteredServerInfos = [];
|
|
1450
|
+
for (const serverInfo of getDataService().filterData(serverInfos)) {
|
|
1451
|
+
if (serverInfo.enabled === false)
|
|
1452
|
+
continue;
|
|
1453
|
+
if (!group) {
|
|
1454
|
+
filteredServerInfos.push(serverInfo);
|
|
1455
|
+
continue;
|
|
1456
|
+
}
|
|
1457
|
+
const serversInGroup = await getServersInGroup(group);
|
|
1458
|
+
if (!serversInGroup || serversInGroup.length === 0) {
|
|
1459
|
+
if (serverInfo.name === group)
|
|
1460
|
+
filteredServerInfos.push(serverInfo);
|
|
1461
|
+
continue;
|
|
1462
|
+
}
|
|
1463
|
+
if (serversInGroup.includes(serverInfo.name)) {
|
|
1464
|
+
filteredServerInfos.push(serverInfo);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
for (const serverInfo of filteredServerInfos) {
|
|
1468
|
+
if (serverInfo.resources && serverInfo.resources.length > 0) {
|
|
1469
|
+
// Filter resources based on server configuration
|
|
1470
|
+
const serverConfig = await getServerDao().findById(serverInfo.name);
|
|
1471
|
+
let enabledResources = serverInfo.resources;
|
|
1472
|
+
if (serverConfig && serverConfig.resources) {
|
|
1473
|
+
enabledResources = serverInfo.resources.filter((resource) => {
|
|
1474
|
+
const resourceConfig = serverConfig.resources?.[resource.uri];
|
|
1475
|
+
return resourceConfig?.enabled !== false;
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
// Apply custom descriptions from server configuration
|
|
1479
|
+
const resourcesWithCustomDescriptions = enabledResources.map((resource) => {
|
|
1480
|
+
const resourceConfig = serverConfig?.resources?.[resource.uri];
|
|
1481
|
+
return normalizeResourceForList({
|
|
1482
|
+
...resource,
|
|
1483
|
+
description: resourceConfig?.description || resource.description,
|
|
1484
|
+
});
|
|
1485
|
+
});
|
|
1486
|
+
allResources.push(...resourcesWithCustomDescriptions);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
return {
|
|
1490
|
+
resources: allResources,
|
|
1491
|
+
};
|
|
1492
|
+
};
|
|
1493
|
+
export const handleReadResourceRequest = async (request, _extra) => {
|
|
1494
|
+
try {
|
|
1495
|
+
const { uri } = request.params;
|
|
1496
|
+
// Check built-in resources first
|
|
1497
|
+
const builtinResource = await getBuiltinResourceDao().findByUri(uri);
|
|
1498
|
+
if (builtinResource && builtinResource.enabled !== false) {
|
|
1499
|
+
return {
|
|
1500
|
+
contents: [
|
|
1501
|
+
{
|
|
1502
|
+
uri: builtinResource.uri,
|
|
1503
|
+
mimeType: builtinResource.mimeType || 'text/plain',
|
|
1504
|
+
text: builtinResource.content,
|
|
1505
|
+
},
|
|
1506
|
+
],
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
// Find the server that owns this resource
|
|
1510
|
+
const server = serverInfos.find((serverInfo) => serverInfo.status === 'connected' &&
|
|
1511
|
+
serverInfo.enabled !== false &&
|
|
1512
|
+
serverInfo.resources?.find((resource) => resource.uri === uri));
|
|
1513
|
+
if (!server) {
|
|
1514
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
1515
|
+
}
|
|
1516
|
+
const result = await server.client?.readResource({ uri });
|
|
1517
|
+
if (!result) {
|
|
1518
|
+
throw new Error(`Failed to read resource: ${uri}`);
|
|
1519
|
+
}
|
|
1520
|
+
return result;
|
|
1521
|
+
}
|
|
1522
|
+
catch (error) {
|
|
1523
|
+
console.error(`Error handling ReadResourceRequest: ${error}`);
|
|
1524
|
+
return {
|
|
1525
|
+
contents: [
|
|
1526
|
+
{
|
|
1527
|
+
uri: request.params?.uri || '',
|
|
1528
|
+
mimeType: 'text/plain',
|
|
1529
|
+
text: `Error: ${error}`,
|
|
1530
|
+
},
|
|
1531
|
+
],
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1369
1535
|
// Create McpServer instance
|
|
1370
1536
|
export const createMcpServer = (name, version, group) => {
|
|
1371
1537
|
// Determine server name based on routing type
|
|
@@ -1381,6 +1547,8 @@ export const createMcpServer = (name, version, group) => {
|
|
|
1381
1547
|
server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);
|
|
1382
1548
|
server.setRequestHandler(GetPromptRequestSchema, handleGetPromptRequest);
|
|
1383
1549
|
server.setRequestHandler(ListPromptsRequestSchema, handleListPromptsRequest);
|
|
1550
|
+
server.setRequestHandler(ListResourcesRequestSchema, handleListResourcesRequest);
|
|
1551
|
+
server.setRequestHandler(ReadResourceRequestSchema, handleReadResourceRequest);
|
|
1384
1552
|
return server;
|
|
1385
1553
|
};
|
|
1386
1554
|
// Filter tools based on group configuration
|