@theia/ai-mcp-server 1.67.0-next.56 → 1.67.0-next.86

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.
Files changed (61) hide show
  1. package/lib/browser/index.d.ts +3 -0
  2. package/lib/browser/index.d.ts.map +1 -0
  3. package/lib/browser/index.js +21 -0
  4. package/lib/browser/index.js.map +1 -0
  5. package/lib/browser/mcp-frontend-bootstrap.d.ts +17 -0
  6. package/lib/browser/mcp-frontend-bootstrap.d.ts.map +1 -0
  7. package/lib/browser/mcp-frontend-bootstrap.js +47 -0
  8. package/lib/browser/mcp-frontend-bootstrap.js.map +1 -0
  9. package/lib/browser/mcp-frontend-contribution.d.ts +44 -0
  10. package/lib/browser/mcp-frontend-contribution.d.ts.map +1 -0
  11. package/lib/browser/mcp-frontend-contribution.js +21 -0
  12. package/lib/browser/mcp-frontend-contribution.js.map +1 -0
  13. package/lib/browser/mcp-frontend-module.d.ts +4 -0
  14. package/lib/browser/mcp-frontend-module.d.ts.map +1 -0
  15. package/lib/browser/mcp-frontend-module.js +37 -0
  16. package/lib/browser/mcp-frontend-module.js.map +1 -0
  17. package/lib/browser/mcp-tool-delegate-client.d.ts +27 -0
  18. package/lib/browser/mcp-tool-delegate-client.d.ts.map +1 -0
  19. package/lib/browser/mcp-tool-delegate-client.js +128 -0
  20. package/lib/browser/mcp-tool-delegate-client.js.map +1 -0
  21. package/lib/common/index.d.ts +2 -0
  22. package/lib/common/index.d.ts.map +1 -0
  23. package/lib/common/index.js +20 -0
  24. package/lib/common/index.js.map +1 -0
  25. package/lib/common/mcp-tool-delegate.d.ts +25 -0
  26. package/lib/common/mcp-tool-delegate.d.ts.map +1 -0
  27. package/lib/common/mcp-tool-delegate.js +22 -0
  28. package/lib/common/mcp-tool-delegate.js.map +1 -0
  29. package/lib/node/index.d.ts +5 -0
  30. package/lib/node/index.d.ts.map +1 -0
  31. package/lib/node/index.js +23 -0
  32. package/lib/node/index.js.map +1 -0
  33. package/lib/node/mcp-backend-contribution-manager.d.ts +16 -0
  34. package/lib/node/mcp-backend-contribution-manager.d.ts.map +1 -0
  35. package/lib/node/mcp-backend-contribution-manager.js +61 -0
  36. package/lib/node/mcp-backend-contribution-manager.js.map +1 -0
  37. package/lib/node/mcp-backend-module.d.ts +4 -0
  38. package/lib/node/mcp-backend-module.d.ts.map +1 -0
  39. package/lib/node/mcp-backend-module.js +56 -0
  40. package/lib/node/mcp-backend-module.js.map +1 -0
  41. package/lib/node/mcp-frontend-contribution-manager.d.ts +55 -0
  42. package/lib/node/mcp-frontend-contribution-manager.d.ts.map +1 -0
  43. package/lib/node/mcp-frontend-contribution-manager.js +242 -0
  44. package/lib/node/mcp-frontend-contribution-manager.js.map +1 -0
  45. package/lib/node/mcp-theia-server-impl.d.ts +32 -0
  46. package/lib/node/mcp-theia-server-impl.d.ts.map +1 -0
  47. package/lib/node/mcp-theia-server-impl.js +220 -0
  48. package/lib/node/mcp-theia-server-impl.js.map +1 -0
  49. package/lib/node/mcp-theia-server.d.ts +43 -0
  50. package/lib/node/mcp-theia-server.d.ts.map +1 -0
  51. package/lib/node/mcp-theia-server.js +22 -0
  52. package/lib/node/mcp-theia-server.js.map +1 -0
  53. package/lib/node/mcp-tool-frontend-delegate.d.ts +13 -0
  54. package/lib/node/mcp-tool-frontend-delegate.d.ts.map +1 -0
  55. package/lib/node/mcp-tool-frontend-delegate.js +66 -0
  56. package/lib/node/mcp-tool-frontend-delegate.js.map +1 -0
  57. package/lib/package.spec.d.ts +1 -0
  58. package/lib/package.spec.d.ts.map +1 -0
  59. package/lib/package.spec.js +26 -0
  60. package/lib/package.spec.js.map +1 -0
  61. package/package.json +4 -4
@@ -0,0 +1,3 @@
1
+ export * from './mcp-frontend-bootstrap';
2
+ export * from './mcp-frontend-contribution';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAgBA,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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 tslib_1 = require("tslib");
19
+ tslib_1.__exportStar(require("./mcp-frontend-bootstrap"), exports);
20
+ tslib_1.__exportStar(require("./mcp-frontend-contribution"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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,mEAAyC;AACzC,sEAA4C"}
@@ -0,0 +1,17 @@
1
+ import { MaybePromise } from '@theia/core';
2
+ import { FrontendApplication, FrontendApplicationContribution } from '@theia/core/lib/browser';
3
+ import { ILogger } from '@theia/core/lib/common/logger';
4
+ import { MCPToolFrontendDelegate } from '../common/mcp-tool-delegate';
5
+ /**
6
+ * Bootstraps MCP frontend components during application startup.
7
+ *
8
+ * This contribution ensures that the MCPToolFrontendDelegate is properly instantiated
9
+ * and available in the dependency injection container when the frontend application starts.
10
+ * It acts as a lightweight initializer to activate MCP functionality in the browser.
11
+ */
12
+ export declare class MCPFrontendBootstrap implements FrontendApplicationContribution {
13
+ protected readonly frontendDelegate: MCPToolFrontendDelegate;
14
+ protected readonly logger: ILogger;
15
+ onStart(_app: FrontendApplication): MaybePromise<void>;
16
+ }
17
+ //# sourceMappingURL=mcp-frontend-bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-bootstrap.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-frontend-bootstrap.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;GAMG;AACH,qBACa,oBAAqB,YAAW,+BAA+B;IAGxE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;IAG7D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEnC,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAAC,IAAI,CAAC;CAIzD"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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.MCPFrontendBootstrap = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const logger_1 = require("@theia/core/lib/common/logger");
22
+ const mcp_tool_delegate_1 = require("../common/mcp-tool-delegate");
23
+ /**
24
+ * Bootstraps MCP frontend components during application startup.
25
+ *
26
+ * This contribution ensures that the MCPToolFrontendDelegate is properly instantiated
27
+ * and available in the dependency injection container when the frontend application starts.
28
+ * It acts as a lightweight initializer to activate MCP functionality in the browser.
29
+ */
30
+ let MCPFrontendBootstrap = class MCPFrontendBootstrap {
31
+ onStart(_app) {
32
+ this.logger.debug('MCPFrontendBootstrap initialized');
33
+ }
34
+ };
35
+ exports.MCPFrontendBootstrap = MCPFrontendBootstrap;
36
+ tslib_1.__decorate([
37
+ (0, inversify_1.inject)(mcp_tool_delegate_1.MCPToolFrontendDelegate),
38
+ tslib_1.__metadata("design:type", Object)
39
+ ], MCPFrontendBootstrap.prototype, "frontendDelegate", void 0);
40
+ tslib_1.__decorate([
41
+ (0, inversify_1.inject)(logger_1.ILogger),
42
+ tslib_1.__metadata("design:type", Object)
43
+ ], MCPFrontendBootstrap.prototype, "logger", void 0);
44
+ exports.MCPFrontendBootstrap = MCPFrontendBootstrap = tslib_1.__decorate([
45
+ (0, inversify_1.injectable)()
46
+ ], MCPFrontendBootstrap);
47
+ //# sourceMappingURL=mcp-frontend-bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-bootstrap.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-bootstrap.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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;AAGlE,0DAAwD;AACxD,mEAAsE;AAEtE;;;;;;GAMG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAQ7B,OAAO,CAAC,IAAyB;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC1D,CAAC;CAEJ,CAAA;AAZY,oDAAoB;AAGV;IADlB,IAAA,kBAAM,EAAC,2CAAuB,CAAC;;8DAC6B;AAG1C;IADlB,IAAA,kBAAM,EAAC,gBAAO,CAAC;;oDACmB;+BAN1B,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAYhC"}
@@ -0,0 +1,44 @@
1
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
2
+ import { Tool, Resource, Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types';
3
+ import { z } from 'zod';
4
+ export declare const MCPFrontendContribution: unique symbol;
5
+ /**
6
+ * Tool provider interface for frontend contributions
7
+ */
8
+ export interface ToolProvider {
9
+ handler: (args: unknown) => Promise<unknown>;
10
+ inputSchema: z.ZodSchema;
11
+ }
12
+ /**
13
+ * Contribution interface for extending the MCP server with frontend-only tools, resources, and prompts
14
+ */
15
+ export interface MCPFrontendContribution {
16
+ /**
17
+ * Get tools provided by this contribution
18
+ */
19
+ getTools?(): Promise<Tool[]> | Tool[];
20
+ /**
21
+ * Get specific tool by name
22
+ */
23
+ getTool?(name: string): Promise<ToolProvider | undefined> | ToolProvider | undefined;
24
+ /**
25
+ * Get resources provided by this contribution
26
+ */
27
+ getResources?(): Promise<Resource[]> | Resource[];
28
+ /**
29
+ * Read specific resource by URI
30
+ */
31
+ readResource?(uri: string): Promise<unknown> | unknown;
32
+ /**
33
+ * Get prompts provided by this contribution
34
+ */
35
+ getPrompts?(): Promise<Prompt[]> | Prompt[];
36
+ /**
37
+ * Get specific prompt by name with arguments
38
+ */
39
+ getPrompt?(name: string, args: unknown): Promise<PromptMessage[]> | PromptMessage[];
40
+ }
41
+ export declare const MCPFrontendContributionProvider: unique symbol;
42
+ export interface MCPFrontendContributionProvider extends ContributionProvider<MCPFrontendContribution> {
43
+ }
44
+ //# sourceMappingURL=mcp-frontend-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-frontend-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,GAAG,YAAY,GAAG,SAAS,CAAC;IAErF;;OAEG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC;IAElD;;OAEG;IACH,YAAY,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAEvD;;OAEG;IACH,UAAU,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;IAE5C;;OAEG;IACH,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC;CACvF;AAED,eAAO,MAAM,+BAA+B,eAA4C,CAAC;AACzF,MAAM,WAAW,+BAAgC,SAAQ,oBAAoB,CAAC,uBAAuB,CAAC;CAAI"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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.MCPFrontendContributionProvider = exports.MCPFrontendContribution = void 0;
19
+ exports.MCPFrontendContribution = Symbol('MCPFrontendContribution');
20
+ exports.MCPFrontendContributionProvider = Symbol('MCPFrontendContributionProvider');
21
+ //# sourceMappingURL=mcp-frontend-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-contribution.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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;;;AAMnE,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AA6C5D,QAAA,+BAA+B,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=mcp-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAY/D,wBAaG"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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 browser_1 = require("@theia/core/lib/browser");
21
+ const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
22
+ const mcp_tool_delegate_1 = require("../common/mcp-tool-delegate");
23
+ const mcp_frontend_bootstrap_1 = require("./mcp-frontend-bootstrap");
24
+ const mcp_frontend_contribution_1 = require("./mcp-frontend-contribution");
25
+ const mcp_tool_delegate_client_1 = require("./mcp-tool-delegate-client");
26
+ exports.default = new inversify_1.ContainerModule(bind => {
27
+ bind(mcp_frontend_bootstrap_1.MCPFrontendBootstrap).toSelf().inSingletonScope();
28
+ bind(browser_1.FrontendApplicationContribution).toService(mcp_frontend_bootstrap_1.MCPFrontendBootstrap);
29
+ bind(mcp_tool_delegate_1.MCPToolDelegateClient).to(mcp_tool_delegate_client_1.MCPToolDelegateClientImpl).inSingletonScope();
30
+ bind(mcp_tool_delegate_1.MCPToolFrontendDelegate).toDynamicValue(ctx => {
31
+ const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
32
+ const client = ctx.container.get(mcp_tool_delegate_1.MCPToolDelegateClient);
33
+ return connection.createProxy(mcp_tool_delegate_1.mcpToolDelegatePath, client);
34
+ }).inSingletonScope();
35
+ (0, core_1.bindContributionProvider)(bind, mcp_frontend_contribution_1.MCPFrontendContribution);
36
+ });
37
+ //# sourceMappingURL=mcp-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-frontend-module.js","sourceRoot":"","sources":["../../src/browser/mcp-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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,sCAAuD;AACvD,qDAA0E;AAC1E,+GAGuE;AACvE,mEAAkH;AAClH,qEAAgE;AAChE,2EAAsE;AACtE,yEAAuE;AAEvE,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6CAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,6CAAoB,CAAC,CAAC;IAEtE,IAAI,CAAC,yCAAqB,CAAC,CAAC,EAAE,CAAC,oDAAyB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAE7E,IAAI,CAAC,2CAAuB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QAC/C,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA4B,sDAAwB,CAAC,CAAC;QAC1F,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAwB,yCAAqB,CAAC,CAAC;QAC/E,OAAO,UAAU,CAAC,WAAW,CAA0B,uCAAmB,EAAE,MAAM,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEtB,IAAA,+BAAwB,EAAC,IAAI,EAAE,mDAAuB,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { ContributionProvider } from '@theia/core';
2
+ import { ILogger } from '@theia/core/lib/common/logger';
3
+ import { Tool, Resource, ResourceContents, Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types';
4
+ import { MCPToolDelegateClient } from '../common/mcp-tool-delegate';
5
+ import { MCPFrontendContribution } from './mcp-frontend-contribution';
6
+ /**
7
+ * Frontend client implementation that handles MCP tool delegation requests from the backend.
8
+ *
9
+ * This class acts as a bridge between the backend MCP server and frontend contributions,
10
+ * forwarding backend requests (tool calls, resource access, prompts) to registered
11
+ * MCPFrontendContribution instances and aggregating their responses.
12
+ *
13
+ * Called by the backend via the MCPToolDelegateClient interface to access frontend-provided
14
+ * MCP tools, resources, and prompts.
15
+ */
16
+ export declare class MCPToolDelegateClientImpl implements MCPToolDelegateClient {
17
+ protected readonly contributions: ContributionProvider<MCPFrontendContribution>;
18
+ protected readonly logger: ILogger;
19
+ private getFrontendContributions;
20
+ callTool(serverId: string, toolName: string, args: unknown): Promise<unknown>;
21
+ listTools(serverId: string): Promise<Tool[]>;
22
+ listResources(serverId: string): Promise<Resource[]>;
23
+ readResource(serverId: string, uri: string): Promise<ResourceContents>;
24
+ listPrompts(serverId: string): Promise<Prompt[]>;
25
+ getPrompt(serverId: string, name: string, args: unknown): Promise<PromptMessage[]>;
26
+ }
27
+ //# sourceMappingURL=mcp-tool-delegate-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-delegate-client.d.ts","sourceRoot":"","sources":["../../src/browser/mcp-tool-delegate-client.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;GASG;AACH,qBACa,yBAA0B,YAAW,qBAAqB;IAInE,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAGhF,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEnC,OAAO,CAAC,wBAAwB;IAI1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAc7E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAa5C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAapD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAiBtE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAahD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAe3F"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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.MCPToolDelegateClientImpl = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const core_1 = require("@theia/core");
22
+ const logger_1 = require("@theia/core/lib/common/logger");
23
+ const mcp_frontend_contribution_1 = require("./mcp-frontend-contribution");
24
+ /**
25
+ * Frontend client implementation that handles MCP tool delegation requests from the backend.
26
+ *
27
+ * This class acts as a bridge between the backend MCP server and frontend contributions,
28
+ * forwarding backend requests (tool calls, resource access, prompts) to registered
29
+ * MCPFrontendContribution instances and aggregating their responses.
30
+ *
31
+ * Called by the backend via the MCPToolDelegateClient interface to access frontend-provided
32
+ * MCP tools, resources, and prompts.
33
+ */
34
+ let MCPToolDelegateClientImpl = class MCPToolDelegateClientImpl {
35
+ getFrontendContributions() {
36
+ return this.contributions.getContributions();
37
+ }
38
+ async callTool(serverId, toolName, args) {
39
+ const contributions = this.getFrontendContributions();
40
+ for (const contribution of contributions) {
41
+ if (contribution.getTool) {
42
+ const tool = await contribution.getTool(toolName);
43
+ if (tool) {
44
+ return await tool.handler(JSON.stringify(args));
45
+ }
46
+ }
47
+ }
48
+ throw new Error(`Tool ${toolName} not found in server ${serverId}`);
49
+ }
50
+ async listTools(serverId) {
51
+ const contributions = this.getFrontendContributions();
52
+ const allTools = [];
53
+ for (const contribution of contributions) {
54
+ if (contribution.getTools) {
55
+ const tools = await contribution.getTools();
56
+ allTools.push(...tools);
57
+ }
58
+ }
59
+ return allTools;
60
+ }
61
+ async listResources(serverId) {
62
+ const contributions = this.getFrontendContributions();
63
+ const allResources = [];
64
+ for (const contribution of contributions) {
65
+ if (contribution.getResources) {
66
+ const resources = await contribution.getResources();
67
+ allResources.push(...resources);
68
+ }
69
+ }
70
+ return allResources;
71
+ }
72
+ async readResource(serverId, uri) {
73
+ const contributions = this.getFrontendContributions();
74
+ for (const contribution of contributions) {
75
+ if (contribution.readResource) {
76
+ try {
77
+ const result = await contribution.readResource(uri);
78
+ return result;
79
+ }
80
+ catch (error) {
81
+ // Continue to next contribution
82
+ this.logger.debug(`Error getting resource ${uri}:`, error);
83
+ }
84
+ }
85
+ }
86
+ throw new Error(`Resource ${uri} not found in server ${serverId}`);
87
+ }
88
+ async listPrompts(serverId) {
89
+ const contributions = this.getFrontendContributions();
90
+ const allPrompts = [];
91
+ for (const contribution of contributions) {
92
+ if (contribution.getPrompts) {
93
+ const prompts = await contribution.getPrompts();
94
+ allPrompts.push(...prompts);
95
+ }
96
+ }
97
+ return allPrompts;
98
+ }
99
+ async getPrompt(serverId, name, args) {
100
+ const contributions = this.getFrontendContributions();
101
+ for (const contribution of contributions) {
102
+ if (contribution.getPrompt) {
103
+ try {
104
+ return await contribution.getPrompt(name, args);
105
+ }
106
+ catch (error) {
107
+ // Continue to next contribution
108
+ this.logger.debug(`Error getting prompt ${name}:`, error);
109
+ }
110
+ }
111
+ }
112
+ throw new Error(`Prompt ${name} not found in server ${serverId}`);
113
+ }
114
+ };
115
+ exports.MCPToolDelegateClientImpl = MCPToolDelegateClientImpl;
116
+ tslib_1.__decorate([
117
+ (0, inversify_1.inject)(core_1.ContributionProvider),
118
+ (0, inversify_1.named)(mcp_frontend_contribution_1.MCPFrontendContribution),
119
+ tslib_1.__metadata("design:type", Object)
120
+ ], MCPToolDelegateClientImpl.prototype, "contributions", void 0);
121
+ tslib_1.__decorate([
122
+ (0, inversify_1.inject)(logger_1.ILogger),
123
+ tslib_1.__metadata("design:type", Object)
124
+ ], MCPToolDelegateClientImpl.prototype, "logger", void 0);
125
+ exports.MCPToolDelegateClientImpl = MCPToolDelegateClientImpl = tslib_1.__decorate([
126
+ (0, inversify_1.injectable)()
127
+ ], MCPToolDelegateClientImpl);
128
+ //# sourceMappingURL=mcp-tool-delegate-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-delegate-client.js","sourceRoot":"","sources":["../../src/browser/mcp-tool-delegate-client.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export * from './mcp-tool-delegate';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAgBA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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 tslib_1 = require("tslib");
19
+ tslib_1.__exportStar(require("./mcp-tool-delegate"), 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,oCAAoC;AACpC,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,8DAAoC"}
@@ -0,0 +1,25 @@
1
+ import type { Tool, Resource, ResourceContents, Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types';
2
+ export declare const MCPToolDelegateClient: unique symbol;
3
+ /**
4
+ * Client interface for MCP tool operations.
5
+ * This interface is implemented by the frontend and called by the backend.
6
+ */
7
+ export interface MCPToolDelegateClient {
8
+ callTool(serverId: string, toolName: string, args: unknown): Promise<unknown>;
9
+ listTools(serverId: string): Promise<Tool[]>;
10
+ listResources(serverId: string): Promise<Resource[]>;
11
+ readResource(serverId: string, uri: string): Promise<ResourceContents>;
12
+ listPrompts(serverId: string): Promise<Prompt[]>;
13
+ getPrompt(serverId: string, name: string, args: unknown): Promise<PromptMessage[]>;
14
+ }
15
+ export declare const MCPToolFrontendDelegate: unique symbol;
16
+ /**
17
+ * Backend delegate interface for MCP tool operations.
18
+ * This interface extends MCPToolDelegateClient with RPC client setup capability.
19
+ * It is implemented by the backend and acts as a proxy to forward calls to the frontend.
20
+ */
21
+ export interface MCPToolFrontendDelegate extends MCPToolDelegateClient {
22
+ setClient(client: MCPToolDelegateClient): void;
23
+ }
24
+ export declare const mcpToolDelegatePath = "/services/mcpToolDelegate";
25
+ //# sourceMappingURL=mcp-tool-delegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-delegate.d.ts","sourceRoot":"","sources":["../../src/common/mcp-tool-delegate.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAE/G,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AACrE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CACtF;AAED,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AACzE;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IAClE,SAAS,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,mBAAmB,8BAA8B,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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.mcpToolDelegatePath = exports.MCPToolFrontendDelegate = exports.MCPToolDelegateClient = void 0;
19
+ exports.MCPToolDelegateClient = Symbol('MCPToolDelegateClient');
20
+ exports.MCPToolFrontendDelegate = Symbol('MCPToolFrontendDelegate');
21
+ exports.mcpToolDelegatePath = '/services/mcpToolDelegate';
22
+ //# sourceMappingURL=mcp-tool-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-delegate.js","sourceRoot":"","sources":["../../src/common/mcp-tool-delegate.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAcxD,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAU5D,QAAA,mBAAmB,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './mcp-theia-server';
2
+ export * from './mcp-theia-server-impl';
3
+ export * from './mcp-backend-contribution-manager';
4
+ export * from './mcp-frontend-contribution-manager';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAgBA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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 tslib_1 = require("tslib");
19
+ tslib_1.__exportStar(require("./mcp-theia-server"), exports);
20
+ tslib_1.__exportStar(require("./mcp-theia-server-impl"), exports);
21
+ tslib_1.__exportStar(require("./mcp-backend-contribution-manager"), exports);
22
+ tslib_1.__exportStar(require("./mcp-frontend-contribution-manager"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,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,6DAAmC;AACnC,kEAAwC;AACxC,6EAAmD;AACnD,8EAAoD"}
@@ -0,0 +1,16 @@
1
+ import { ILogger } from '@theia/core/lib/common/logger';
2
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { MCPBackendContribution } from './mcp-theia-server';
5
+ /**
6
+ * Manages the registration of backend MCP contributions
7
+ */
8
+ export declare class MCPBackendContributionManager {
9
+ protected readonly logger: ILogger;
10
+ protected readonly contributions: ContributionProvider<MCPBackendContribution>;
11
+ /**
12
+ * Register all backend contributions with the MCP server
13
+ */
14
+ registerBackendContributions(server: McpServer): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=mcp-backend-contribution-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-backend-contribution-manager.d.ts","sourceRoot":"","sources":["../../src/node/mcp-backend-contribution-manager.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,qBACa,6BAA6B;IAGtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAInC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;IAE/E;;OAEG;IACG,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBvE"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource.
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.MCPBackendContributionManager = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const logger_1 = require("@theia/core/lib/common/logger");
22
+ const contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
23
+ const mcp_theia_server_1 = require("./mcp-theia-server");
24
+ /**
25
+ * Manages the registration of backend MCP contributions
26
+ */
27
+ let MCPBackendContributionManager = class MCPBackendContributionManager {
28
+ /**
29
+ * Register all backend contributions with the MCP server
30
+ */
31
+ async registerBackendContributions(server) {
32
+ const contributions = this.contributions.getContributions();
33
+ this.logger.debug(`Found ${contributions.length} backend MCP contributions to register`);
34
+ for (const contribution of contributions) {
35
+ try {
36
+ this.logger.debug(`Configuring backend MCP contribution: ${contribution.constructor.name}`);
37
+ await contribution.configure(server);
38
+ this.logger.debug(`Successfully registered backend MCP contribution: ${contribution.constructor.name}`);
39
+ }
40
+ catch (error) {
41
+ this.logger.error(`Failed to register backend MCP contribution ${contribution.constructor.name}:`, error);
42
+ throw error;
43
+ }
44
+ }
45
+ this.logger.debug(`Finished registering all ${contributions.length} backend MCP contributions`);
46
+ }
47
+ };
48
+ exports.MCPBackendContributionManager = MCPBackendContributionManager;
49
+ tslib_1.__decorate([
50
+ (0, inversify_1.inject)(logger_1.ILogger),
51
+ tslib_1.__metadata("design:type", Object)
52
+ ], MCPBackendContributionManager.prototype, "logger", void 0);
53
+ tslib_1.__decorate([
54
+ (0, inversify_1.inject)(contribution_provider_1.ContributionProvider),
55
+ (0, inversify_1.named)(mcp_theia_server_1.MCPBackendContribution),
56
+ tslib_1.__metadata("design:type", Object)
57
+ ], MCPBackendContributionManager.prototype, "contributions", void 0);
58
+ exports.MCPBackendContributionManager = MCPBackendContributionManager = tslib_1.__decorate([
59
+ (0, inversify_1.injectable)()
60
+ ], MCPBackendContributionManager);
61
+ //# sourceMappingURL=mcp-backend-contribution-manager.js.map