@theia/ai-mcp 1.67.0-next.13 → 1.67.0-next.56
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/README.md +33 -5
- package/package.json +4 -4
- package/lib/browser/mcp-frontend-application-contribution.d.ts +0 -42
- package/lib/browser/mcp-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/mcp-frontend-application-contribution.js +0 -169
- package/lib/browser/mcp-frontend-application-contribution.js.map +0 -1
- package/lib/browser/mcp-frontend-module.d.ts +0 -4
- package/lib/browser/mcp-frontend-module.d.ts.map +0 -1
- package/lib/browser/mcp-frontend-module.js +0 -81
- package/lib/browser/mcp-frontend-module.js.map +0 -1
- package/lib/browser/mcp-frontend-notification-service.d.ts +0 -8
- package/lib/browser/mcp-frontend-notification-service.d.ts.map +0 -1
- package/lib/browser/mcp-frontend-notification-service.js +0 -35
- package/lib/browser/mcp-frontend-notification-service.js.map +0 -1
- package/lib/browser/mcp-frontend-service.d.ts +0 -23
- package/lib/browser/mcp-frontend-service.d.ts.map +0 -1
- package/lib/browser/mcp-frontend-service.js +0 -151
- package/lib/browser/mcp-frontend-service.js.map +0 -1
- package/lib/browser/mcp-server-manager-server-client.d.ts +0 -12
- package/lib/browser/mcp-server-manager-server-client.d.ts.map +0 -1
- package/lib/browser/mcp-server-manager-server-client.js +0 -80
- package/lib/browser/mcp-server-manager-server-client.js.map +0 -1
- package/lib/common/index.d.ts +0 -2
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -20
- package/lib/common/index.js.map +0 -1
- package/lib/common/mcp-preferences.d.ts +0 -4
- package/lib/common/mcp-preferences.d.ts.map +0 -1
- package/lib/common/mcp-preferences.js +0 -113
- package/lib/common/mcp-preferences.js.map +0 -1
- package/lib/common/mcp-protocol.d.ts +0 -52
- package/lib/common/mcp-protocol.d.ts.map +0 -1
- package/lib/common/mcp-protocol.js +0 -30
- package/lib/common/mcp-protocol.js.map +0 -1
- package/lib/common/mcp-server-manager.d.ts +0 -128
- package/lib/common/mcp-server-manager.d.ts.map +0 -1
- package/lib/common/mcp-server-manager.js +0 -41
- package/lib/common/mcp-server-manager.js.map +0 -1
- package/lib/node/mcp-backend-module.d.ts +0 -4
- package/lib/node/mcp-backend-module.d.ts.map +0 -1
- package/lib/node/mcp-backend-module.js +0 -46
- package/lib/node/mcp-backend-module.js.map +0 -1
- package/lib/node/mcp-server-manager-impl.d.ts +0 -24
- package/lib/node/mcp-server-manager-impl.d.ts.map +0 -1
- package/lib/node/mcp-server-manager-impl.js +0 -151
- package/lib/node/mcp-server-manager-impl.js.map +0 -1
- package/lib/node/mcp-server-manager-server.d.ts +0 -9
- package/lib/node/mcp-server-manager-server.d.ts.map +0 -1
- package/lib/node/mcp-server-manager-server.js +0 -53
- package/lib/node/mcp-server-manager-server.js.map +0 -1
- package/lib/node/mcp-server.d.ts +0 -25
- package/lib/node/mcp-server.d.ts.map +0 -1
- package/lib/node/mcp-server.js +0 -222
- package/lib/node/mcp-server.js.map +0 -1
- package/lib/package.spec.d.ts +0 -1
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -26
- package/lib/package.spec.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-frontend-service.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-service.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,4DAAkE;AAClE,qEAA0G;AAC1G,4CAA4H;AAIrH,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAW/B,KAAK,CAAC,WAAW,CAAC,UAAkB;QAChC,MAAM,IAAI,CAAC,gBAAgB,CAAC,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lC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MCPServerDescription } from '../common';
|
|
2
|
-
import { MCPServerDescriptionRCP, MCPServerManagerServerClient } from '../common/mcp-protocol';
|
|
3
|
-
type StoredServerInfo = Pick<MCPServerDescription, 'name' | 'resolve'>;
|
|
4
|
-
export declare class MCPServerManagerServerClientImpl implements MCPServerManagerServerClient {
|
|
5
|
-
protected serverDescriptions: Map<string, StoredServerInfo>;
|
|
6
|
-
addServerDescription(description: MCPServerDescription): MCPServerDescriptionRCP;
|
|
7
|
-
getResolveFunction(name: string): MCPServerDescription['resolve'];
|
|
8
|
-
resolveServerDescription(description: MCPServerDescriptionRCP): Promise<MCPServerDescription>;
|
|
9
|
-
cleanServers(serverNames: string[]): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=mcp-server-manager-server-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-manager-server-client.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-server-manager-server-client.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAA0B,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEvH,KAAK,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvE,qBACa,gCAAiC,YAAW,4BAA4B;IAEjF,SAAS,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAa;IAExE,oBAAoB,CAAC,WAAW,EAAE,oBAAoB,GAAG,uBAAuB;IAoBhF,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC;IAS3D,wBAAwB,CAAC,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAcnG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;CAU5C"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 Dirk Fauth and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.MCPServerManagerServerClientImpl = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const uuid_1 = require("@theia/core/lib/common/uuid");
|
|
22
|
-
const mcp_protocol_1 = require("../common/mcp-protocol");
|
|
23
|
-
let MCPServerManagerServerClientImpl = class MCPServerManagerServerClientImpl {
|
|
24
|
-
constructor() {
|
|
25
|
-
this.serverDescriptions = new Map();
|
|
26
|
-
}
|
|
27
|
-
addServerDescription(description) {
|
|
28
|
-
if (description.resolve) {
|
|
29
|
-
const serverDescription = {
|
|
30
|
-
...description,
|
|
31
|
-
resolveId: (0, uuid_1.generateUuid)(),
|
|
32
|
-
};
|
|
33
|
-
// store only the name and resolve function
|
|
34
|
-
if (serverDescription.resolveId) {
|
|
35
|
-
this.serverDescriptions.set(serverDescription.resolveId, {
|
|
36
|
-
name: description.name,
|
|
37
|
-
resolve: description.resolve
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return serverDescription;
|
|
41
|
-
}
|
|
42
|
-
return description;
|
|
43
|
-
}
|
|
44
|
-
getResolveFunction(name) {
|
|
45
|
-
for (const storedInfo of this.serverDescriptions.values()) {
|
|
46
|
-
if (storedInfo.name === name) {
|
|
47
|
-
return storedInfo.resolve;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
async resolveServerDescription(description) {
|
|
53
|
-
const cleanDescription = (0, mcp_protocol_1.cleanServerDescription)(description);
|
|
54
|
-
if (description.resolveId) {
|
|
55
|
-
const storedInfo = this.serverDescriptions.get(description.resolveId);
|
|
56
|
-
if (storedInfo === null || storedInfo === void 0 ? void 0 : storedInfo.resolve) {
|
|
57
|
-
const updated = await storedInfo.resolve(cleanDescription);
|
|
58
|
-
if (updated) {
|
|
59
|
-
return updated;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return cleanDescription;
|
|
64
|
-
}
|
|
65
|
-
cleanServers(serverNames) {
|
|
66
|
-
const currentNamesSet = new Set(serverNames);
|
|
67
|
-
// Remove descriptions for servers that no longer exist
|
|
68
|
-
for (const [resolveId, storedInfo] of this.serverDescriptions.entries()) {
|
|
69
|
-
if (storedInfo.name && !currentNamesSet.has(storedInfo.name)) {
|
|
70
|
-
console.debug('Removing a frontend stored resolve function because the corresponding MCP server was removed', storedInfo);
|
|
71
|
-
this.serverDescriptions.delete(resolveId);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
exports.MCPServerManagerServerClientImpl = MCPServerManagerServerClientImpl;
|
|
77
|
-
exports.MCPServerManagerServerClientImpl = MCPServerManagerServerClientImpl = tslib_1.__decorate([
|
|
78
|
-
(0, inversify_1.injectable)()
|
|
79
|
-
], MCPServerManagerServerClientImpl);
|
|
80
|
-
//# sourceMappingURL=mcp-server-manager-server-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-manager-server-client.js","sourceRoot":"","sources":["../../src/browser/mcp-server-manager-server-client.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,4CAA4C;AAC5C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAA0D;AAE1D,sDAA2D;AAC3D,yDAAuH;AAKhH,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAAtC;QAEO,uBAAkB,GAAkC,IAAI,GAAG,EAAE,CAAC;IAuD5E,CAAC;IArDG,oBAAoB,CAAC,WAAiC;QAClD,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,iBAAiB,GAA4B;gBAC/C,GAAG,WAAW;gBACd,SAAS,EAAE,IAAA,mBAAY,GAAE;aAC5B,CAAC;YAEF,2CAA2C;YAC3C,IAAI,iBAAiB,CAAC,SAAS,EAAE,CAAC;gBAC9B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,EAAE;oBACrD,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,OAAO,EAAE,WAAW,CAAC,OAAO;iBAC/B,CAAC,CAAC;YACP,CAAC;YAED,OAAO,iBAAiB,CAAC;QAC7B,CAAC;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,kBAAkB,CAAC,IAAY;QAC3B,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC;YACxD,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO,UAAU,CAAC,OAAO,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,OAAO,SAAS,CAAC;I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sB,CAAC"}
|
package/lib/common/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
// *****************************************************************************
|
|
5
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
6
|
-
//
|
|
7
|
-
// This program and the accompanying materials are made available under the
|
|
8
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
-
//
|
|
11
|
-
// This Source Code may also be made available under the following Secondary
|
|
12
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
-
// with the GNU Classpath Exception which is available at
|
|
15
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
16
|
-
//
|
|
17
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
18
|
-
// *****************************************************************************
|
|
19
|
-
tslib_1.__exportStar(require("./mcp-server-manager"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/lib/common/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,+DAAqC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-preferences.d.ts","sourceRoot":"","sources":["../../src/common/mcp-preferences.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAE7D,eAAO,MAAM,0BAA0B,EAAE,gBAgGxC,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.McpServersPreferenceSchema = exports.MCP_SERVERS_PREF = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
exports.MCP_SERVERS_PREF = 'ai-features.mcp.mcpServers';
|
|
21
|
-
exports.McpServersPreferenceSchema = {
|
|
22
|
-
properties: {
|
|
23
|
-
[exports.MCP_SERVERS_PREF]: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/title', 'MCP Server Configuration'),
|
|
26
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/mdDescription', 'Configure MCP servers either local with command, \
|
|
27
|
-
arguments and optionally environment variables, \
|
|
28
|
-
or remote with server URL, authentication token and optionally an authentication header name. Additionally it is possible to configure autostart (true by default). \
|
|
29
|
-
Each server is identified by a unique key, such as "brave-search" or "filesystem". \
|
|
30
|
-
To start a server, use the "MCP: Start MCP Server" command, which enables you to select the desired server. \
|
|
31
|
-
To stop a server, use the "MCP: Stop MCP Server" command. \
|
|
32
|
-
Please note that autostart will only take effect after a restart, you need to start a server manually for the first time.\
|
|
33
|
-
\n\
|
|
34
|
-
Example configuration:\n\
|
|
35
|
-
```\
|
|
36
|
-
{\n\
|
|
37
|
-
"brave-search": {\n\
|
|
38
|
-
"command": "npx",\n\
|
|
39
|
-
"args": [\n\
|
|
40
|
-
"-y",\n\
|
|
41
|
-
"@modelcontextprotocol/server-brave-search"\n\
|
|
42
|
-
],\n\
|
|
43
|
-
"env": {\n\
|
|
44
|
-
"BRAVE_API_KEY": "YOUR_API_KEY"\n\
|
|
45
|
-
},\n\
|
|
46
|
-
},\n\
|
|
47
|
-
"filesystem": {\n\
|
|
48
|
-
"command": "npx",\n\
|
|
49
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/YOUR_USERNAME/Desktop"],\n\
|
|
50
|
-
"env": {\n\
|
|
51
|
-
"CUSTOM_ENV_VAR": "custom-value"\n\
|
|
52
|
-
},\n\
|
|
53
|
-
"autostart": false\n\
|
|
54
|
-
},\n\
|
|
55
|
-
"jira": {\n\
|
|
56
|
-
"serverUrl": "YOUR_JIRA_MCP_SERVER_URL",\n\
|
|
57
|
-
"serverAuthToken": "YOUR_JIRA_MCP_SERVER_TOKEN"\n\
|
|
58
|
-
}\n\
|
|
59
|
-
}\n```'),
|
|
60
|
-
additionalProperties: {
|
|
61
|
-
type: 'object',
|
|
62
|
-
properties: {
|
|
63
|
-
command: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/command/title', 'Command to execute the MCP server'),
|
|
66
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/command/mdDescription', 'The command used to start the MCP server, e.g., "uvx" or "npx".')
|
|
67
|
-
},
|
|
68
|
-
args: {
|
|
69
|
-
type: 'array',
|
|
70
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/args/title', 'Arguments for the command'),
|
|
71
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/args/mdDescription', 'An array of arguments to pass to the command.'),
|
|
72
|
-
},
|
|
73
|
-
env: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/env/title', 'Environment variables'),
|
|
76
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/env/mdDescription', 'Optional environment variables to set for the server, such as an API key.'),
|
|
77
|
-
additionalProperties: {
|
|
78
|
-
type: 'string'
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
autostart: {
|
|
82
|
-
type: 'boolean',
|
|
83
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/autostart/title', 'Autostart'),
|
|
84
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/autostart/mdDescription', 'Automatically start this server when the frontend starts. Newly added servers are not immediately auto started, but on restart'),
|
|
85
|
-
default: true
|
|
86
|
-
},
|
|
87
|
-
serverUrl: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/serverUrl/title', 'Server URL'),
|
|
90
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/serverUrl/mdDescription', 'The URL of the remote MCP server. If provided, the server will connect to this URL instead of starting a local process.'),
|
|
91
|
-
},
|
|
92
|
-
serverAuthToken: {
|
|
93
|
-
type: 'string',
|
|
94
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/serverAuthToken/title', 'Authentication Token'),
|
|
95
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/serverAuthToken/mdDescription', 'The authentication token for the server, if required. This is used to authenticate with the remote server.'),
|
|
96
|
-
},
|
|
97
|
-
serverAuthTokenHeader: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
100
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/mdDescription', 'The header name to use for the server authentication token. If not provided, "Authorization" with "Bearer" will be used.'),
|
|
101
|
-
},
|
|
102
|
-
headers: {
|
|
103
|
-
type: 'object',
|
|
104
|
-
title: core_1.nls.localize('theia/ai/mcp/servers/headers/title', 'Headers'),
|
|
105
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/headers/mdDescription', 'Optional additional headers included with each request to the server.'),
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
required: []
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=mcp-preferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-preferences.js","sourceRoot":"","sources":["../../src/common/mcp-preferences.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,sCAAoD;AAEvC,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAEhD,QAAA,0BAA0B,GAAqB;IACxD,UAAU,EAAE;QACR,CAAC,wBAAgB,CAAC,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,4BAA4B,EAAE,0BAA0B,CAAC;YAC7E,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiC7E,CAAC;YACI,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,OAAO,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,KAAK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EAAE;wBACnB,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,4BAA4B,CAAC;wBACrG,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,0DAA0D,EACxF,0HAA0H,CAAC;qBAClI;oBACD,OAAO,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE,SAAS,CAAC;wBACpE,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAC1E,uEAAuE,CAAC;qBAC/E;iBACJ;gBACD,QAAQ,EAAE,EAAE;aACf;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { MCPServerDescription } from './mcp-server-manager';
|
|
2
|
-
/**
|
|
3
|
-
* MCPServerDescriptionRCP is a version of MCPServerDescription that can be sent over RCP.
|
|
4
|
-
* It omits the 'resolve' function and instead includes an optional 'resolveId' to identify
|
|
5
|
-
* the resolve function on the client side.
|
|
6
|
-
*/
|
|
7
|
-
export type MCPServerDescriptionRCP = Omit<MCPServerDescription, 'resolve'> & {
|
|
8
|
-
resolveId?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const MCPServerManagerServer: unique symbol;
|
|
11
|
-
export declare const MCPServerManagerServerPath = "/services/mcpservermanagerserver";
|
|
12
|
-
/**
|
|
13
|
-
* The MCPServerManagerServer handles the RCP specialties of adding server descriptions from the frontend
|
|
14
|
-
*/
|
|
15
|
-
export interface MCPServerManagerServer {
|
|
16
|
-
addOrUpdateServer(description: MCPServerDescriptionRCP): Promise<void>;
|
|
17
|
-
setClient(client: MCPServerManagerServerClient): void;
|
|
18
|
-
}
|
|
19
|
-
export declare const MCPServerManagerServerClient: unique symbol;
|
|
20
|
-
export interface MCPServerManagerServerClient {
|
|
21
|
-
/**
|
|
22
|
-
* Adds a server description to the client. If the description contains a resolve function,
|
|
23
|
-
* a unique resolveId is generated and only the name and resolve function are stored.
|
|
24
|
-
* @param description The server description to add.
|
|
25
|
-
* @returns The server description with a unique resolveId if a resolve function is provided
|
|
26
|
-
* or the given description if no resolve function is provided.
|
|
27
|
-
*/
|
|
28
|
-
addServerDescription(description: MCPServerDescription): MCPServerDescriptionRCP;
|
|
29
|
-
/**
|
|
30
|
-
* Retrieves the resolve function for a given server name.
|
|
31
|
-
* @param name The name of the server to retrieve the resolve function for.
|
|
32
|
-
* @returns The resolve function if found, or undefined if not found.
|
|
33
|
-
*/
|
|
34
|
-
getResolveFunction(name: string): MCPServerDescription['resolve'];
|
|
35
|
-
/**
|
|
36
|
-
* Resolves the server description by calling the resolve function if it exists.
|
|
37
|
-
* @param description The server description to resolve.
|
|
38
|
-
* @returns The resolved server description.
|
|
39
|
-
*/
|
|
40
|
-
resolveServerDescription(description: MCPServerDescriptionRCP): Promise<MCPServerDescription>;
|
|
41
|
-
/**
|
|
42
|
-
* Removes server descriptions that are no longer present in the MCPServerManager.
|
|
43
|
-
*
|
|
44
|
-
* @param serverNames The current list of server names from the MCPServerManager.
|
|
45
|
-
*/
|
|
46
|
-
cleanServers(serverNames: string[]): void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Util function to convert a MCPServerDescriptionRCP to a MCPServerDescription by removing the resolveId.
|
|
50
|
-
*/
|
|
51
|
-
export declare const cleanServerDescription: (description: MCPServerDescriptionRCP) => MCPServerDescription;
|
|
52
|
-
//# sourceMappingURL=mcp-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-protocol.d.ts","sourceRoot":"","sources":["../../src/common/mcp-protocol.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AACvE,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,iBAAiB,CAAC,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,SAAS,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI,CAAA;CACxD;AAED,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AACnF,MAAM,WAAW,4BAA4B;IACzC;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAW,EAAE,oBAAoB,GAAG,uBAAuB,CAAC;IACjF;;;;OAIG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAClE;;;;OAIG;IACH,wBAAwB,CAAC,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9F;;;;OAIG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7C;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,uBAAuB,KAAG,oBAG7E,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.cleanServerDescription = exports.MCPServerManagerServerClient = exports.MCPServerManagerServerPath = exports.MCPServerManagerServer = void 0;
|
|
19
|
-
exports.MCPServerManagerServer = Symbol('MCPServerManagerServer');
|
|
20
|
-
exports.MCPServerManagerServerPath = '/services/mcpservermanagerserver';
|
|
21
|
-
exports.MCPServerManagerServerClient = Symbol('MCPServerManagerServerClient');
|
|
22
|
-
/**
|
|
23
|
-
* Util function to convert a MCPServerDescriptionRCP to a MCPServerDescription by removing the resolveId.
|
|
24
|
-
*/
|
|
25
|
-
const cleanServerDescription = (description) => {
|
|
26
|
-
const { resolveId, ...descriptionProperties } = description;
|
|
27
|
-
return { ...descriptionProperties };
|
|
28
|
-
};
|
|
29
|
-
exports.cleanServerDescription = cleanServerDescription;
|
|
30
|
-
//# sourceMappingURL=mcp-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-protocol.js","sourceRoot":"","sources":["../../src/common/mcp-protocol.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAanE,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAC1D,QAAA,0BAA0B,GAAG,kCAAkC,CAAC;AAUhE,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AA8BnF;;GAEG;AACI,MAAM,sBAAsB,GAAG,CAAC,WAAoC,EAAwB,EAAE;IACjG,MAAM,EAAE,SAAS,EAAE,GAAG,qBAAqB,EAAE,GAAG,WAAW,CAAC;IAC5D,OAAO,EAAE,GAAG,qBAAqB,EAA0B,CAAC;AAChE,CAAC,CAAC;AAHW,QAAA,sBAAsB,0BAGjC"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult, ListResourcesResult, ListToolsResult, ReadResourceResult } from '@modelcontextprotocol/sdk/types';
|
|
2
|
-
import { Event } from '@theia/core/lib/common/event';
|
|
3
|
-
export declare const MCPFrontendService: unique symbol;
|
|
4
|
-
export interface MCPFrontendService {
|
|
5
|
-
startServer(serverName: string): Promise<void>;
|
|
6
|
-
hasServer(serverName: string): Promise<boolean>;
|
|
7
|
-
isServerStarted(serverName: string): Promise<boolean>;
|
|
8
|
-
registerToolsForAllStartedServers(): Promise<void>;
|
|
9
|
-
stopServer(serverName: string): Promise<void>;
|
|
10
|
-
addOrUpdateServer(description: MCPServerDescription): Promise<void>;
|
|
11
|
-
getStartedServers(): Promise<string[]>;
|
|
12
|
-
getServerNames(): Promise<string[]>;
|
|
13
|
-
getServerDescription(name: string): Promise<MCPServerDescription | undefined>;
|
|
14
|
-
getTools(serverName: string): Promise<ListToolsResult | undefined>;
|
|
15
|
-
getPromptTemplateId(serverName: string): string;
|
|
16
|
-
}
|
|
17
|
-
export declare const MCPFrontendNotificationService: unique symbol;
|
|
18
|
-
export interface MCPFrontendNotificationService {
|
|
19
|
-
readonly onDidUpdateMCPServers: Event<void>;
|
|
20
|
-
didUpdateMCPServers(): void;
|
|
21
|
-
}
|
|
22
|
-
export interface MCPServer {
|
|
23
|
-
callTool(toolName: string, arg_string: string): Promise<CallToolResult>;
|
|
24
|
-
getTools(): Promise<ListToolsResult>;
|
|
25
|
-
readResource(resourceId: string): Promise<ReadResourceResult>;
|
|
26
|
-
getResources(): Promise<ListResourcesResult>;
|
|
27
|
-
description: MCPServerDescription;
|
|
28
|
-
}
|
|
29
|
-
export interface MCPServerManager {
|
|
30
|
-
callTool(serverName: string, toolName: string, arg_string: string): Promise<CallToolResult>;
|
|
31
|
-
removeServer(name: string): void;
|
|
32
|
-
addOrUpdateServer(description: MCPServerDescription): void;
|
|
33
|
-
getTools(serverName: string): Promise<ListToolsResult>;
|
|
34
|
-
getServerNames(): Promise<string[]>;
|
|
35
|
-
getServerDescription(name: string): Promise<MCPServerDescription | undefined>;
|
|
36
|
-
startServer(serverName: string): Promise<void>;
|
|
37
|
-
stopServer(serverName: string): Promise<void>;
|
|
38
|
-
getRunningServers(): Promise<string[]>;
|
|
39
|
-
setClient(client: MCPFrontendNotificationService): void;
|
|
40
|
-
disconnectClient(client: MCPFrontendNotificationService): void;
|
|
41
|
-
readResource(serverName: string, resourceId: string): Promise<ReadResourceResult>;
|
|
42
|
-
getResources(serverName: string): Promise<ListResourcesResult>;
|
|
43
|
-
}
|
|
44
|
-
export interface ToolInformation {
|
|
45
|
-
name: string;
|
|
46
|
-
description?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare enum MCPServerStatus {
|
|
49
|
-
NotRunning = "Not Running",
|
|
50
|
-
NotConnected = "Not Connected",
|
|
51
|
-
Starting = "Starting",
|
|
52
|
-
Connecting = "Connecting",
|
|
53
|
-
Running = "Running",
|
|
54
|
-
Connected = "Connected",
|
|
55
|
-
Errored = "Errored"
|
|
56
|
-
}
|
|
57
|
-
export interface BaseMCPServerDescription {
|
|
58
|
-
/**
|
|
59
|
-
* The unique name of the MCP server.
|
|
60
|
-
*/
|
|
61
|
-
name: string;
|
|
62
|
-
/**
|
|
63
|
-
* Flag indicating whether the server should automatically start when the application starts.
|
|
64
|
-
*/
|
|
65
|
-
autostart?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* The current status of the server. Optional because only set by the server.
|
|
68
|
-
*/
|
|
69
|
-
status?: MCPServerStatus;
|
|
70
|
-
/**
|
|
71
|
-
* Last error message that the server has returned.
|
|
72
|
-
*/
|
|
73
|
-
error?: string;
|
|
74
|
-
/**
|
|
75
|
-
* List of available tools for the server. Returns the name and description if available.
|
|
76
|
-
*/
|
|
77
|
-
tools?: ToolInformation[];
|
|
78
|
-
/**
|
|
79
|
-
* Optional resolve function that gets called during server definition resolution.
|
|
80
|
-
* This function can be used to dynamically modify server configurations,
|
|
81
|
-
* resolve environment variables, validate configurations, or perform any
|
|
82
|
-
* necessary preprocessing before the server starts.
|
|
83
|
-
*
|
|
84
|
-
* @param description The current server description
|
|
85
|
-
* @returns A promise that resolves to the processed server description
|
|
86
|
-
*/
|
|
87
|
-
resolve?: (description: MCPServerDescription) => Promise<MCPServerDescription>;
|
|
88
|
-
}
|
|
89
|
-
export interface LocalMCPServerDescription extends BaseMCPServerDescription {
|
|
90
|
-
/**
|
|
91
|
-
* The command to execute the MCP server.
|
|
92
|
-
*/
|
|
93
|
-
command: string;
|
|
94
|
-
/**
|
|
95
|
-
* An array of arguments to pass to the command.
|
|
96
|
-
*/
|
|
97
|
-
args?: string[];
|
|
98
|
-
/**
|
|
99
|
-
* Optional environment variables to set when starting the server.
|
|
100
|
-
*/
|
|
101
|
-
env?: {
|
|
102
|
-
[key: string]: string;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
export interface RemoteMCPServerDescription extends BaseMCPServerDescription {
|
|
106
|
-
/**
|
|
107
|
-
* The URL of the remote MCP server.
|
|
108
|
-
*/
|
|
109
|
-
serverUrl: string;
|
|
110
|
-
/**
|
|
111
|
-
* The authentication token for the server, if required.
|
|
112
|
-
*/
|
|
113
|
-
serverAuthToken?: string;
|
|
114
|
-
/**
|
|
115
|
-
* The header name to use for the server authentication token.
|
|
116
|
-
*/
|
|
117
|
-
serverAuthTokenHeader?: string;
|
|
118
|
-
/**
|
|
119
|
-
* Optional additional headers to include in requests to the server.
|
|
120
|
-
*/
|
|
121
|
-
headers?: Record<string, string>;
|
|
122
|
-
}
|
|
123
|
-
export type MCPServerDescription = LocalMCPServerDescription | RemoteMCPServerDescription;
|
|
124
|
-
export declare function isLocalMCPServerDescription(description: MCPServerDescription): description is LocalMCPServerDescription;
|
|
125
|
-
export declare function isRemoteMCPServerDescription(description: MCPServerDescription): description is RemoteMCPServerDescription;
|
|
126
|
-
export declare const MCPServerManager: unique symbol;
|
|
127
|
-
export declare const MCPServerManagerPath = "/services/mcpservermanager";
|
|
128
|
-
//# sourceMappingURL=mcp-server-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-manager.d.ts","sourceRoot":"","sources":["../../src/common/mcp-server-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChI,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,MAAM,WAAW,kBAAkB;IAC/B,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAC9E,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACnE,mBA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ACxE;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,0BAA0B,CAAC;AAE1F,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,oBAAoB,GAAG,WAAW,IAAI,yBAAyB,CAEvH;AACD,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,oBAAoB,GAAG,WAAW,IAAI,0BAA0B,CAEzH;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,oBAAoB,+BAA+B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.MCPServerManagerPath = exports.MCPServerManager = exports.isRemoteMCPServerDescription = exports.isLocalMCPServerDescription = exports.MCPServerStatus = exports.MCPFrontendNotificationService = exports.MCPFrontendService = void 0;
|
|
19
|
-
exports.MCPFrontendService = Symbol('MCPFrontendService');
|
|
20
|
-
exports.MCPFrontendNotificationService = Symbol('MCPFrontendNotificationService');
|
|
21
|
-
var MCPServerStatus;
|
|
22
|
-
(function (MCPServerStatus) {
|
|
23
|
-
MCPServerStatus["NotRunning"] = "Not Running";
|
|
24
|
-
MCPServerStatus["NotConnected"] = "Not Connected";
|
|
25
|
-
MCPServerStatus["Starting"] = "Starting";
|
|
26
|
-
MCPServerStatus["Connecting"] = "Connecting";
|
|
27
|
-
MCPServerStatus["Running"] = "Running";
|
|
28
|
-
MCPServerStatus["Connected"] = "Connected";
|
|
29
|
-
MCPServerStatus["Errored"] = "Errored";
|
|
30
|
-
})(MCPServerStatus || (exports.MCPServerStatus = MCPServerStatus = {}));
|
|
31
|
-
function isLocalMCPServerDescription(description) {
|
|
32
|
-
return description.command !== undefined;
|
|
33
|
-
}
|
|
34
|
-
exports.isLocalMCPServerDescription = isLocalMCPServerDescription;
|
|
35
|
-
function isRemoteMCPServerDescription(description) {
|
|
36
|
-
return description.serverUrl !== undefined;
|
|
37
|
-
}
|
|
38
|
-
exports.isRemoteMCPServerDescription = isRemoteMCPServerDescription;
|
|
39
|
-
exports.MCPServerManager = Symbol('MCPServerManager');
|
|
40
|
-
exports.MCPServerManagerPath = '/services/mcpservermanager';
|
|
41
|
-
//# sourceMappingURL=mcp-server-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-manager.js","sourceRoot":"","sources":["../../src/common/mcp-server-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAKnE,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAelD,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAmCvF,IAAY,eAQX;AARD,WAAY,eAAe;IACvB,6CAA0B,CAAA;IAC1B,iDAA8B,CAAA;IAC9B,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;AACvB,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAiFD,SAAgB,2BAA2B,CAAC,WAAiC;IACzE,OAAQ,WAAyC,CAAC,OAAO,KAAK,SAAS,CAAC;AAC5E,CAAC;AAFD,kEAEC;AACD,SAAgB,4BAA4B,CAAC,WAAiC;IAC1E,OAAQ,WAA0C,CAAC,SAAS,KAAK,SAAS,CAAC;AAC/E,CAAC;AAFD,oEAEC;AAEY,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,oBAAoB,GAAG,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/mcp-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAkC/D,wBAGG"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
const mcp_server_manager_impl_1 = require("./mcp-server-manager-impl");
|
|
21
|
-
const mcp_server_manager_1 = require("../common/mcp-server-manager");
|
|
22
|
-
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
23
|
-
const mcp_preferences_1 = require("../common/mcp-preferences");
|
|
24
|
-
const mcp_server_manager_server_1 = require("./mcp-server-manager-server");
|
|
25
|
-
const mcp_protocol_1 = require("../common/mcp-protocol");
|
|
26
|
-
// We use a connection module to handle AI services separately for each frontend.
|
|
27
|
-
const mcpConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
28
|
-
bind(mcp_server_manager_1.MCPServerManager).to(mcp_server_manager_impl_1.MCPServerManagerImpl).inSingletonScope();
|
|
29
|
-
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(mcp_server_manager_1.MCPServerManagerPath, client => {
|
|
30
|
-
const server = ctx.container.get(mcp_server_manager_1.MCPServerManager);
|
|
31
|
-
server.setClient(client);
|
|
32
|
-
client.onDidCloseConnection(() => server.disconnectClient(client));
|
|
33
|
-
return server;
|
|
34
|
-
})).inSingletonScope();
|
|
35
|
-
bind(mcp_protocol_1.MCPServerManagerServer).to(mcp_server_manager_server_1.MCPServerManagerServerImpl).inSingletonScope();
|
|
36
|
-
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(mcp_protocol_1.MCPServerManagerServerPath, client => {
|
|
37
|
-
const server = ctx.container.get(mcp_protocol_1.MCPServerManagerServer);
|
|
38
|
-
server.setClient(client);
|
|
39
|
-
return server;
|
|
40
|
-
})).inSingletonScope();
|
|
41
|
-
});
|
|
42
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
43
|
-
bind(core_1.PreferenceContribution).toConstantValue({ schema: mcp_preferences_1.McpServersPreferenceSchema });
|
|
44
|
-
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(mcpConnectionModule);
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=mcp-backend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-backend-module.js","sourceRoot":"","sources":["../../src/node/mcp-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4DAA+D;AAC/D,sCAA8F;AAC9F,uEAAiE;AACjE,qEAIsC;AACtC,4GAAuG;AACvG,+DAAuE;AACvE,2EAAyE;AACzE,yDAA0H;AAE1H,iFAAiF;AACjF,MAAM,mBAAmB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAC/G,IAAI,CAAC,qCAAgB,CAAC,CAAC,EAAE,CAAC,8CAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,2BAAoB,CAClE,yCAAoB,EAAE,MAAM,CAAC,EAAE;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAmB,qCAAgB,CAAC,CAAC;QACrE,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