1
>
/*---------------------------------------------------------------------------------------------
mcpPlatformTypes.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { IStringDictionary } from '../../../base/common/collections.js';
7
>
8
>
export interface IMcpDevModeConfig {
9
>
/** Pattern or list of glob patterns to watch relative to the workspace folder. */
10
>
watch?: string | string[];
11
>
/** Whether to debug the MCP server when it's started. */
12
>
debug?: { type: 'node' } | { type: 'debugpy'; debugpyPath?: string };
13
>
}
14
>
15
>
export interface IMcpSandboxConfiguration {
16
>
network?: {
17
>
allowedDomains?: string[];
18
>
deniedDomains?: string[];
19
>
};
20
>
filesystem?: {
21
>
denyRead?: string[];
22
>
allowWrite?: string[];
23
>
denyWrite?: string[];
24
>
};
25
>
}
26
>
27
>
export const enum McpServerVariableType {
28
>
PROMPT = 'promptString',
29
>
PICK = 'pickString',
30
>
}
31
>
32
>
export interface IMcpServerVariable {
33
>
readonly id: string;
34
>
readonly type: McpServerVariableType;
35
>
readonly description: string;
36
>
readonly password: boolean;
37
>
readonly default?: string;
38
>
readonly options?: readonly string[];
39
>
readonly serverName?: string;
40
>
}
41
>
42
>
export const enum McpServerType {
43
>
LOCAL = 'stdio',
44
>
REMOTE = 'http',
45
>
}
46
>
47
>
export interface ICommonMcpServerConfiguration {
48
>
readonly type: McpServerType;
49
>
readonly version?: string;
50
>
readonly gallery?: boolean | string;
51
>
}
52
>
53
>
export interface IMcpStdioServerConfiguration extends ICommonMcpServerConfiguration {
54
>
readonly type: McpServerType.LOCAL;
55
>
readonly command: string;
56
>
readonly args?: readonly string[];
57
>
readonly env?: Record<string, string | number | null>;
58
>
readonly envFile?: string;
59
>
readonly cwd?: string;
60
>
readonly sandboxEnabled?: boolean;
61
>
readonly dev?: IMcpDevModeConfig;
62
>
}
63
>
64
>
export interface IMcpRemoteServerOAuthConfiguration {
65
>
readonly clientId?: string;
66
>
}
67
>
68
>
export interface IMcpRemoteServerConfiguration extends ICommonMcpServerConfiguration {
69
>
readonly type: McpServerType.REMOTE;
70
>
readonly url: string;
71
>
readonly headers?: Record<string, string>;
72
>
readonly oauth?: IMcpRemoteServerOAuthConfiguration;
73
>
readonly dev?: IMcpDevModeConfig;
74
>
}
75
>
76
>
export type IMcpServerConfiguration = IMcpStdioServerConfiguration | IMcpRemoteServerConfiguration;
77
>
78
>
export interface IMcpServersConfiguration {
79
>
servers?: IStringDictionary<IMcpServerConfiguration>;
80
>
inputs?: IMcpServerVariable[];
81
>
}