@theia/ai-mcp 1.57.0-next.112
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 +91 -0
- package/lib/browser/mcp-command-contribution.d.ts +21 -0
- package/lib/browser/mcp-command-contribution.d.ts.map +1 -0
- package/lib/browser/mcp-command-contribution.js +114 -0
- package/lib/browser/mcp-command-contribution.js.map +1 -0
- package/lib/browser/mcp-frontend-application-contribution.d.ts +30 -0
- package/lib/browser/mcp-frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-application-contribution.js +145 -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 +36 -0
- package/lib/browser/mcp-frontend-module.js.map +1 -0
- package/lib/browser/mcp-frontend-service.d.ts +15 -0
- package/lib/browser/mcp-frontend-service.d.ts.map +1 -0
- package/lib/browser/mcp-frontend-service.js +88 -0
- package/lib/browser/mcp-frontend-service.js.map +1 -0
- package/lib/browser/mcp-preferences.d.ts +4 -0
- package/lib/browser/mcp-preferences.d.ts.map +1 -0
- package/lib/browser/mcp-preferences.js +90 -0
- package/lib/browser/mcp-preferences.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-server-manager.d.ts +42 -0
- package/lib/common/mcp-server-manager.d.ts.map +1 -0
- package/lib/common/mcp-server-manager.js +21 -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 +34 -0
- package/lib/node/mcp-backend-module.js.map +1 -0
- package/lib/node/mcp-server-manager-impl.d.ts +14 -0
- package/lib/node/mcp-server-manager-impl.d.ts.map +1 -0
- package/lib/node/mcp-server-manager-impl.js +93 -0
- package/lib/node/mcp-server-manager-impl.js.map +1 -0
- package/lib/node/mcp-server.d.ts +19 -0
- package/lib/node/mcp-server.d.ts.map +1 -0
- package/lib/node/mcp-server.js +97 -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 +50 -0
- package/src/browser/mcp-command-contribution.ts +106 -0
- package/src/browser/mcp-frontend-application-contribution.ts +158 -0
- package/src/browser/mcp-frontend-module.ts +35 -0
- package/src/browser/mcp-frontend-service.ts +87 -0
- package/src/browser/mcp-preferences.ts +90 -0
- package/src/common/index.ts +16 -0
- package/src/common/mcp-server-manager.ts +63 -0
- package/src/node/mcp-backend-module.ts +37 -0
- package/src/node/mcp-server-manager-impl.ts +93 -0
- package/src/node/mcp-server.ts +111 -0
- package/src/package.spec.ts +28 -0
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
exports.MCP_SERVERS_PREF = 'ai-features.mcp.mcpServers';
|
|
20
|
+
exports.McpServersPreferenceSchema = {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
[exports.MCP_SERVERS_PREF]: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
title: 'MCP Servers Configuration',
|
|
26
|
+
markdownDescription: 'Configure MCP servers with command, arguments, optionally environment variables, and autostart.\
|
|
27
|
+
Each server is identified by a unique key, such as "brave-search" or "filesystem".\
|
|
28
|
+
To start a server, use the "MCP: Start MCP Server" command, which enables you to select the desired server.\
|
|
29
|
+
To stop a server, use the "MCP: Stop MCP Server" command.\
|
|
30
|
+
\n\
|
|
31
|
+
Example configuration:\n\
|
|
32
|
+
```\
|
|
33
|
+
{\n\
|
|
34
|
+
"brave-search": {\n\
|
|
35
|
+
"command": "npx",\n\
|
|
36
|
+
"args": [\n\
|
|
37
|
+
"-y",\n\
|
|
38
|
+
"@modelcontextprotocol/server-brave-search"\n\
|
|
39
|
+
],\n\
|
|
40
|
+
"env": {\n\
|
|
41
|
+
"BRAVE_API_KEY": "YOUR_API_KEY"\n\
|
|
42
|
+
},\n\
|
|
43
|
+
"autostart": true\n\
|
|
44
|
+
},\n\
|
|
45
|
+
"filesystem": {\n\
|
|
46
|
+
"command": "npx",\n\
|
|
47
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/YOUR_USERNAME/Desktop"],\n\
|
|
48
|
+
"env": {\n\
|
|
49
|
+
"CUSTOM_ENV_VAR": "custom-value"\n\
|
|
50
|
+
},\n\
|
|
51
|
+
"autostart": false\n\
|
|
52
|
+
}\n\
|
|
53
|
+
}\n ```',
|
|
54
|
+
additionalProperties: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
command: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
title: 'Command to execute the MCP server',
|
|
60
|
+
markdownDescription: 'The command used to start the MCP server, e.g., "uvx" or "npx".'
|
|
61
|
+
},
|
|
62
|
+
args: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
title: 'Arguments for the command',
|
|
65
|
+
markdownDescription: 'An array of arguments to pass to the command.',
|
|
66
|
+
items: {
|
|
67
|
+
type: 'string'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
env: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
title: 'Environment variables',
|
|
73
|
+
markdownDescription: 'Optional environment variables to set for the server, such as an API key.',
|
|
74
|
+
additionalProperties: {
|
|
75
|
+
type: 'string'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
autostart: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
title: 'Autostart',
|
|
81
|
+
markdownDescription: 'Automatically start this server when the frontend starts. Newly added servers are not immediatly auto stated.',
|
|
82
|
+
default: false
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
required: ['command', 'args']
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=mcp-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-preferences.js","sourceRoot":"","sources":["../../src/browser/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;;;AAInE,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAEhD,QAAA,0BAA0B,GAAqB;IACxD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,CAAC,wBAAgB,CAAC,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,2BAA2B;YAClC,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA2BF;YACnB,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,OAAO,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,mCAAmC;wBAC1C,mBAAmB,EAAE,iEAAiE;qBACzF;oBACD,IAAI,EAAE;wBACF,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,2BAA2B;wBAClC,mBAAmB,EAAE,+CAA+C;wBACpE,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;yBACjB;qBACJ;oBACD,GAAG,EAAE;wBACD,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,uBAAuB;wBAC9B,mBAAmB,EAAE,2EAA2E;wBAChG,oBAAoB,EAAE;4BAClB,IAAI,EAAE,QAAQ;yBACjB;qBACJ;oBACD,SAAS,EAAE;wBACP,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,WAAW;wBAClB,mBAAmB,EAAE,+GAA+G;wBACpI,OAAO,EAAE,KAAK;qBACjB;iBACJ;gBACD,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;aAChC;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAeA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Client } from '@modelcontextprotocol/sdk/client/index';
|
|
2
|
+
export interface MCPServer {
|
|
3
|
+
callTool(toolName: string, arg_string: string): ReturnType<Client['callTool']>;
|
|
4
|
+
getTools(): ReturnType<Client['listTools']>;
|
|
5
|
+
}
|
|
6
|
+
export interface MCPServerManager {
|
|
7
|
+
callTool(serverName: string, toolName: string, arg_string: string): ReturnType<MCPServer['callTool']>;
|
|
8
|
+
removeServer(name: string): void;
|
|
9
|
+
addOrUpdateServer(description: MCPServerDescription): void;
|
|
10
|
+
getTools(serverName: string): ReturnType<MCPServer['getTools']>;
|
|
11
|
+
getServerNames(): Promise<string[]>;
|
|
12
|
+
startServer(serverName: string): Promise<void>;
|
|
13
|
+
stopServer(serverName: string): Promise<void>;
|
|
14
|
+
getStartedServers(): Promise<string[]>;
|
|
15
|
+
}
|
|
16
|
+
export interface MCPServerDescription {
|
|
17
|
+
/**
|
|
18
|
+
* The unique name of the MCP server.
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* The command to execute the MCP server.
|
|
23
|
+
*/
|
|
24
|
+
command: string;
|
|
25
|
+
/**
|
|
26
|
+
* An array of arguments to pass to the command.
|
|
27
|
+
*/
|
|
28
|
+
args?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Optional environment variables to set when starting the server.
|
|
31
|
+
*/
|
|
32
|
+
env?: {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Flag indicating whether the server should automatically start when the application starts.
|
|
37
|
+
*/
|
|
38
|
+
autostart?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const MCPServerManager: unique symbol;
|
|
41
|
+
export declare const MCPServerManagerPath = "/services/mcpservermanager";
|
|
42
|
+
//# sourceMappingURL=mcp-server-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-manager.d.ts","sourceRoot":"","sources":["../../src/common/mcp-server-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAErE,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/E,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACtG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAA;IAC/D,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,oBAAoB,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 = void 0;
|
|
19
|
+
exports.MCPServerManager = Symbol('MCPServerManager');
|
|
20
|
+
exports.MCPServerManagerPath = '/services/mcpservermanager';
|
|
21
|
+
//# sourceMappingURL=mcp-server-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;;AA+CnE,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,oBAAoB,GAAG,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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;;AAkB/D,wBAEG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
// We use a connection module to handle AI services separately for each frontend.
|
|
24
|
+
const mcpConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
25
|
+
bind(mcp_server_manager_1.MCPServerManager).to(mcp_server_manager_impl_1.MCPServerManagerImpl).inSingletonScope();
|
|
26
|
+
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(mcp_server_manager_1.MCPServerManagerPath, () => {
|
|
27
|
+
const service = ctx.container.get(mcp_server_manager_1.MCPServerManager);
|
|
28
|
+
return service;
|
|
29
|
+
})).inSingletonScope();
|
|
30
|
+
});
|
|
31
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
32
|
+
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(mcpConnectionModule);
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=mcp-backend-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,sCAAsE;AACtE,uEAAiE;AACjE,qEAAsF;AACtF,4GAAuG;AAEvG,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,EACpB,GAAG,EAAE;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAmB,qCAAgB,CAAC,CAAC;QACtE,OAAO,OAAO,CAAC;IACnB,CAAC,CACJ,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MCPServerDescription, MCPServerManager } from '../common/mcp-server-manager';
|
|
2
|
+
import { MCPServer } from './mcp-server';
|
|
3
|
+
export declare class MCPServerManagerImpl implements MCPServerManager {
|
|
4
|
+
protected servers: Map<string, MCPServer>;
|
|
5
|
+
stopServer(serverName: string): Promise<void>;
|
|
6
|
+
getStartedServers(): Promise<string[]>;
|
|
7
|
+
callTool(serverName: string, toolName: string, arg_string: string): ReturnType<MCPServer['callTool']>;
|
|
8
|
+
startServer(serverName: string): Promise<void>;
|
|
9
|
+
getServerNames(): Promise<string[]>;
|
|
10
|
+
getTools(serverName: string): ReturnType<MCPServer['getTools']>;
|
|
11
|
+
addOrUpdateServer(description: MCPServerDescription): void;
|
|
12
|
+
removeServer(name: string): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=mcp-server-manager-impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-manager-impl.d.ts","sourceRoot":"","sources":["../../src/node/mcp-server-manager-impl.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBACa,oBAAqB,YAAW,gBAAgB;IAEzD,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAa;IAEhD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7C,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5C,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAQ/F,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9C,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAS5E,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI;IAY1D,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CASnC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
}
|
|
26
|
+
async stopServer(serverName) {
|
|
27
|
+
const server = this.servers.get(serverName);
|
|
28
|
+
if (!server) {
|
|
29
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
30
|
+
}
|
|
31
|
+
server.stop();
|
|
32
|
+
console.log(`MCP server "${serverName}" stopped.`);
|
|
33
|
+
}
|
|
34
|
+
async getStartedServers() {
|
|
35
|
+
const startedServers = [];
|
|
36
|
+
for (const [name, server] of this.servers.entries()) {
|
|
37
|
+
if (server.isStarted()) {
|
|
38
|
+
startedServers.push(name);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return startedServers;
|
|
42
|
+
}
|
|
43
|
+
callTool(serverName, toolName, arg_string) {
|
|
44
|
+
const server = this.servers.get(serverName);
|
|
45
|
+
if (!server) {
|
|
46
|
+
throw new Error(`MCP server "${toolName}" not found.`);
|
|
47
|
+
}
|
|
48
|
+
return server.callTool(toolName, arg_string);
|
|
49
|
+
}
|
|
50
|
+
async startServer(serverName) {
|
|
51
|
+
const server = this.servers.get(serverName);
|
|
52
|
+
if (!server) {
|
|
53
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
54
|
+
}
|
|
55
|
+
await server.start();
|
|
56
|
+
}
|
|
57
|
+
async getServerNames() {
|
|
58
|
+
return Array.from(this.servers.keys());
|
|
59
|
+
}
|
|
60
|
+
async getTools(serverName) {
|
|
61
|
+
const server = this.servers.get(serverName);
|
|
62
|
+
if (!server) {
|
|
63
|
+
throw new Error(`MCP server "${serverName}" not found.`);
|
|
64
|
+
}
|
|
65
|
+
return server.getTools();
|
|
66
|
+
}
|
|
67
|
+
addOrUpdateServer(description) {
|
|
68
|
+
const { name, command, args, env } = description;
|
|
69
|
+
const existingServer = this.servers.get(name);
|
|
70
|
+
if (existingServer) {
|
|
71
|
+
existingServer.update(command, args, env);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const newServer = new mcp_server_1.MCPServer(name, command, args, env);
|
|
75
|
+
this.servers.set(name, newServer);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
removeServer(name) {
|
|
79
|
+
const server = this.servers.get(name);
|
|
80
|
+
if (server) {
|
|
81
|
+
server.stop();
|
|
82
|
+
this.servers.delete(name);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.warn(`MCP server "${name}" not found.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.MCPServerManagerImpl = MCPServerManagerImpl;
|
|
90
|
+
exports.MCPServerManagerImpl = MCPServerManagerImpl = tslib_1.__decorate([
|
|
91
|
+
(0, inversify_1.injectable)()
|
|
92
|
+
], MCPServerManagerImpl);
|
|
93
|
+
//# 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,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,4DAA0D;AAE1D,6CAAyC;AAGlC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QAEO,YAAO,GAA2B,IAAI,GAAG,EAAE,CAAC;IAsE1D,CAAC;IApEG,KAAK,CAAC,UAAU,CAAC,UAAkB;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,cAAc,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,eAAe,UAAU,YAAY,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACnB,MAAM,cAAc,GAAa,EAAE,CAAC;QACpC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAClD,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;gBACrB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,QAAQ,CAAC,U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OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YAC1D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACtC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,cAAc,CAAC,CAAC;QACpD,CAAC;IACL,CAAC;CACJ,CAAA;AAxEY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAwEhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
+
export declare class MCPServer {
|
|
3
|
+
private name;
|
|
4
|
+
private command;
|
|
5
|
+
private args?;
|
|
6
|
+
private client;
|
|
7
|
+
private env?;
|
|
8
|
+
private started;
|
|
9
|
+
constructor(name: string, command: string, args?: string[], env?: Record<string, string>);
|
|
10
|
+
isStarted(): boolean;
|
|
11
|
+
start(): Promise<void>;
|
|
12
|
+
callTool(toolName: string, arg_string: string): ReturnType<Client['callTool']>;
|
|
13
|
+
getTools(): ReturnType<Client['listTools']>;
|
|
14
|
+
update(command: string, args?: string[], env?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
}): void;
|
|
17
|
+
stop(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=mcp-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/node/mcp-server.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,qBAAa,SAAS;IAClB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,IAAI,CAAC,CAAW;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAAC,CAA4B;IACxC,OAAO,CAAC,OAAO,CAAkB;gBAErB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOxF,SAAS,IAAI,OAAO;IAId,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAkB9E,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAIjD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAM/E,IAAI,IAAI,IAAI;CAQf"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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_1 = require("@modelcontextprotocol/sdk/client/stdio");
|
|
20
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
21
|
+
class MCPServer {
|
|
22
|
+
constructor(name, command, args, env) {
|
|
23
|
+
this.started = false;
|
|
24
|
+
this.name = name;
|
|
25
|
+
this.command = command;
|
|
26
|
+
this.args = args;
|
|
27
|
+
this.env = env;
|
|
28
|
+
}
|
|
29
|
+
isStarted() {
|
|
30
|
+
return this.started;
|
|
31
|
+
}
|
|
32
|
+
async start() {
|
|
33
|
+
var _a;
|
|
34
|
+
if (this.started) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
console.log(`Starting server "${this.name}" with command: ${this.command} and args: ${(_a = this.args) === null || _a === void 0 ? void 0 : _a.join(' ')} and env: ${JSON.stringify(this.env)}`);
|
|
38
|
+
// Filter process.env to exclude undefined values
|
|
39
|
+
const sanitizedEnv = Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined));
|
|
40
|
+
const mergedEnv = {
|
|
41
|
+
...sanitizedEnv,
|
|
42
|
+
...(this.env || {})
|
|
43
|
+
};
|
|
44
|
+
const transport = new stdio_1.StdioClientTransport({
|
|
45
|
+
command: this.command,
|
|
46
|
+
args: this.args,
|
|
47
|
+
env: mergedEnv,
|
|
48
|
+
});
|
|
49
|
+
transport.onerror = error => {
|
|
50
|
+
console.error('Error: ' + error);
|
|
51
|
+
};
|
|
52
|
+
this.client = new index_js_1.Client({
|
|
53
|
+
name: 'theia-client',
|
|
54
|
+
version: '1.0.0',
|
|
55
|
+
}, {
|
|
56
|
+
capabilities: {}
|
|
57
|
+
});
|
|
58
|
+
this.client.onerror = error => {
|
|
59
|
+
console.error('Error in MCP client: ' + error);
|
|
60
|
+
};
|
|
61
|
+
await this.client.connect(transport);
|
|
62
|
+
this.started = true;
|
|
63
|
+
}
|
|
64
|
+
async callTool(toolName, arg_string) {
|
|
65
|
+
let args;
|
|
66
|
+
try {
|
|
67
|
+
args = JSON.parse(arg_string);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error(`Failed to parse arguments for calling tool "${toolName}" in MCP server "${this.name}" with command "${this.command}".
|
|
71
|
+
Invalid JSON: ${arg_string}`, error);
|
|
72
|
+
}
|
|
73
|
+
const params = {
|
|
74
|
+
name: toolName,
|
|
75
|
+
arguments: args,
|
|
76
|
+
};
|
|
77
|
+
return this.client.callTool(params);
|
|
78
|
+
}
|
|
79
|
+
async getTools() {
|
|
80
|
+
return this.client.listTools();
|
|
81
|
+
}
|
|
82
|
+
update(command, args, env) {
|
|
83
|
+
this.command = command;
|
|
84
|
+
this.args = args;
|
|
85
|
+
this.env = env;
|
|
86
|
+
}
|
|
87
|
+
stop() {
|
|
88
|
+
if (!this.started || !this.client) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
console.log(`Stopping MCP server "${this.name}"`);
|
|
92
|
+
this.client.close();
|
|
93
|
+
this.started = false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.MCPServer = MCPServer;
|
|
97
|
+
//# 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,mE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E,IAAe,EAAE,GAA+B;QACpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,OAAO;QACX,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;CACJ;AA5FD,8BA4FC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=package.spec.d.ts.map
|
|
@@ -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
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@theia/ai-mcp",
|
|
3
|
+
"version": "1.57.0-next.112+f4778c273",
|
|
4
|
+
"description": "Theia - MCP Integration",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@modelcontextprotocol/sdk": "1.0.1",
|
|
7
|
+
"@theia/ai-core": "1.57.0-next.112+f4778c273",
|
|
8
|
+
"@theia/core": "1.57.0-next.112+f4778c273"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"theiaExtensions": [
|
|
14
|
+
{
|
|
15
|
+
"frontend": "lib/browser/mcp-frontend-module",
|
|
16
|
+
"backend": "lib/node/mcp-backend-module"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"theia-extension"
|
|
21
|
+
],
|
|
22
|
+
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/eclipse-theia/theia.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/eclipse-theia/theia/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/eclipse-theia/theia",
|
|
31
|
+
"files": [
|
|
32
|
+
"lib",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "theiaext build",
|
|
37
|
+
"clean": "theiaext clean",
|
|
38
|
+
"compile": "theiaext compile",
|
|
39
|
+
"lint": "theiaext lint",
|
|
40
|
+
"test": "theiaext test",
|
|
41
|
+
"watch": "theiaext watch"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@theia/ext-scripts": "1.58.0"
|
|
45
|
+
},
|
|
46
|
+
"nyc": {
|
|
47
|
+
"extends": "../../configs/nyc.json"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "f4778c2737bb75613f0e1f99da8996bad91f6e17"
|
|
50
|
+
}
|