@codingame/monaco-vscode-mcp-service-override 37.2.0 → 37.3.1
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/common.d.ts +2 -0
- package/common.js +56 -0
- package/index.d.ts +1 -2
- package/index.js +1 -52
- package/package.json +10 -2
- package/session.d.ts +1 -0
- package/session.js +2 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +3 -3
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +8 -8
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +7 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +108 -108
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +47 -47
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +37 -37
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +20 -16
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +52 -50
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +45 -43
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +14 -14
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +8 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +13 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +25 -25
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +28 -24
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +13 -11
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +13 -18
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js +3 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.js +0 -6
package/common.d.ts
ADDED
package/common.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
3
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
|
+
import { AllowedMcpServersService } from './vscode/src/vs/platform/mcp/common/allowedMcpServersService.js';
|
|
5
|
+
import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
|
|
6
|
+
import { McpGalleryService } from './vscode/src/vs/platform/mcp/common/mcpGalleryService.js';
|
|
7
|
+
import { IAllowedMcpServersService, IMcpGalleryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
8
|
+
import { McpResourceScannerService } from './vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js';
|
|
9
|
+
import { IMcpResourceScannerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service';
|
|
10
|
+
import { McpElicitationService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js';
|
|
11
|
+
import { McpWorkbenchService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js';
|
|
12
|
+
import { McpRegistry } from './vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js';
|
|
13
|
+
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
14
|
+
import { McpSamplingService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js';
|
|
15
|
+
import { IMcpSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpSandboxService.service';
|
|
16
|
+
import { McpService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpService.js';
|
|
17
|
+
import { IMcpElicitationService, IMcpSamplingService, IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
18
|
+
import { AuthenticationMcpAccessService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js';
|
|
19
|
+
import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service';
|
|
20
|
+
import { AuthenticationMcpService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js';
|
|
21
|
+
import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
|
|
22
|
+
import { AuthenticationMcpUsageService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js';
|
|
23
|
+
import { IAuthenticationMcpUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service';
|
|
24
|
+
import { WorkbenchMcpGalleryManifestService } from './vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.js';
|
|
25
|
+
import { WorkbenchMcpManagementService } from './vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js';
|
|
26
|
+
import { IWorkbenchMcpManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.service';
|
|
27
|
+
import { McpSandboxService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js';
|
|
28
|
+
import { IWorkbenchMcpGatewayService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service';
|
|
29
|
+
import { BrowserMcpGatewayService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js';
|
|
30
|
+
import { IMcpDevModeDebugging } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpDevMode.service';
|
|
31
|
+
import { McpDevModeDebugging } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpDevMode';
|
|
32
|
+
import './vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js';
|
|
33
|
+
import './vscode/src/vs/workbench/api/browser/mainThreadMcp.js';
|
|
34
|
+
|
|
35
|
+
function getServiceOverride() {
|
|
36
|
+
return {
|
|
37
|
+
[IMcpResourceScannerService.toString()]: new SyncDescriptor(McpResourceScannerService, [], true),
|
|
38
|
+
[IMcpService.toString()]: new SyncDescriptor(McpService, [], true),
|
|
39
|
+
[IMcpRegistry.toString()]: new SyncDescriptor(McpRegistry, [], true),
|
|
40
|
+
[IAuthenticationMcpService.toString()]: new SyncDescriptor(AuthenticationMcpService, [], true),
|
|
41
|
+
[IAuthenticationMcpAccessService.toString()]: new SyncDescriptor(AuthenticationMcpAccessService, [], true),
|
|
42
|
+
[IAuthenticationMcpUsageService.toString()]: new SyncDescriptor(AuthenticationMcpUsageService, [], true),
|
|
43
|
+
[IMcpWorkbenchService.toString()]: new SyncDescriptor(McpWorkbenchService, [], true),
|
|
44
|
+
[IMcpGalleryService.toString()]: new SyncDescriptor(McpGalleryService, [], true),
|
|
45
|
+
[IMcpSamplingService.toString()]: new SyncDescriptor(McpSamplingService, [], true),
|
|
46
|
+
[IMcpElicitationService.toString()]: new SyncDescriptor(McpElicitationService, [], true),
|
|
47
|
+
[IWorkbenchMcpManagementService.toString()]: new SyncDescriptor(WorkbenchMcpManagementService, [], true),
|
|
48
|
+
[IAllowedMcpServersService.toString()]: new SyncDescriptor(AllowedMcpServersService, [], true),
|
|
49
|
+
[IMcpGalleryManifestService.toString()]: new SyncDescriptor(WorkbenchMcpGalleryManifestService, [], true),
|
|
50
|
+
[IMcpSandboxService.toString()]: new SyncDescriptor(McpSandboxService, [], true),
|
|
51
|
+
[IWorkbenchMcpGatewayService.toString()]: new SyncDescriptor(BrowserMcpGatewayService, [], true),
|
|
52
|
+
[IMcpDevModeDebugging.toString()]: new SyncDescriptor(McpDevModeDebugging, [], true)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { getServiceOverride as default };
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function getServiceOverride(): IEditorOverrideServices;
|
|
1
|
+
export { default } from "./common.js";
|
package/index.js
CHANGED
|
@@ -1,54 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
|
-
import { AllowedMcpServersService } from './vscode/src/vs/platform/mcp/common/allowedMcpServersService.js';
|
|
5
|
-
import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
|
|
6
|
-
import { McpGalleryService } from './vscode/src/vs/platform/mcp/common/mcpGalleryService.js';
|
|
7
|
-
import { IAllowedMcpServersService, IMcpGalleryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
8
|
-
import { McpResourceScannerService } from './vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js';
|
|
9
|
-
import { IMcpResourceScannerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service';
|
|
10
|
-
import { McpElicitationService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js';
|
|
11
|
-
import { McpWorkbenchService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js';
|
|
12
|
-
import { McpRegistry } from './vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js';
|
|
13
|
-
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
14
|
-
import { McpSamplingService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js';
|
|
15
|
-
import { IMcpSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpSandboxService.service';
|
|
16
|
-
import { McpService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpService.js';
|
|
17
|
-
import { IMcpElicitationService, IMcpSamplingService, IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
18
|
-
import { AuthenticationMcpAccessService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js';
|
|
19
|
-
import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service';
|
|
20
|
-
import { AuthenticationMcpService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js';
|
|
21
|
-
import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
|
|
22
|
-
import { AuthenticationMcpUsageService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js';
|
|
23
|
-
import { IAuthenticationMcpUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service';
|
|
24
|
-
import { WorkbenchMcpGalleryManifestService } from './vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.js';
|
|
25
|
-
import { WorkbenchMcpManagementService } from './vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js';
|
|
26
|
-
import { IWorkbenchMcpManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.service';
|
|
27
|
-
import { McpSandboxService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js';
|
|
28
|
-
import { IWorkbenchMcpGatewayService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service';
|
|
29
|
-
import { BrowserMcpGatewayService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js';
|
|
30
|
-
import './vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js';
|
|
2
|
+
export { default } from './common.js';
|
|
31
3
|
import './vscode/src/vs/workbench/contrib/mcp/browser/mcp.view.contribution.js';
|
|
32
|
-
import './vscode/src/vs/workbench/api/browser/mainThreadMcp.js';
|
|
33
|
-
|
|
34
|
-
function getServiceOverride() {
|
|
35
|
-
return {
|
|
36
|
-
[IMcpResourceScannerService.toString()]: new SyncDescriptor(McpResourceScannerService, [], true),
|
|
37
|
-
[IMcpService.toString()]: new SyncDescriptor(McpService, [], true),
|
|
38
|
-
[IMcpRegistry.toString()]: new SyncDescriptor(McpRegistry, [], true),
|
|
39
|
-
[IAuthenticationMcpService.toString()]: new SyncDescriptor(AuthenticationMcpService, [], true),
|
|
40
|
-
[IAuthenticationMcpAccessService.toString()]: new SyncDescriptor(AuthenticationMcpAccessService, [], true),
|
|
41
|
-
[IAuthenticationMcpUsageService.toString()]: new SyncDescriptor(AuthenticationMcpUsageService, [], true),
|
|
42
|
-
[IMcpWorkbenchService.toString()]: new SyncDescriptor(McpWorkbenchService, [], true),
|
|
43
|
-
[IMcpGalleryService.toString()]: new SyncDescriptor(McpGalleryService, [], true),
|
|
44
|
-
[IMcpSamplingService.toString()]: new SyncDescriptor(McpSamplingService, [], true),
|
|
45
|
-
[IMcpElicitationService.toString()]: new SyncDescriptor(McpElicitationService, [], true),
|
|
46
|
-
[IWorkbenchMcpManagementService.toString()]: new SyncDescriptor(WorkbenchMcpManagementService, [], true),
|
|
47
|
-
[IAllowedMcpServersService.toString()]: new SyncDescriptor(AllowedMcpServersService, [], true),
|
|
48
|
-
[IMcpGalleryManifestService.toString()]: new SyncDescriptor(WorkbenchMcpGalleryManifestService, [], true),
|
|
49
|
-
[IMcpSandboxService.toString()]: new SyncDescriptor(McpSandboxService, [], true),
|
|
50
|
-
[IWorkbenchMcpGatewayService.toString()]: new SyncDescriptor(BrowserMcpGatewayService, [], true)
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { getServiceOverride as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mcp-service-override",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.3.1"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -31,6 +31,14 @@
|
|
|
31
31
|
"types": "./vscode/src/*.d.ts",
|
|
32
32
|
"default": "./vscode/src/*.js"
|
|
33
33
|
},
|
|
34
|
+
"./session": {
|
|
35
|
+
"types": "./session.d.ts",
|
|
36
|
+
"default": "./session.js"
|
|
37
|
+
},
|
|
38
|
+
"./common": {
|
|
39
|
+
"types": "./common.d.ts",
|
|
40
|
+
"default": "./common.js"
|
|
41
|
+
},
|
|
34
42
|
"./*": {
|
|
35
43
|
"types": "./*.d.ts",
|
|
36
44
|
"default": "./*.js"
|
package/session.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./common.js";
|
package/session.js
ADDED
|
@@ -32,7 +32,7 @@ let AllowedMcpServersService = class AllowedMcpServersService extends Disposable
|
|
|
32
32
|
query: `@id:${mcpAccessConfig}`
|
|
33
33
|
}).toString());
|
|
34
34
|
return (new MarkdownString(localize(
|
|
35
|
-
|
|
35
|
+
2416,
|
|
36
36
|
"Model Context Protocol servers are disabled in the Editor. Please check your [settings]({0}).",
|
|
37
37
|
settingsCommandLink
|
|
38
38
|
)));
|
|
@@ -43,12 +43,12 @@ let AllowedMcpServersService = class AllowedMcpServersService extends Disposable
|
|
|
43
43
|
switch (checkMcpServerAllowed(allowlist, denylist, identity)) {
|
|
44
44
|
case McpServerAllowResult.Denied:
|
|
45
45
|
return (new MarkdownString(localize(
|
|
46
|
-
|
|
46
|
+
2417,
|
|
47
47
|
"This Model Context Protocol server is blocked by your organization's policy. Please contact your administrator for more information."
|
|
48
48
|
)));
|
|
49
49
|
case McpServerAllowResult.NotAllowed:
|
|
50
50
|
return (new MarkdownString(localize(
|
|
51
|
-
|
|
51
|
+
2418,
|
|
52
52
|
"This Model Context Protocol server is not in the list of servers allowed by your organization. Please contact your administrator for more information."
|
|
53
53
|
)));
|
|
54
54
|
}
|
|
@@ -483,7 +483,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
483
483
|
}
|
|
484
484
|
return result;
|
|
485
485
|
}
|
|
486
|
-
await Promise.all(
|
|
486
|
+
await Promise.all(infos.map(async info => {
|
|
487
487
|
try {
|
|
488
488
|
const mcpServer = await this.getMcpServerByName(info, mcpGalleryManifest);
|
|
489
489
|
result.set(info.name, mcpServer ? {
|
|
@@ -498,7 +498,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
498
498
|
status: McpGalleryResolveStatus.Failed
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
|
-
}))
|
|
501
|
+
}));
|
|
502
502
|
return result;
|
|
503
503
|
}
|
|
504
504
|
async getMcpServerByName(
|
|
@@ -545,7 +545,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
545
545
|
async getReadme(gallery, token) {
|
|
546
546
|
const readmeUrl = gallery.readmeUrl;
|
|
547
547
|
if (!readmeUrl) {
|
|
548
|
-
return Promise.resolve(( localize(
|
|
548
|
+
return Promise.resolve(( localize(2419, "No README available")));
|
|
549
549
|
}
|
|
550
550
|
const uri = ( URI.parse(readmeUrl));
|
|
551
551
|
if (uri.scheme === Schemas.file) {
|
|
@@ -557,7 +557,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
if (uri.authority !== "raw.githubusercontent.com") {
|
|
560
|
-
return ( new MarkdownString(( localize(
|
|
560
|
+
return ( new MarkdownString(( localize(2420, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
561
561
|
}
|
|
562
562
|
const context = await this.requestService.request({
|
|
563
563
|
type: "GET",
|
|
@@ -575,9 +575,9 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
575
575
|
let displayName = server.title;
|
|
576
576
|
if (server.githubInfo?.name) {
|
|
577
577
|
if (!displayName) {
|
|
578
|
-
displayName =
|
|
578
|
+
displayName = server.githubInfo.name.split("-").map(
|
|
579
579
|
s => s.toLowerCase() === "mcp" ? "MCP" : s.toLowerCase() === "github" ? "GitHub" : uppercaseFirstLetter(s)
|
|
580
|
-
)
|
|
580
|
+
).join(" ");
|
|
581
581
|
}
|
|
582
582
|
publisher = server.githubInfo.nameWithOwner.split("/")[0];
|
|
583
583
|
} else {
|
|
@@ -589,7 +589,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
if (!displayName) {
|
|
592
|
-
displayName =
|
|
592
|
+
displayName = nameParts[nameParts.length - 1].split("-").map(s => uppercaseFirstLetter(s)).join(" ");
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
if (server.githubInfo?.displayName) {
|
|
@@ -653,7 +653,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
653
653
|
metadata
|
|
654
654
|
} = await this.queryRawGalleryMcpServers(query, mcpGalleryManifest, token);
|
|
655
655
|
return {
|
|
656
|
-
servers:
|
|
656
|
+
servers: servers.map(item => this.toGalleryMcpServer(item, mcpGalleryManifest)),
|
|
657
657
|
metadata
|
|
658
658
|
};
|
|
659
659
|
}
|
|
@@ -36,7 +36,7 @@ let McpResourceScannerService = class McpResourceScannerService extends Disposab
|
|
|
36
36
|
} of servers) {
|
|
37
37
|
existingServers[name] = config;
|
|
38
38
|
if (inputs) {
|
|
39
|
-
const existingInputIds = ( new Set(
|
|
39
|
+
const existingInputIds = ( new Set(updatedInputs.map(input => input.id)));
|
|
40
40
|
const newInputs = inputs.filter(input => !( existingInputIds.has(input.id)));
|
|
41
41
|
updatedInputs = [...updatedInputs, ...newInputs];
|
|
42
42
|
}
|
|
@@ -73,7 +73,9 @@ let McpResourceScannerService = class McpResourceScannerService extends Disposab
|
|
|
73
73
|
allowEmptyContent: true
|
|
74
74
|
}) || {};
|
|
75
75
|
if (errors.length > 0) {
|
|
76
|
-
throw ( new Error(
|
|
76
|
+
throw ( new Error(
|
|
77
|
+
"Failed to parse scanned MCP servers: " + errors.map(e => `[${e.offset}, ${e.length}] ${getParseErrorMessage(e.error)}`).join(", ")
|
|
78
|
+
));
|
|
77
79
|
}
|
|
78
80
|
if (target === ConfigurationTarget.USER) {
|
|
79
81
|
scannedMcpServers = this.fromUserMcpServers(result);
|
|
@@ -131,7 +133,9 @@ let McpResourceScannerService = class McpResourceScannerService extends Disposab
|
|
|
131
133
|
allowEmptyContent: true
|
|
132
134
|
});
|
|
133
135
|
if (errors.length > 0) {
|
|
134
|
-
throw ( new Error(
|
|
136
|
+
throw ( new Error(
|
|
137
|
+
"Failed to parse scanned MCP servers: " + errors.map(e => `[${e.offset}, ${e.length}] ${getParseErrorMessage(e.error)}`).join(", ")
|
|
138
|
+
));
|
|
135
139
|
}
|
|
136
140
|
} catch (error) {
|
|
137
141
|
if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
|
|
@@ -138,7 +138,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
138
138
|
this._proxy.$onDidChangeMcpServerDefinitions(allServers);
|
|
139
139
|
}
|
|
140
140
|
$upsertMcpCollection(collection, serversDto) {
|
|
141
|
-
const servers =
|
|
141
|
+
const servers = serversDto.map(McpServerDefinition.fromSerialized);
|
|
142
142
|
const existing = this._collectionDefinitions.get(collection.id);
|
|
143
143
|
if (existing) {
|
|
144
144
|
existing.servers.set(servers, undefined);
|
|
@@ -247,7 +247,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
247
247
|
const resource = authDetails.resourceMetadata?.resource;
|
|
248
248
|
if (!resource) {
|
|
249
249
|
throw ( new Error(( localize(
|
|
250
|
-
|
|
250
|
+
4985,
|
|
251
251
|
"The enterprise-managed MCP server '{0}' did not advertise a protected-resource metadata document with a 'resource' identifier.",
|
|
252
252
|
server.label
|
|
253
253
|
))));
|
|
@@ -256,7 +256,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
256
256
|
const audience = resourceAuthServers[0];
|
|
257
257
|
if (!audience) {
|
|
258
258
|
throw ( new Error(( localize(
|
|
259
|
-
|
|
259
|
+
4986,
|
|
260
260
|
"The enterprise-managed MCP server '{0}' did not advertise an `authorization_servers` entry in its protected-resource metadata.",
|
|
261
261
|
server.label
|
|
262
262
|
))));
|
|
@@ -343,7 +343,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
343
343
|
const configuredIssuer = config.issuer?.trim();
|
|
344
344
|
if (!configuredIssuer) {
|
|
345
345
|
throw ( new Error(( localize(
|
|
346
|
-
|
|
346
|
+
4987,
|
|
347
347
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be configured. Set it via enterprise policy (Windows Group Policy / macOS managed preferences / Linux `/etc/vscode/policy.json`) or, for local testing, by hand-editing `settings.json`."
|
|
348
348
|
))));
|
|
349
349
|
}
|
|
@@ -352,14 +352,14 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
352
352
|
parsed = ( URI.parse(configuredIssuer));
|
|
353
353
|
} catch {
|
|
354
354
|
throw ( new Error(( localize(
|
|
355
|
-
|
|
355
|
+
4988,
|
|
356
356
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be a valid URL; got '{0}'.",
|
|
357
357
|
configuredIssuer
|
|
358
358
|
))));
|
|
359
359
|
}
|
|
360
360
|
if (parsed.scheme !== "https" && parsed.scheme !== "http") {
|
|
361
361
|
throw ( new Error(( localize(
|
|
362
|
-
|
|
362
|
+
4989,
|
|
363
363
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to use the `https` or `http` scheme; got '{0}'.",
|
|
364
364
|
configuredIssuer
|
|
365
365
|
))));
|
|
@@ -467,9 +467,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
467
467
|
}
|
|
468
468
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
469
469
|
const result = await this.dialogService.prompt({
|
|
470
|
-
message: ( localize(
|
|
470
|
+
message: ( localize(4990, "Incorrect account detected")),
|
|
471
471
|
detail: ( localize(
|
|
472
|
-
|
|
472
|
+
4991,
|
|
473
473
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
474
474
|
chosenAccountLabel,
|
|
475
475
|
requestedAccountLabel
|
|
@@ -477,10 +477,10 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
477
477
|
type: Severity.Warning,
|
|
478
478
|
cancelButton: true,
|
|
479
479
|
buttons: [{
|
|
480
|
-
label: ( localize(
|
|
480
|
+
label: ( localize(4992, "Keep {0}", chosenAccountLabel)),
|
|
481
481
|
run: () => chosenAccountLabel
|
|
482
482
|
}, {
|
|
483
|
-
label: ( localize(
|
|
483
|
+
label: ( localize(4993, "Login with {0}", requestedAccountLabel)),
|
|
484
484
|
run: () => requestedAccountLabel
|
|
485
485
|
}]
|
|
486
486
|
});
|
|
@@ -523,7 +523,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
523
523
|
} catch (e) {
|
|
524
524
|
if (UserInteractionRequiredError.is(e)) {
|
|
525
525
|
server.pushLog(LogLevel.Warning, ( localize(
|
|
526
|
-
|
|
526
|
+
4994,
|
|
527
527
|
"Authentication session for {0} removed, stopping server",
|
|
528
528
|
providerLabel
|
|
529
529
|
)));
|
|
@@ -551,17 +551,17 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
551
551
|
const store = ( new DisposableStore());
|
|
552
552
|
store.add(result);
|
|
553
553
|
store.add(result.onDidChangeServers(servers => {
|
|
554
|
-
this._proxy.$onDidChangeGatewayServers(gatewayId,
|
|
554
|
+
this._proxy.$onDidChangeGatewayServers(gatewayId, servers.map(s => ({
|
|
555
555
|
label: s.label,
|
|
556
556
|
address: s.address
|
|
557
|
-
})))
|
|
557
|
+
})));
|
|
558
558
|
}));
|
|
559
559
|
this._gateways.set(gatewayId, store);
|
|
560
560
|
return {
|
|
561
|
-
servers:
|
|
561
|
+
servers: result.servers.map(s => ({
|
|
562
562
|
label: s.label,
|
|
563
563
|
address: s.address
|
|
564
|
-
}))
|
|
564
|
+
})),
|
|
565
565
|
gatewayId
|
|
566
566
|
};
|
|
567
567
|
}
|
|
@@ -570,18 +570,18 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
570
570
|
}
|
|
571
571
|
async loginPrompt(mcpLabel, providerLabel, recreatingSession) {
|
|
572
572
|
const message = recreatingSession ? ( localize(
|
|
573
|
-
|
|
573
|
+
4995,
|
|
574
574
|
"The MCP Server Definition '{0}' wants you to authenticate to {1}.",
|
|
575
575
|
mcpLabel,
|
|
576
576
|
providerLabel
|
|
577
577
|
)) : ( localize(
|
|
578
|
-
|
|
578
|
+
4996,
|
|
579
579
|
"The MCP Server Definition '{0}' wants to authenticate to {1}.",
|
|
580
580
|
mcpLabel,
|
|
581
581
|
providerLabel
|
|
582
582
|
));
|
|
583
583
|
const buttons = [{
|
|
584
|
-
label: ( localize(
|
|
584
|
+
label: ( localize(4997, "&&Allow")),
|
|
585
585
|
run() {
|
|
586
586
|
return true;
|
|
587
587
|
}
|
|
@@ -113,16 +113,16 @@ registerWorkbenchContribution2(
|
|
|
113
113
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
114
114
|
jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
|
|
115
115
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
116
|
-
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(
|
|
116
|
+
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(15860, "MCP Server"))),
|
|
117
117
|
[( new SyncDescriptor(McpServerEditorInput))]
|
|
118
118
|
);
|
|
119
119
|
( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
|
|
120
120
|
ctor: McpResourceQuickAccess,
|
|
121
121
|
prefix: McpResourceQuickAccess.PREFIX,
|
|
122
122
|
when: ChatContextKeys.enabled,
|
|
123
|
-
placeholder: ( localize(
|
|
123
|
+
placeholder: ( localize(15861, "Filter to an MCP resource")),
|
|
124
124
|
helpEntries: [{
|
|
125
|
-
description: ( localize(
|
|
125
|
+
description: ( localize(15862, "MCP Server Resources")),
|
|
126
126
|
commandId: McpCommandIds.AddConfiguration
|
|
127
127
|
}]
|
|
128
128
|
});
|
|
@@ -43,7 +43,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
43
43
|
_registerAddContextMenu() {
|
|
44
44
|
this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
|
|
45
45
|
type: "pickerPick",
|
|
46
|
-
label: ( localize(
|
|
46
|
+
label: ( localize(15863, "MCP Resources...")),
|
|
47
47
|
icon: Codicon.mcp,
|
|
48
48
|
isEnabled(widget) {
|
|
49
49
|
return !!widget.attachmentCapabilities.supportsMCPAttachments;
|
|
@@ -51,7 +51,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
51
51
|
asPicker: () => {
|
|
52
52
|
const helper = this._instantiationService.createInstance(McpResourcePickHelper);
|
|
53
53
|
return {
|
|
54
|
-
placeholder: ( localize(
|
|
54
|
+
placeholder: ( localize(15864, "Select MCP Resource...")),
|
|
55
55
|
picks: (_query, token) => this._getResourcePicks(token, helper),
|
|
56
56
|
goBack: () => {
|
|
57
57
|
return helper.navigateBack();
|