@theia/ai-mcp 1.65.0-next.6 → 1.65.0
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 +2 -1
- package/lib/browser/mcp-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/mcp-frontend-application-contribution.js +4 -4
- package/lib/browser/mcp-frontend-application-contribution.js.map +1 -1
- package/lib/common/mcp-preferences.d.ts +4 -0
- package/lib/common/mcp-preferences.d.ts.map +1 -0
- package/lib/{browser → common}/mcp-preferences.js +29 -8
- package/lib/common/mcp-preferences.js.map +1 -0
- package/lib/node/mcp-backend-module.d.ts.map +1 -1
- package/lib/node/mcp-backend-module.js +2 -0
- package/lib/node/mcp-backend-module.js.map +1 -1
- package/package.json +5 -5
- package/src/browser/mcp-frontend-application-contribution.ts +4 -3
- package/src/common/mcp-preferences.ts +142 -0
- package/src/node/mcp-backend-module.ts +3 -1
- package/lib/browser/mcp-preferences.d.ts +0 -4
- package/lib/browser/mcp-preferences.d.ts.map +0 -1
- package/lib/browser/mcp-preferences.js.map +0 -1
- package/src/browser/mcp-preferences.ts +0 -118
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FrontendApplicationContribution
|
|
1
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
2
2
|
import { MCPServerDescription, MCPServerManager } from '../common';
|
|
3
3
|
import { MCPFrontendService } from '../common/mcp-server-manager';
|
|
4
|
+
import { PreferenceService } from '@theia/core';
|
|
4
5
|
interface BaseMCPServerPreferenceValue {
|
|
5
6
|
autostart?: boolean;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,
|
|
1
|
+
{"version":3,"file":"mcp-frontend-application-contribution.d.ts","source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,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAa;IAErE,OAAO,IAAI,IAAI;cAmBC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3F,SAAS,CAAC,mBAAmB,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAgCrE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,IAAI;IAavE,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC;CAgC3F"}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.McpFrontendApplicationContribution = void 0;
|
|
19
19
|
const tslib_1 = require("tslib");
|
|
20
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
21
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
21
|
const common_1 = require("../common");
|
|
23
|
-
const mcp_preferences_1 = require("
|
|
22
|
+
const mcp_preferences_1 = require("../common/mcp-preferences");
|
|
24
23
|
const mcp_server_manager_1 = require("../common/mcp-server-manager");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
25
25
|
;
|
|
26
26
|
var MCPServersPreference;
|
|
27
27
|
(function (MCPServersPreference) {
|
|
@@ -92,7 +92,7 @@ let McpFrontendApplicationContribution = class McpFrontendApplicationContributio
|
|
|
92
92
|
let diff = false;
|
|
93
93
|
try {
|
|
94
94
|
// We know that that the descriptions are actual JSONObjects as we construct them ourselves
|
|
95
|
-
if (!oldDescription || !
|
|
95
|
+
if (!oldDescription || !core_1.PreferenceUtils.deepEqual(oldDescription, description)) {
|
|
96
96
|
diff = true;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -152,7 +152,7 @@ let McpFrontendApplicationContribution = class McpFrontendApplicationContributio
|
|
|
152
152
|
};
|
|
153
153
|
exports.McpFrontendApplicationContribution = McpFrontendApplicationContribution;
|
|
154
154
|
tslib_1.__decorate([
|
|
155
|
-
(0, inversify_1.inject)(
|
|
155
|
+
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
156
156
|
tslib_1.__metadata("design:type", Object)
|
|
157
157
|
], McpFrontendApplicationContribution.prototype, "preferenceService", void 0);
|
|
158
158
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-application-contribution.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;;;;
|
|
1
|
+
{"version":3,"file":"mcp-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-application-contribution.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;;;;AAGhF,4DAAkE;AAClE,sCAAmE;AACnE,+DAA6D;AAE7D,qEAAkE;AAClE,sCAAiE;AAuBhE,CAAC;AAEF,IAAU,oBAAoB,CAa7B;AAbD,WAAU,oBAAoB;IAC1B,SAAgB,OAAO,CAAC,GAAY;QAChC,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YACnC,CAAC,SAAS,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,CAAC;YACxC,CAA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AAC"}
|
|
@@ -19,12 +19,12 @@ exports.McpServersPreferenceSchema = exports.MCP_SERVERS_PREF = void 0;
|
|
|
19
19
|
const core_1 = require("@theia/core");
|
|
20
20
|
exports.MCP_SERVERS_PREF = 'ai-features.mcp.mcpServers';
|
|
21
21
|
exports.McpServersPreferenceSchema = {
|
|
22
|
-
type: 'object',
|
|
23
22
|
properties: {
|
|
24
23
|
[exports.MCP_SERVERS_PREF]: {
|
|
25
24
|
type: 'object',
|
|
26
25
|
title: core_1.nls.localize('theia/ai/mcp/servers/title', 'MCP Server Configuration'),
|
|
27
|
-
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/mdDescription', 'Configure MCP servers either local with command,
|
|
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
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
29
|
Each server is identified by a unique key, such as "brave-search" or "filesystem". \
|
|
30
30
|
To start a server, use the "MCP: Start MCP Server" command, which enables you to select the desired server. \
|
|
@@ -98,16 +98,37 @@ Example configuration:\n\
|
|
|
98
98
|
type: 'string',
|
|
99
99
|
title: core_1.nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
100
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
101
|
}
|
|
107
102
|
},
|
|
108
103
|
required: []
|
|
109
104
|
}
|
|
105
|
+
},
|
|
106
|
+
autostart: {
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
title: core_1.nls.localize('theia/ai/mcp/servers/autostart/title', 'Autostart'),
|
|
109
|
+
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'),
|
|
110
|
+
default: true
|
|
111
|
+
},
|
|
112
|
+
serverUrl: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
title: core_1.nls.localize('theia/ai/mcp/servers/serverUrl/title', 'Server URL'),
|
|
115
|
+
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.'),
|
|
116
|
+
},
|
|
117
|
+
serverAuthToken: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
title: core_1.nls.localize('theia/ai/mcp/servers/serverAuthToken/title', 'Authentication Token'),
|
|
120
|
+
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.'),
|
|
121
|
+
},
|
|
122
|
+
serverAuthTokenHeader: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
title: core_1.nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
125
|
+
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.'),
|
|
126
|
+
},
|
|
127
|
+
headers: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
title: core_1.nls.localize('theia/ai/mcp/servers/headers/title', 'Headers'),
|
|
130
|
+
markdownDescription: core_1.nls.localize('theia/ai/mcp/servers/headers/mdDescription', 'Optional additional headers included with each request to the server.'),
|
|
110
131
|
}
|
|
111
|
-
}
|
|
132
|
+
},
|
|
112
133
|
};
|
|
113
134
|
//# sourceMappingURL=mcp-preferences.js.map
|
|
@@ -0,0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AAE;YACP,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,sCAAsC,EAAE,YAAY,CAAC;YACzE,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,8CAA8C,EAC5E,yHAAyH,CAAC;SACjI;QACD,eAAe,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAAE,sBAAsB,CAAC;YACzF,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,oDAAoD,EAClF,4GAA4G,CAAC;SACpH;QACD,qBAAqB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,4BAA4B,CAAC;YACrG,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,0DAA0D,EACxF,0HAA0H,CAAC;SAClI;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE,SAAS,CAAC;YACpE,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAC1E,uEAAuE,CAAC;SAC/E;KACJ;CACJ,CAAC"}
|
|
@@ -1 +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;;
|
|
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;;AAoB/D,wBAGG"}
|
|
@@ -20,6 +20,7 @@ const core_1 = require("@theia/core");
|
|
|
20
20
|
const mcp_server_manager_impl_1 = require("./mcp-server-manager-impl");
|
|
21
21
|
const mcp_server_manager_1 = require("../common/mcp-server-manager");
|
|
22
22
|
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
23
|
+
const mcp_preferences_1 = require("../common/mcp-preferences");
|
|
23
24
|
// We use a connection module to handle AI services separately for each frontend.
|
|
24
25
|
const mcpConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
25
26
|
bind(mcp_server_manager_1.MCPServerManager).to(mcp_server_manager_impl_1.MCPServerManagerImpl).inSingletonScope();
|
|
@@ -31,6 +32,7 @@ const mcpConnectionModule = connection_container_module_1.ConnectionContainerMod
|
|
|
31
32
|
})).inSingletonScope();
|
|
32
33
|
});
|
|
33
34
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
35
|
+
bind(core_1.PreferenceContribution).toConstantValue({ schema: mcp_preferences_1.McpServersPreferenceSchema });
|
|
34
36
|
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(mcpConnectionModule);
|
|
35
37
|
});
|
|
36
38
|
//# sourceMappingURL=mcp-backend-module.js.map
|
|
@@ -1 +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,
|
|
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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4
4
|
"description": "Theia - MCP Integration",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
7
|
-
"@theia/ai-core": "1.65.0
|
|
8
|
-
"@theia/core": "1.65.0
|
|
7
|
+
"@theia/ai-core": "1.65.0",
|
|
8
|
+
"@theia/core": "1.65.0"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"watch": "theiaext watch"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@theia/ext-scripts": "1.
|
|
45
|
+
"@theia/ext-scripts": "1.65.0"
|
|
46
46
|
},
|
|
47
47
|
"nyc": {
|
|
48
48
|
"extends": "../../configs/nyc.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "500dfc80cee94fd2a623b5fb59b22d5a575247c2"
|
|
51
51
|
}
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { FrontendApplicationContribution
|
|
17
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
18
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
19
|
import { MCPServerDescription, MCPServerManager } from '../common';
|
|
20
|
-
import { MCP_SERVERS_PREF } from '
|
|
20
|
+
import { MCP_SERVERS_PREF } from '../common/mcp-preferences';
|
|
21
21
|
import { JSONObject } from '@theia/core/shared/@lumino/coreutils';
|
|
22
22
|
import { MCPFrontendService } from '../common/mcp-server-manager';
|
|
23
|
+
import { PreferenceService, PreferenceUtils } from '@theia/core';
|
|
23
24
|
|
|
24
25
|
interface BaseMCPServerPreferenceValue {
|
|
25
26
|
autostart?: boolean;
|
|
@@ -131,7 +132,7 @@ export class McpFrontendApplicationContribution implements FrontendApplicationCo
|
|
|
131
132
|
let diff = false;
|
|
132
133
|
try {
|
|
133
134
|
// We know that that the descriptions are actual JSONObjects as we construct them ourselves
|
|
134
|
-
if (!oldDescription || !
|
|
135
|
+
if (!oldDescription || !PreferenceUtils.deepEqual(oldDescription as unknown as JSONObject, description as unknown as JSONObject)) {
|
|
135
136
|
diff = true;
|
|
136
137
|
}
|
|
137
138
|
} catch (e) {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
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
|
+
|
|
17
|
+
import { nls, PreferenceSchema } from '@theia/core';
|
|
18
|
+
|
|
19
|
+
export const MCP_SERVERS_PREF = 'ai-features.mcp.mcpServers';
|
|
20
|
+
|
|
21
|
+
export const McpServersPreferenceSchema: PreferenceSchema = {
|
|
22
|
+
properties: {
|
|
23
|
+
[MCP_SERVERS_PREF]: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
title: nls.localize('theia/ai/mcp/servers/title', 'MCP Server Configuration'),
|
|
26
|
+
markdownDescription: 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: nls.localize('theia/ai/mcp/servers/command/title', 'Command to execute the MCP server'),
|
|
66
|
+
markdownDescription: 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: nls.localize('theia/ai/mcp/servers/args/title', 'Arguments for the command'),
|
|
71
|
+
markdownDescription: 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: nls.localize('theia/ai/mcp/servers/env/title', 'Environment variables'),
|
|
76
|
+
markdownDescription: 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: nls.localize('theia/ai/mcp/servers/autostart/title', 'Autostart'),
|
|
84
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/autostart/mdDescription',
|
|
85
|
+
'Automatically start this server when the frontend starts. Newly added servers are not immediately auto started, but on restart'),
|
|
86
|
+
default: true
|
|
87
|
+
},
|
|
88
|
+
serverUrl: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
title: nls.localize('theia/ai/mcp/servers/serverUrl/title', 'Server URL'),
|
|
91
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverUrl/mdDescription',
|
|
92
|
+
'The URL of the remote MCP server. If provided, the server will connect to this URL instead of starting a local process.'),
|
|
93
|
+
},
|
|
94
|
+
serverAuthToken: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
title: nls.localize('theia/ai/mcp/servers/serverAuthToken/title', 'Authentication Token'),
|
|
97
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthToken/mdDescription',
|
|
98
|
+
'The authentication token for the server, if required. This is used to authenticate with the remote server.'),
|
|
99
|
+
},
|
|
100
|
+
serverAuthTokenHeader: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
title: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
103
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/mdDescription',
|
|
104
|
+
'The header name to use for the server authentication token. If not provided, "Authorization" with "Bearer" will be used.'),
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
required: []
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
autostart: {
|
|
111
|
+
type: 'boolean',
|
|
112
|
+
title: nls.localize('theia/ai/mcp/servers/autostart/title', 'Autostart'),
|
|
113
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/autostart/mdDescription',
|
|
114
|
+
'Automatically start this server when the frontend starts. Newly added servers are not immediately auto started, but on restart'),
|
|
115
|
+
default: true
|
|
116
|
+
},
|
|
117
|
+
serverUrl: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
title: nls.localize('theia/ai/mcp/servers/serverUrl/title', 'Server URL'),
|
|
120
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverUrl/mdDescription',
|
|
121
|
+
'The URL of the remote MCP server. If provided, the server will connect to this URL instead of starting a local process.'),
|
|
122
|
+
},
|
|
123
|
+
serverAuthToken: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
title: nls.localize('theia/ai/mcp/servers/serverAuthToken/title', 'Authentication Token'),
|
|
126
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthToken/mdDescription',
|
|
127
|
+
'The authentication token for the server, if required. This is used to authenticate with the remote server.'),
|
|
128
|
+
},
|
|
129
|
+
serverAuthTokenHeader: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
title: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
132
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/mdDescription',
|
|
133
|
+
'The header name to use for the server authentication token. If not provided, "Authorization" with "Bearer" will be used.'),
|
|
134
|
+
},
|
|
135
|
+
headers: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
title: nls.localize('theia/ai/mcp/servers/headers/title', 'Headers'),
|
|
138
|
+
markdownDescription: nls.localize('theia/ai/mcp/servers/headers/mdDescription',
|
|
139
|
+
'Optional additional headers included with each request to the server.'),
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
};
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ConnectionHandler, RpcConnectionHandler } from '@theia/core';
|
|
18
|
+
import { ConnectionHandler, PreferenceContribution, RpcConnectionHandler } from '@theia/core';
|
|
19
19
|
import { MCPServerManagerImpl } from './mcp-server-manager-impl';
|
|
20
20
|
import { MCPFrontendNotificationService, MCPServerManager, MCPServerManagerPath } from '../common/mcp-server-manager';
|
|
21
21
|
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
|
|
22
|
+
import { McpServersPreferenceSchema } from '../common/mcp-preferences';
|
|
22
23
|
|
|
23
24
|
// We use a connection module to handle AI services separately for each frontend.
|
|
24
25
|
const mcpConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
@@ -34,5 +35,6 @@ const mcpConnectionModule = ConnectionContainerModule.create(({ bind, bindBacken
|
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
export default new ContainerModule(bind => {
|
|
38
|
+
bind(PreferenceContribution).toConstantValue({ schema: McpServersPreferenceSchema });
|
|
37
39
|
bind(ConnectionContainerModule).toConstantValue(mcpConnectionModule);
|
|
38
40
|
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
|
|
2
|
-
export declare const MCP_SERVERS_PREF = "ai-features.mcp.mcpServers";
|
|
3
|
-
export declare const McpServersPreferenceSchema: PreferenceSchema;
|
|
4
|
-
//# sourceMappingURL=mcp-preferences.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAE/F,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAE7D,eAAO,MAAM,0BAA0B,EAAE,gBAgGxC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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;;;AAEhF,sCAAkC;AAGrB,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAEhD,QAAA,0BAA0B,GAAqB;IAC1D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,CAAC,wBAAgB,CAAC,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,4BAA4B,EAAE,0BAA0B,CAAC;YAC7E,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCvE,CAAC;YACF,oBAAoB,EAAE;gBACpB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE,mCAAmC,CAAC;wBAC9F,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAAE,iEAAiE,CAAC;qBACnJ;oBACD,IAAI,EAAE;wBACJ,I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H,CAAC;qBAC9H;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE,SAAS,CAAC;wBACpE,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAC5E,uEAAuE,CAAC;qBAC3E;iBACF;gBACD,QAAQ,EAAE,EAAE;aACb;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
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
|
-
|
|
17
|
-
import { nls } from '@theia/core';
|
|
18
|
-
import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
|
|
19
|
-
|
|
20
|
-
export const MCP_SERVERS_PREF = 'ai-features.mcp.mcpServers';
|
|
21
|
-
|
|
22
|
-
export const McpServersPreferenceSchema: PreferenceSchema = {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
[MCP_SERVERS_PREF]: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
title: nls.localize('theia/ai/mcp/servers/title', 'MCP Server Configuration'),
|
|
28
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/mdDescription', 'Configure MCP servers either local with command, arguments and optionally environment variables, \
|
|
29
|
-
or remote with server URL, authentication token and optionally an authentication header name. Additionally it is possible to configure autostart (true by default). \
|
|
30
|
-
Each server is identified by a unique key, such as "brave-search" or "filesystem". \
|
|
31
|
-
To start a server, use the "MCP: Start MCP Server" command, which enables you to select the desired server. \
|
|
32
|
-
To stop a server, use the "MCP: Stop MCP Server" command. \
|
|
33
|
-
Please note that autostart will only take effect after a restart, you need to start a server manually for the first time.\
|
|
34
|
-
\n\
|
|
35
|
-
Example configuration:\n\
|
|
36
|
-
```\
|
|
37
|
-
{\n\
|
|
38
|
-
"brave-search": {\n\
|
|
39
|
-
"command": "npx",\n\
|
|
40
|
-
"args": [\n\
|
|
41
|
-
"-y",\n\
|
|
42
|
-
"@modelcontextprotocol/server-brave-search"\n\
|
|
43
|
-
],\n\
|
|
44
|
-
"env": {\n\
|
|
45
|
-
"BRAVE_API_KEY": "YOUR_API_KEY"\n\
|
|
46
|
-
},\n\
|
|
47
|
-
},\n\
|
|
48
|
-
"filesystem": {\n\
|
|
49
|
-
"command": "npx",\n\
|
|
50
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/YOUR_USERNAME/Desktop"],\n\
|
|
51
|
-
"env": {\n\
|
|
52
|
-
"CUSTOM_ENV_VAR": "custom-value"\n\
|
|
53
|
-
},\n\
|
|
54
|
-
"autostart": false\n\
|
|
55
|
-
},\n\
|
|
56
|
-
"jira": {\n\
|
|
57
|
-
"serverUrl": "YOUR_JIRA_MCP_SERVER_URL",\n\
|
|
58
|
-
"serverAuthToken": "YOUR_JIRA_MCP_SERVER_TOKEN"\n\
|
|
59
|
-
}\n\
|
|
60
|
-
}\n```'),
|
|
61
|
-
additionalProperties: {
|
|
62
|
-
type: 'object',
|
|
63
|
-
properties: {
|
|
64
|
-
command: {
|
|
65
|
-
type: 'string',
|
|
66
|
-
title: nls.localize('theia/ai/mcp/servers/command/title', 'Command to execute the MCP server'),
|
|
67
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/command/mdDescription', 'The command used to start the MCP server, e.g., "uvx" or "npx".')
|
|
68
|
-
},
|
|
69
|
-
args: {
|
|
70
|
-
type: 'array',
|
|
71
|
-
title: nls.localize('theia/ai/mcp/servers/args/title', 'Arguments for the command'),
|
|
72
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/args/mdDescription', 'An array of arguments to pass to the command.'),
|
|
73
|
-
},
|
|
74
|
-
env: {
|
|
75
|
-
type: 'object',
|
|
76
|
-
title: nls.localize('theia/ai/mcp/servers/env/title', 'Environment variables'),
|
|
77
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/env/mdDescription', 'Optional environment variables to set for the server, such as an API key.'),
|
|
78
|
-
additionalProperties: {
|
|
79
|
-
type: 'string'
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
autostart: {
|
|
83
|
-
type: 'boolean',
|
|
84
|
-
title: nls.localize('theia/ai/mcp/servers/autostart/title', 'Autostart'),
|
|
85
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/autostart/mdDescription',
|
|
86
|
-
'Automatically start this server when the frontend starts. Newly added servers are not immediately auto started, but on restart'),
|
|
87
|
-
default: true
|
|
88
|
-
},
|
|
89
|
-
serverUrl: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
title: nls.localize('theia/ai/mcp/servers/serverUrl/title', 'Server URL'),
|
|
92
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/serverUrl/mdDescription',
|
|
93
|
-
'The URL of the remote MCP server. If provided, the server will connect to this URL instead of starting a local process.'),
|
|
94
|
-
},
|
|
95
|
-
serverAuthToken: {
|
|
96
|
-
type: 'string',
|
|
97
|
-
title: nls.localize('theia/ai/mcp/servers/serverAuthToken/title', 'Authentication Token'),
|
|
98
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthToken/mdDescription',
|
|
99
|
-
'The authentication token for the server, if required. This is used to authenticate with the remote server.'),
|
|
100
|
-
},
|
|
101
|
-
serverAuthTokenHeader: {
|
|
102
|
-
type: 'string',
|
|
103
|
-
title: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/title', 'Authentication Header Name'),
|
|
104
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/serverAuthTokenHeader/mdDescription',
|
|
105
|
-
'The header name to use for the server authentication token. If not provided, "Authorization" with "Bearer" will be used.'),
|
|
106
|
-
},
|
|
107
|
-
headers: {
|
|
108
|
-
type: 'object',
|
|
109
|
-
title: nls.localize('theia/ai/mcp/servers/headers/title', 'Headers'),
|
|
110
|
-
markdownDescription: nls.localize('theia/ai/mcp/servers/headers/mdDescription',
|
|
111
|
-
'Optional additional headers included with each request to the server.'),
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
required: []
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|