@theia/ai-mcp 1.67.0-next.56 → 1.67.0-next.59
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/lib/browser/mcp-frontend-application-contribution.d.ts +42 -0
- package/lib/browser/mcp-frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-application-contribution.js +169 -0
- package/lib/browser/mcp-frontend-application-contribution.js.map +1 -0
- package/lib/browser/mcp-frontend-module.d.ts +4 -0
- package/lib/browser/mcp-frontend-module.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-module.js +81 -0
- package/lib/browser/mcp-frontend-module.js.map +1 -0
- package/lib/browser/mcp-frontend-notification-service.d.ts +8 -0
- package/lib/browser/mcp-frontend-notification-service.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-notification-service.js +35 -0
- package/lib/browser/mcp-frontend-notification-service.js.map +1 -0
- package/lib/browser/mcp-frontend-service.d.ts +23 -0
- package/lib/browser/mcp-frontend-service.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-service.js +151 -0
- package/lib/browser/mcp-frontend-service.js.map +1 -0
- package/lib/browser/mcp-server-manager-server-client.d.ts +12 -0
- package/lib/browser/mcp-server-manager-server-client.d.ts.map +1 -0
- package/lib/browser/mcp-server-manager-server-client.js +80 -0
- package/lib/browser/mcp-server-manager-server-client.js.map +1 -0
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +20 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/mcp-preferences.d.ts +4 -0
- package/lib/common/mcp-preferences.d.ts.map +1 -0
- package/lib/common/mcp-preferences.js +113 -0
- package/lib/common/mcp-preferences.js.map +1 -0
- package/lib/common/mcp-protocol.d.ts +52 -0
- package/lib/common/mcp-protocol.d.ts.map +1 -0
- package/lib/common/mcp-protocol.js +30 -0
- package/lib/common/mcp-protocol.js.map +1 -0
- package/lib/common/mcp-server-manager.d.ts +128 -0
- package/lib/common/mcp-server-manager.d.ts.map +1 -0
- package/lib/common/mcp-server-manager.js +41 -0
- package/lib/common/mcp-server-manager.js.map +1 -0
- package/lib/node/mcp-backend-module.d.ts +4 -0
- package/lib/node/mcp-backend-module.d.ts.map +1 -0
- package/lib/node/mcp-backend-module.js +46 -0
- package/lib/node/mcp-backend-module.js.map +1 -0
- package/lib/node/mcp-server-manager-impl.d.ts +24 -0
- package/lib/node/mcp-server-manager-impl.d.ts.map +1 -0
- package/lib/node/mcp-server-manager-impl.js +151 -0
- package/lib/node/mcp-server-manager-impl.js.map +1 -0
- package/lib/node/mcp-server-manager-server.d.ts +9 -0
- package/lib/node/mcp-server-manager-server.d.ts.map +1 -0
- package/lib/node/mcp-server-manager-server.js +53 -0
- package/lib/node/mcp-server-manager-server.js.map +1 -0
- package/lib/node/mcp-server.d.ts +25 -0
- package/lib/node/mcp-server.d.ts.map +1 -0
- package/lib/node/mcp-server.js +222 -0
- package/lib/node/mcp-server.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCPServerManagerImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// *****************************************************************************
|
|
6
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
7
|
+
//
|
|
8
|
+
// This program and the accompanying materials are made available under the
|
|
9
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
+
//
|
|
12
|
+
// This Source Code may also be made available under the following Secondary
|
|
13
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
+
// with the GNU Classpath Exception which is available at
|
|
16
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
+
//
|
|
18
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
+
// *****************************************************************************
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const mcp_server_1 = require("./mcp-server");
|
|
22
|
+
let MCPServerManagerImpl = class MCPServerManagerImpl {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.servers = new Map();
|
|
25
|
+
this.clients = [];
|
|
26
|
+
this.serverListeners = new Map();
|
|
27
|
+
}
|
|
28
|
+
async stopServer(serverName) {
|
|
29
|
+
const server = this.servers.get(serverName);
|
|
30
|
+
if (!server) {
|
|
31
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
32
|
+
}
|
|
33
|
+
await server.stop();
|
|
34
|
+
console.log(`MCP server "${serverName}" stopped.`);
|
|
35
|
+
this.notifyClients();
|
|
36
|
+
}
|
|
37
|
+
async getRunningServers() {
|
|
38
|
+
const runningServers = [];
|
|
39
|
+
for (const [name, server] of this.servers.entries()) {
|
|
40
|
+
if (server.isRunnning()) {
|
|
41
|
+
runningServers.push(name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return runningServers;
|
|
45
|
+
}
|
|
46
|
+
callTool(serverName, toolName, arg_string) {
|
|
47
|
+
const server = this.servers.get(serverName);
|
|
48
|
+
if (!server) {
|
|
49
|
+
throw new Error(`MCP server "${toolName}" not found.`);
|
|
50
|
+
}
|
|
51
|
+
return server.callTool(toolName, arg_string);
|
|
52
|
+
}
|
|
53
|
+
async startServer(serverName) {
|
|
54
|
+
const server = this.servers.get(serverName);
|
|
55
|
+
if (!server) {
|
|
56
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
57
|
+
}
|
|
58
|
+
const description = await server.getDescription();
|
|
59
|
+
if (description.resolve) {
|
|
60
|
+
const resolved = await description.resolve(description);
|
|
61
|
+
const isEqual = JSON.stringify(description) === JSON.stringify(resolved);
|
|
62
|
+
if (!isEqual) {
|
|
63
|
+
server.update(resolved);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
await server.start();
|
|
67
|
+
this.notifyClients();
|
|
68
|
+
}
|
|
69
|
+
async getServerNames() {
|
|
70
|
+
return Array.from(this.servers.keys());
|
|
71
|
+
}
|
|
72
|
+
async getServerDescription(name) {
|
|
73
|
+
const server = this.servers.get(name);
|
|
74
|
+
return server ? await server.getDescription() : undefined;
|
|
75
|
+
}
|
|
76
|
+
async getTools(serverName) {
|
|
77
|
+
const server = this.servers.get(serverName);
|
|
78
|
+
if (!server) {
|
|
79
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
80
|
+
}
|
|
81
|
+
return await server.getTools();
|
|
82
|
+
}
|
|
83
|
+
addOrUpdateServer(description) {
|
|
84
|
+
const existingServer = this.servers.get(description.name);
|
|
85
|
+
if (existingServer) {
|
|
86
|
+
existingServer.update(description);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const newServer = new mcp_server_1.MCPServer(description);
|
|
90
|
+
this.servers.set(description.name, newServer);
|
|
91
|
+
// Subscribe to status updates from the new server
|
|
92
|
+
const listener = newServer.onDidUpdateStatus(() => {
|
|
93
|
+
this.notifyClients();
|
|
94
|
+
});
|
|
95
|
+
// Store the listener for later disposal
|
|
96
|
+
this.serverListeners.set(description.name, listener);
|
|
97
|
+
}
|
|
98
|
+
this.notifyClients();
|
|
99
|
+
}
|
|
100
|
+
removeServer(name) {
|
|
101
|
+
const server = this.servers.get(name);
|
|
102
|
+
if (server) {
|
|
103
|
+
server.stop();
|
|
104
|
+
this.servers.delete(name);
|
|
105
|
+
// Clean up the status listener
|
|
106
|
+
const listener = this.serverListeners.get(name);
|
|
107
|
+
if (listener) {
|
|
108
|
+
listener.dispose();
|
|
109
|
+
this.serverListeners.delete(name);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
console.warn(`MCP server "${name}" not found.`);
|
|
114
|
+
}
|
|
115
|
+
this.notifyClients();
|
|
116
|
+
}
|
|
117
|
+
setClient(client) {
|
|
118
|
+
this.clients.push(client);
|
|
119
|
+
}
|
|
120
|
+
disconnectClient(client) {
|
|
121
|
+
const index = this.clients.indexOf(client);
|
|
122
|
+
if (index !== -1) {
|
|
123
|
+
this.clients.splice(index, 1);
|
|
124
|
+
}
|
|
125
|
+
this.servers.forEach(server => {
|
|
126
|
+
server.stop();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
notifyClients() {
|
|
130
|
+
this.clients.forEach(client => client.didUpdateMCPServers());
|
|
131
|
+
}
|
|
132
|
+
readResource(serverName, resourceId) {
|
|
133
|
+
const server = this.servers.get(serverName);
|
|
134
|
+
if (!server) {
|
|
135
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
136
|
+
}
|
|
137
|
+
return server.readResource(resourceId);
|
|
138
|
+
}
|
|
139
|
+
getResources(serverName) {
|
|
140
|
+
const server = this.servers.get(serverName);
|
|
141
|
+
if (!server) {
|
|
142
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
143
|
+
}
|
|
144
|
+
return server.getResources();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
exports.MCPServerManagerImpl = MCPServerManagerImpl;
|
|
148
|
+
exports.MCPServerManagerImpl = MCPServerManagerImpl = tslib_1.__decorate([
|
|
149
|
+
(0, inversify_1.injectable)()
|
|
150
|
+
], MCPServerManagerImpl);
|
|
151
|
+
//# sourceMappingURL=mcp-server-manager-impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-manager-impl.js","sourceRoot":"","sources":["../../src/node/mcp-server-manager-impl.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6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AC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,cAAc,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC;IACjC,CAAC;CACJ,CAAA;AA3IY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA2IhC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MCPServerManager } from '../common';
|
|
2
|
+
import { MCPServerDescriptionRCP, MCPServerManagerServer, MCPServerManagerServerClient } from '../common/mcp-protocol';
|
|
3
|
+
export declare class MCPServerManagerServerImpl implements MCPServerManagerServer {
|
|
4
|
+
protected readonly mcpServerManager: MCPServerManager;
|
|
5
|
+
protected client: MCPServerManagerServerClient;
|
|
6
|
+
setClient(client: MCPServerManagerServerClient): void;
|
|
7
|
+
addOrUpdateServer(descriptionRCP: MCPServerDescriptionRCP): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=mcp-server-manager-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-manager-server.d.ts","sourceRoot":"","sources":["../../src/node/mcp-server-manager-server.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAA0B,uBAAuB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAE/I,qBACa,0BAA2B,YAAW,sBAAsB;IAGrE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAE/C,SAAS,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI;IAI/C,iBAAiB,CAAC,cAAc,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBlF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.MCPServerManagerServerImpl = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const common_1 = require("../common");
|
|
22
|
+
const mcp_protocol_1 = require("../common/mcp-protocol");
|
|
23
|
+
let MCPServerManagerServerImpl = class MCPServerManagerServerImpl {
|
|
24
|
+
setClient(client) {
|
|
25
|
+
this.client = client;
|
|
26
|
+
}
|
|
27
|
+
async addOrUpdateServer(descriptionRCP) {
|
|
28
|
+
const description = (0, mcp_protocol_1.cleanServerDescription)(descriptionRCP);
|
|
29
|
+
if (descriptionRCP.resolveId) {
|
|
30
|
+
description.resolve = async (desc) => {
|
|
31
|
+
if (this.client) {
|
|
32
|
+
const descRCP = {
|
|
33
|
+
...desc,
|
|
34
|
+
resolveId: descriptionRCP.resolveId
|
|
35
|
+
};
|
|
36
|
+
return this.client.resolveServerDescription(descRCP);
|
|
37
|
+
}
|
|
38
|
+
return desc; // Fallback if no client is set
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
this.mcpServerManager.addOrUpdateServer(description);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.MCPServerManagerServerImpl = MCPServerManagerServerImpl;
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, inversify_1.inject)(common_1.MCPServerManager),
|
|
48
|
+
tslib_1.__metadata("design:type", Object)
|
|
49
|
+
], MCPServerManagerServerImpl.prototype, "mcpServerManager", void 0);
|
|
50
|
+
exports.MCPServerManagerServerImpl = MCPServerManagerServerImpl = tslib_1.__decorate([
|
|
51
|
+
(0, inversify_1.injectable)()
|
|
52
|
+
], MCPServerManagerServerImpl);
|
|
53
|
+
//# sourceMappingURL=mcp-server-manager-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-manager-server.js","sourceRoot":"","sources":["../../src/node/mcp-server-manager-server.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,4DAAkE;AAClE,sCAAmE;AACnE,yDAA+I;AAGxI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAOnC,SAAS,CAAC,MAAoC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,cAAuC;QAC3D,MAAM,WAAW,GAAG,IAAA,qCAAsB,EAAC,cAAc,CAAC,CAAC;QAC3D,IAAI,cAAc,CAAC,SAAS,EAAE,CAAC;YAC3B,WAAW,CAAC,OAAO,GAAG,KAAK,EAAE,IAA0B,EAAE,EAAE;gBACvD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;oBACd,MAAM,OAAO,GAA4B;wBACrC,GAAG,IAAI;wBACP,SAAS,EAAE,cAAc,CAAC,SAAS;qBACtC,CAAC;oBACF,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBACD,OAAO,IAAI,CAAC,CAAC,+BAA+B;YAChD,CAAC,CAAC;QACN,CAAC;QAAA,CAAC;QACF,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;CACJ,CAAA;AA3BY,gEAA0B;AAGhB;IADlB,IAAA,kBAAM,EAAC,yBAAgB,CAAC;;oEAC6B;qCAH7C,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA2BtC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
+
import { MCPServerDescription, MCPServerStatus } from '../common';
|
|
3
|
+
import { CallToolResult, ListResourcesResult, ReadResourceResult } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
+
export declare class MCPServer {
|
|
5
|
+
private description;
|
|
6
|
+
private transport;
|
|
7
|
+
private client;
|
|
8
|
+
private error?;
|
|
9
|
+
private status;
|
|
10
|
+
private readonly onDidUpdateStatusEmitter;
|
|
11
|
+
readonly onDidUpdateStatus: import("@theia/core/lib/common/event.js").Event<MCPServerStatus>;
|
|
12
|
+
constructor(description: MCPServerDescription);
|
|
13
|
+
getStatus(): MCPServerStatus;
|
|
14
|
+
setStatus(status: MCPServerStatus): void;
|
|
15
|
+
isRunnning(): boolean;
|
|
16
|
+
getDescription(): Promise<MCPServerDescription>;
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
callTool(toolName: string, arg_string: string): Promise<CallToolResult>;
|
|
19
|
+
getTools(): ReturnType<Client['listTools']>;
|
|
20
|
+
update(description: MCPServerDescription): void;
|
|
21
|
+
stop(): Promise<void>;
|
|
22
|
+
readResource(resourceId: string): Promise<ReadResourceResult>;
|
|
23
|
+
get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B,CAAC;CAG/C"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCPServer = void 0;
|
|
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
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
20
|
+
const sse_js_1 = require("@modelcontextprotocol/sdk/client/sse.js");
|
|
21
|
+
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
22
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
23
|
+
const common_1 = require("../common");
|
|
24
|
+
const event_js_1 = require("@theia/core/lib/common/event.js");
|
|
25
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
26
|
+
class MCPServer {
|
|
27
|
+
constructor(description) {
|
|
28
|
+
this.onDidUpdateStatusEmitter = new event_js_1.Emitter();
|
|
29
|
+
this.onDidUpdateStatus = this.onDidUpdateStatusEmitter.event;
|
|
30
|
+
this.update(description);
|
|
31
|
+
}
|
|
32
|
+
getStatus() {
|
|
33
|
+
return this.status;
|
|
34
|
+
}
|
|
35
|
+
setStatus(status) {
|
|
36
|
+
this.status = status;
|
|
37
|
+
this.onDidUpdateStatusEmitter.fire(status);
|
|
38
|
+
}
|
|
39
|
+
isRunnning() {
|
|
40
|
+
return this.status === common_1.MCPServerStatus.Running
|
|
41
|
+
|| this.status === common_1.MCPServerStatus.Connected;
|
|
42
|
+
}
|
|
43
|
+
async getDescription() {
|
|
44
|
+
let toReturnTools = undefined;
|
|
45
|
+
if (this.isRunnning()) {
|
|
46
|
+
try {
|
|
47
|
+
const { tools } = await this.getTools();
|
|
48
|
+
toReturnTools = tools.map(tool => ({
|
|
49
|
+
name: tool.name,
|
|
50
|
+
description: tool.description
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('Error fetching tools for description:', error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
...this.description,
|
|
59
|
+
status: this.status,
|
|
60
|
+
error: this.error,
|
|
61
|
+
tools: toReturnTools
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async start() {
|
|
65
|
+
var _a;
|
|
66
|
+
if (this.isRunnning()
|
|
67
|
+
&& (this.status === common_1.MCPServerStatus.Starting || this.status === common_1.MCPServerStatus.Connecting)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let connected = false;
|
|
71
|
+
this.client = new index_js_1.Client({
|
|
72
|
+
name: 'theia-client',
|
|
73
|
+
version: '1.0.0',
|
|
74
|
+
}, {
|
|
75
|
+
capabilities: {}
|
|
76
|
+
});
|
|
77
|
+
this.error = undefined;
|
|
78
|
+
if ((0, common_1.isLocalMCPServerDescription)(this.description)) {
|
|
79
|
+
this.setStatus(common_1.MCPServerStatus.Starting);
|
|
80
|
+
console.log(`Starting server "${this.description.name}" with command: ${this.description.command} ` +
|
|
81
|
+
`and args: ${(_a = this.description.args) === null || _a === void 0 ? void 0 : _a.join(' ')} and env: ${JSON.stringify(this.description.env)}`);
|
|
82
|
+
// Filter process.env to exclude undefined values
|
|
83
|
+
const sanitizedEnv = Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined));
|
|
84
|
+
const mergedEnv = {
|
|
85
|
+
...sanitizedEnv,
|
|
86
|
+
...(this.description.env || {})
|
|
87
|
+
};
|
|
88
|
+
this.transport = new stdio_js_1.StdioClientTransport({
|
|
89
|
+
command: this.description.command,
|
|
90
|
+
args: this.description.args,
|
|
91
|
+
env: mergedEnv,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else if ((0, common_1.isRemoteMCPServerDescription)(this.description)) {
|
|
95
|
+
this.setStatus(common_1.MCPServerStatus.Connecting);
|
|
96
|
+
console.log(`Connecting to server "${this.description.name}" via MCP Server Communication with URL: ${this.description.serverUrl}`);
|
|
97
|
+
let descHeaders;
|
|
98
|
+
if (this.description.headers) {
|
|
99
|
+
descHeaders = this.description.headers;
|
|
100
|
+
}
|
|
101
|
+
// create header for auth token
|
|
102
|
+
if (this.description.serverAuthToken) {
|
|
103
|
+
if (!descHeaders) {
|
|
104
|
+
descHeaders = {};
|
|
105
|
+
}
|
|
106
|
+
if (this.description.serverAuthTokenHeader) {
|
|
107
|
+
descHeaders = { ...descHeaders, [this.description.serverAuthTokenHeader]: this.description.serverAuthToken };
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
descHeaders = { ...descHeaders, Authorization: `Bearer ${this.description.serverAuthToken}` };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (descHeaders) {
|
|
114
|
+
this.transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(this.description.serverUrl), {
|
|
115
|
+
requestInit: { headers: descHeaders },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(this.description.serverUrl));
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await this.client.connect(this.transport);
|
|
123
|
+
connected = true;
|
|
124
|
+
console.log(`MCP Streamable HTTP successful connected: ${this.description.serverUrl}`);
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
console.log(`MCP SSE fallback initiated: ${this.description.serverUrl}`);
|
|
128
|
+
await this.client.close();
|
|
129
|
+
if (descHeaders) {
|
|
130
|
+
this.transport = new sse_js_1.SSEClientTransport(new URL(this.description.serverUrl), {
|
|
131
|
+
eventSourceInit: {
|
|
132
|
+
fetch: (url, init) => fetch(url, { ...init, headers: descHeaders }),
|
|
133
|
+
},
|
|
134
|
+
requestInit: { headers: descHeaders },
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.transport = new sse_js_1.SSEClientTransport(new URL(this.description.serverUrl));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.transport.onerror = error => {
|
|
143
|
+
console.error('Error: ', error);
|
|
144
|
+
this.error = 'Error: ' + error;
|
|
145
|
+
this.setStatus(common_1.MCPServerStatus.Errored);
|
|
146
|
+
};
|
|
147
|
+
this.client.onerror = error => {
|
|
148
|
+
console.error('Error in MCP client: ', error);
|
|
149
|
+
this.error = 'Error in MCP client: ' + error;
|
|
150
|
+
this.setStatus(common_1.MCPServerStatus.Errored);
|
|
151
|
+
};
|
|
152
|
+
try {
|
|
153
|
+
if (!connected) {
|
|
154
|
+
await this.client.connect(this.transport);
|
|
155
|
+
}
|
|
156
|
+
this.setStatus((0, common_1.isLocalMCPServerDescription)(this.description) ? common_1.MCPServerStatus.Running : common_1.MCPServerStatus.Connected);
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
this.error = 'Error on MCP startup: ' + e;
|
|
160
|
+
await this.client.close();
|
|
161
|
+
this.setStatus(common_1.MCPServerStatus.Errored);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async callTool(toolName, arg_string) {
|
|
165
|
+
let args;
|
|
166
|
+
try {
|
|
167
|
+
args = JSON.parse(arg_string);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
console.error(`Failed to parse arguments for calling tool "${toolName}" in MCP server "${this.description.name}".
|
|
171
|
+
Invalid JSON: ${arg_string}`, error);
|
|
172
|
+
}
|
|
173
|
+
const params = {
|
|
174
|
+
name: toolName,
|
|
175
|
+
arguments: args,
|
|
176
|
+
};
|
|
177
|
+
// need to cast since other result schemas (second parameter) might be possible
|
|
178
|
+
return this.client.callTool(params, types_js_1.CallToolResultSchema);
|
|
179
|
+
}
|
|
180
|
+
async getTools() {
|
|
181
|
+
if (this.isRunnning()) {
|
|
182
|
+
return this.client.listTools();
|
|
183
|
+
}
|
|
184
|
+
return { tools: [] };
|
|
185
|
+
}
|
|
186
|
+
update(description) {
|
|
187
|
+
this.description = description;
|
|
188
|
+
if ((0, common_1.isRemoteMCPServerDescription)(description)) {
|
|
189
|
+
this.status = common_1.MCPServerStatus.NotConnected;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
this.status = common_1.MCPServerStatus.NotRunning;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async stop() {
|
|
196
|
+
if (!this.isRunnning() || !this.client) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if ((0, common_1.isLocalMCPServerDescription)(this.description)) {
|
|
200
|
+
console.log(`Stopping MCP server "${this.description.name}"`);
|
|
201
|
+
this.setStatus(common_1.MCPServerStatus.NotRunning);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
console.log(`Disconnecting MCP server "${this.description.name}"`);
|
|
205
|
+
if (this.transport instanceof streamableHttp_js_1.StreamableHTTPClientTransport) {
|
|
206
|
+
console.log(`Terminating session for MCP server "${this.description.name}"`);
|
|
207
|
+
await this.transport.terminateSession();
|
|
208
|
+
}
|
|
209
|
+
this.setStatus(common_1.MCPServerStatus.NotConnected);
|
|
210
|
+
}
|
|
211
|
+
await this.client.close();
|
|
212
|
+
}
|
|
213
|
+
readResource(resourceId) {
|
|
214
|
+
const params = { uri: resourceId };
|
|
215
|
+
return this.client.readResource(params);
|
|
216
|
+
}
|
|
217
|
+
getResources() {
|
|
218
|
+
return this.client.listResources();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.MCPServer = MCPServer;
|
|
222
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/node/mcp-server.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,wEAAiF;AACjF,oEAA6E;AAC7E,0FAAmG;AACnG,wEAAmE;AACnE,sCAA8I;AAC9I,8DAA0D;AAC1D,iEAAmI;AAGnI,MAAa,SAAS;IAUlB,YAAY,WAAiC;QAH5B,6BAAwB,GAAG,IAAI,kBAAO,EAAmB,CAAC;QAClE,sBAAiB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;QAG7D,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,MAAuB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,MAAM,KAAK,wBAAe,CAAC,OAAO;eACvC,IAAI,CAAC,MAAM,KAAK,wBAAe,CAAC,SAAS,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,cAAc;QAChB,IAAI,aAAa,GAAkC,SAAS,CAAC;QAC7D,IAAI,IAAI,C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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 EclipseSource GmbH and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/* note: this bogus test file is required so that
|
|
17
|
+
we are able to run mocha unit tests on this
|
|
18
|
+
package, without having any actual unit tests in it.
|
|
19
|
+
This way a coverage report will be generated,
|
|
20
|
+
showing 0% coverage, instead of no report.
|
|
21
|
+
This file can be removed once we have real unit
|
|
22
|
+
tests in place. */
|
|
23
|
+
describe('ai-mcp package', () => {
|
|
24
|
+
it('support code coverage statistics', () => true);
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=package.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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;;;;;;qBAMqB;AAErB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAE5B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-mcp",
|
|
3
|
-
"version": "1.67.0-next.
|
|
3
|
+
"version": "1.67.0-next.59+3f14297ea",
|
|
4
4
|
"description": "Theia - MCP Integration",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
7
|
-
"@theia/ai-core": "1.67.0-next.
|
|
8
|
-
"@theia/core": "1.67.0-next.
|
|
7
|
+
"@theia/ai-core": "1.67.0-next.59+3f14297ea",
|
|
8
|
+
"@theia/core": "1.67.0-next.59+3f14297ea"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"nyc": {
|
|
48
48
|
"extends": "../../configs/nyc.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "3f14297ea2edcdb1fffd74afee0613e70b43e125"
|
|
51
51
|
}
|