@wuyax/mcps 0.1.0-beta.2 → 0.1.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.
@@ -0,0 +1,228 @@
1
+ import { Separator, Theme } from '@inquirer/core';
2
+ import { Context } from '@inquirer/type';
3
+ import { M as McpAgentType, a as McpScopeOptions, G as GroupedInstalledServer, b as McpServerConfig, c as McpRemoteTransport } from './types-lEP3zGvf.cjs';
4
+
5
+ interface LinkedChoice<Value> {
6
+ value: Value;
7
+ name?: string;
8
+ checkedName?: string;
9
+ description?: string;
10
+ short?: string;
11
+ disabled?: boolean | string;
12
+ checked?: boolean;
13
+ linkedValues?: Value[];
14
+ }
15
+ interface NormalizedLinkedChoice<Value> {
16
+ value: Value;
17
+ name: string;
18
+ checkedName: string;
19
+ description?: string;
20
+ short: string;
21
+ disabled: boolean | string;
22
+ checked: boolean;
23
+ linkedValues: Value[];
24
+ }
25
+ interface LinkedCheckboxTheme {
26
+ icon: {
27
+ checked: string;
28
+ unchecked: string;
29
+ cursor: string;
30
+ disabledChecked: string;
31
+ disabledUnchecked: string;
32
+ };
33
+ style: {
34
+ disabled: (text: string) => string;
35
+ renderSelectedChoices: <T>(selectedChoices: ReadonlyArray<NormalizedLinkedChoice<T>>, allChoices: ReadonlyArray<NormalizedLinkedChoice<T> | Separator>) => string;
36
+ description: (text: string) => string;
37
+ keysHelpTip: (keys: [key: string, action: string][]) => string;
38
+ highlight: (text: string) => string;
39
+ };
40
+ i18n: {
41
+ disabledError: string;
42
+ };
43
+ }
44
+ interface LinkedCheckboxConfig<Value = string> {
45
+ message: string;
46
+ prefix?: string;
47
+ pageSize?: number;
48
+ choices: ReadonlyArray<Separator | Value | LinkedChoice<Value>>;
49
+ loop?: boolean;
50
+ required?: boolean;
51
+ validate?: (choices: readonly NormalizedLinkedChoice<Value>[]) => boolean | string | Promise<string | boolean>;
52
+ theme?: Partial<Theme<LinkedCheckboxTheme>>;
53
+ }
54
+ type LinkedCheckboxPrompt = <Value>(config: LinkedCheckboxConfig<Value>, context?: Context) => Promise<Value[]>;
55
+ declare const linkedCheckbox: LinkedCheckboxPrompt;
56
+
57
+ interface BuildLinkedAgentChoicesOptions {
58
+ agents: McpAgentType[];
59
+ checkedAgents: McpAgentType[];
60
+ detectedAgents?: McpAgentType[];
61
+ scopeOptions?: McpScopeOptions;
62
+ }
63
+ /**
64
+ * Builds normalized LinkedChoice items for an interactive agent list,
65
+ * calculating co-hosted agents and attaching link indicators.
66
+ */
67
+ declare const buildLinkedAgentChoices: (options: BuildLinkedAgentChoicesOptions) => LinkedChoice<McpAgentType>[];
68
+
69
+ interface PromptScopeOptions extends McpScopeOptions {
70
+ defaultGlobal?: boolean;
71
+ message?: string;
72
+ }
73
+ /**
74
+ * Prompts user to choose between project and global scope.
75
+ * Returns true for global, false for project.
76
+ */
77
+ declare const promptScope: (options?: PromptScopeOptions) => Promise<boolean>;
78
+
79
+ interface PromptScopeAndAgentsOptions extends McpScopeOptions {
80
+ defaultGlobal?: boolean;
81
+ defaultAgents?: McpAgentType[];
82
+ }
83
+ interface ScopeAndAgentsResult {
84
+ global: boolean;
85
+ agents: McpAgentType[];
86
+ }
87
+ /**
88
+ * Interactively prompts for scope (Project vs Global) and target agents.
89
+ * Auto-detects installed agents and pre-selects them.
90
+ */
91
+ declare const promptScopeAndAgents: (options?: PromptScopeAndAgentsOptions) => Promise<ScopeAndAgentsResult>;
92
+
93
+ /**
94
+ * Formats a key-value env record into .env formatted multiline string.
95
+ */
96
+ declare const formatEnvText: (env: Record<string, string>) => string;
97
+ /**
98
+ * Parses multiline .env formatted text into a key-value record.
99
+ * Supports:
100
+ * - Empty lines and comments (#)
101
+ * - `export KEY=VALUE` or `KEY=VALUE`
102
+ * - Values with `=` inside
103
+ * - Single/double quoted values
104
+ */
105
+ declare const parseEnvText: (rawText: string) => Record<string, string>;
106
+ /**
107
+ * Prompts user for environment variables.
108
+ * Offers choices:
109
+ * 1. Skip / No env vars
110
+ * 2. Paste multiline .env text
111
+ * 3. Add key-value one by one (with secret mask detection)
112
+ */
113
+ declare const promptEnvConfig: (initialEnv?: Record<string, string>) => Promise<Record<string, string>>;
114
+ /**
115
+ * Dedicated prompt loop for inspecting, modifying, adding, and removing
116
+ * environment variables of an existing MCP server configuration.
117
+ */
118
+ declare const promptEditEnvConfig: (currentEnv?: Record<string, string>) => Promise<Record<string, string>>;
119
+
120
+ /**
121
+ * Formats a key-value headers record into multiline Key: Value text.
122
+ */
123
+ declare const formatHeadersText: (headers: Record<string, string>) => string;
124
+ /**
125
+ * Parses multiline HTTP headers text (Key: Value or Key=Value) into a Record<string, string>.
126
+ */
127
+ declare const parseHeadersText: (rawText: string) => Record<string, string>;
128
+ /**
129
+ * Interactively prompts user for HTTP headers.
130
+ */
131
+ declare const promptHeadersConfig: (initialHeaders?: Record<string, string>) => Promise<Record<string, string>>;
132
+ /**
133
+ * Dedicated prompt loop for inspecting, modifying, adding, and removing
134
+ * HTTP headers of an existing MCP server configuration.
135
+ */
136
+ declare const promptEditHeadersConfig: (currentHeaders?: Record<string, string>) => Promise<Record<string, string>>;
137
+
138
+ /**
139
+ * Parses a command-line argument string into an array of arguments,
140
+ * respecting single and double quotes for arguments with spaces.
141
+ */
142
+ declare const parseArgsString: (rawText: string) => string[];
143
+ /**
144
+ * Prompts the user for additional command-line arguments.
145
+ */
146
+ declare const promptArgsConfig: (initialArgs?: string[]) => Promise<string[]>;
147
+ /**
148
+ * Formats an array of argument strings into a space-separated CLI string,
149
+ * quoting arguments containing spaces or quotes.
150
+ */
151
+ declare const formatArgsString: (args: string[]) => string;
152
+ /**
153
+ * Dedicated prompt for editing command arguments with current arguments pre-filled.
154
+ */
155
+ declare const promptEditArgs: (currentArgs?: string[]) => Promise<string[]>;
156
+
157
+ interface PromptEditKeyValueOptions {
158
+ title: string;
159
+ itemNoun: string;
160
+ itemsNoun: string;
161
+ maskValue: (key: string, value: string) => string;
162
+ isSecretKey: (key: string) => boolean;
163
+ formatText: (items: Record<string, string>) => string;
164
+ parseText: (text: string) => Record<string, string>;
165
+ editorPostfix?: string;
166
+ editorMessage: string;
167
+ pasteMessage: string;
168
+ keyPromptMessage: string;
169
+ valuePromptMessage: string;
170
+ separator: "=" | ":";
171
+ }
172
+ /**
173
+ * Generic reusable interactive key-value editing loop supporting:
174
+ * - Editor launch with pre-filled content ($EDITOR)
175
+ * - Single item upsert (with secret detection & password masking)
176
+ * - Single item deletion
177
+ * - Multiline paste (with merge or replace choices)
178
+ * - Clear all items
179
+ */
180
+ declare const promptEditKeyValueConfig: (currentItems: Record<string, string> | undefined, options: PromptEditKeyValueOptions) => Promise<Record<string, string>>;
181
+
182
+ interface ReadMultilineOptions {
183
+ message: string;
184
+ defaultText?: string;
185
+ postfix?: string;
186
+ }
187
+ /**
188
+ * Reliably reads multiline text from terminal stdin without premature line truncation.
189
+ * Completes when user enters empty line after content or types 'END'.
190
+ */
191
+ declare const readMultilineTextFromTerminal: (message: string, endHint?: string) => Promise<string>;
192
+ /**
193
+ * Opens system $EDITOR (or nano/vi) to edit/paste multiline text with fallback.
194
+ */
195
+ declare const promptEditorText: (options: ReadMultilineOptions) => Promise<string>;
196
+
197
+ interface WizardManageOptions extends McpScopeOptions {
198
+ serverName?: string;
199
+ }
200
+ interface EditServerConfigOptions extends McpScopeOptions {
201
+ targetGroup: GroupedInstalledServer;
202
+ }
203
+ /**
204
+ * Interactive prompt flow to switch an MCP server between stdio and remote protocols.
205
+ */
206
+ declare const promptSwitchServerType: (currentConfig: McpServerConfig, serverName: string) => Promise<McpServerConfig>;
207
+ declare const wizardManage: (options?: WizardManageOptions) => Promise<void>;
208
+
209
+ declare const mainMenu: () => Promise<void>;
210
+
211
+ interface WizardAddOptions extends McpScopeOptions {
212
+ source?: string;
213
+ name?: string;
214
+ agents?: McpAgentType[];
215
+ args?: string[];
216
+ transport?: McpRemoteTransport;
217
+ headers?: Record<string, string>;
218
+ env?: Record<string, string>;
219
+ }
220
+ declare const wizardAdd: (initial?: WizardAddOptions) => Promise<boolean>;
221
+
222
+ interface WizardRemoveOptions extends McpScopeOptions {
223
+ name?: string;
224
+ agents?: McpAgentType[];
225
+ }
226
+ declare const wizardRemove: (options?: WizardRemoveOptions) => Promise<boolean>;
227
+
228
+ export { type BuildLinkedAgentChoicesOptions, type EditServerConfigOptions, type LinkedCheckboxConfig, type LinkedCheckboxPrompt, type LinkedCheckboxTheme, type LinkedChoice, type NormalizedLinkedChoice, type PromptEditKeyValueOptions, type PromptScopeAndAgentsOptions, type PromptScopeOptions, type ReadMultilineOptions, type ScopeAndAgentsResult, type WizardAddOptions, type WizardManageOptions, type WizardRemoveOptions, buildLinkedAgentChoices, formatArgsString, formatEnvText, formatHeadersText, linkedCheckbox, mainMenu, parseArgsString, parseEnvText, parseHeadersText, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEditorText, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, promptSwitchServerType, readMultilineTextFromTerminal, wizardAdd, wizardManage, wizardRemove };
@@ -0,0 +1,228 @@
1
+ import { Separator, Theme } from '@inquirer/core';
2
+ import { Context } from '@inquirer/type';
3
+ import { M as McpAgentType, a as McpScopeOptions, G as GroupedInstalledServer, b as McpServerConfig, c as McpRemoteTransport } from './types-lEP3zGvf.js';
4
+
5
+ interface LinkedChoice<Value> {
6
+ value: Value;
7
+ name?: string;
8
+ checkedName?: string;
9
+ description?: string;
10
+ short?: string;
11
+ disabled?: boolean | string;
12
+ checked?: boolean;
13
+ linkedValues?: Value[];
14
+ }
15
+ interface NormalizedLinkedChoice<Value> {
16
+ value: Value;
17
+ name: string;
18
+ checkedName: string;
19
+ description?: string;
20
+ short: string;
21
+ disabled: boolean | string;
22
+ checked: boolean;
23
+ linkedValues: Value[];
24
+ }
25
+ interface LinkedCheckboxTheme {
26
+ icon: {
27
+ checked: string;
28
+ unchecked: string;
29
+ cursor: string;
30
+ disabledChecked: string;
31
+ disabledUnchecked: string;
32
+ };
33
+ style: {
34
+ disabled: (text: string) => string;
35
+ renderSelectedChoices: <T>(selectedChoices: ReadonlyArray<NormalizedLinkedChoice<T>>, allChoices: ReadonlyArray<NormalizedLinkedChoice<T> | Separator>) => string;
36
+ description: (text: string) => string;
37
+ keysHelpTip: (keys: [key: string, action: string][]) => string;
38
+ highlight: (text: string) => string;
39
+ };
40
+ i18n: {
41
+ disabledError: string;
42
+ };
43
+ }
44
+ interface LinkedCheckboxConfig<Value = string> {
45
+ message: string;
46
+ prefix?: string;
47
+ pageSize?: number;
48
+ choices: ReadonlyArray<Separator | Value | LinkedChoice<Value>>;
49
+ loop?: boolean;
50
+ required?: boolean;
51
+ validate?: (choices: readonly NormalizedLinkedChoice<Value>[]) => boolean | string | Promise<string | boolean>;
52
+ theme?: Partial<Theme<LinkedCheckboxTheme>>;
53
+ }
54
+ type LinkedCheckboxPrompt = <Value>(config: LinkedCheckboxConfig<Value>, context?: Context) => Promise<Value[]>;
55
+ declare const linkedCheckbox: LinkedCheckboxPrompt;
56
+
57
+ interface BuildLinkedAgentChoicesOptions {
58
+ agents: McpAgentType[];
59
+ checkedAgents: McpAgentType[];
60
+ detectedAgents?: McpAgentType[];
61
+ scopeOptions?: McpScopeOptions;
62
+ }
63
+ /**
64
+ * Builds normalized LinkedChoice items for an interactive agent list,
65
+ * calculating co-hosted agents and attaching link indicators.
66
+ */
67
+ declare const buildLinkedAgentChoices: (options: BuildLinkedAgentChoicesOptions) => LinkedChoice<McpAgentType>[];
68
+
69
+ interface PromptScopeOptions extends McpScopeOptions {
70
+ defaultGlobal?: boolean;
71
+ message?: string;
72
+ }
73
+ /**
74
+ * Prompts user to choose between project and global scope.
75
+ * Returns true for global, false for project.
76
+ */
77
+ declare const promptScope: (options?: PromptScopeOptions) => Promise<boolean>;
78
+
79
+ interface PromptScopeAndAgentsOptions extends McpScopeOptions {
80
+ defaultGlobal?: boolean;
81
+ defaultAgents?: McpAgentType[];
82
+ }
83
+ interface ScopeAndAgentsResult {
84
+ global: boolean;
85
+ agents: McpAgentType[];
86
+ }
87
+ /**
88
+ * Interactively prompts for scope (Project vs Global) and target agents.
89
+ * Auto-detects installed agents and pre-selects them.
90
+ */
91
+ declare const promptScopeAndAgents: (options?: PromptScopeAndAgentsOptions) => Promise<ScopeAndAgentsResult>;
92
+
93
+ /**
94
+ * Formats a key-value env record into .env formatted multiline string.
95
+ */
96
+ declare const formatEnvText: (env: Record<string, string>) => string;
97
+ /**
98
+ * Parses multiline .env formatted text into a key-value record.
99
+ * Supports:
100
+ * - Empty lines and comments (#)
101
+ * - `export KEY=VALUE` or `KEY=VALUE`
102
+ * - Values with `=` inside
103
+ * - Single/double quoted values
104
+ */
105
+ declare const parseEnvText: (rawText: string) => Record<string, string>;
106
+ /**
107
+ * Prompts user for environment variables.
108
+ * Offers choices:
109
+ * 1. Skip / No env vars
110
+ * 2. Paste multiline .env text
111
+ * 3. Add key-value one by one (with secret mask detection)
112
+ */
113
+ declare const promptEnvConfig: (initialEnv?: Record<string, string>) => Promise<Record<string, string>>;
114
+ /**
115
+ * Dedicated prompt loop for inspecting, modifying, adding, and removing
116
+ * environment variables of an existing MCP server configuration.
117
+ */
118
+ declare const promptEditEnvConfig: (currentEnv?: Record<string, string>) => Promise<Record<string, string>>;
119
+
120
+ /**
121
+ * Formats a key-value headers record into multiline Key: Value text.
122
+ */
123
+ declare const formatHeadersText: (headers: Record<string, string>) => string;
124
+ /**
125
+ * Parses multiline HTTP headers text (Key: Value or Key=Value) into a Record<string, string>.
126
+ */
127
+ declare const parseHeadersText: (rawText: string) => Record<string, string>;
128
+ /**
129
+ * Interactively prompts user for HTTP headers.
130
+ */
131
+ declare const promptHeadersConfig: (initialHeaders?: Record<string, string>) => Promise<Record<string, string>>;
132
+ /**
133
+ * Dedicated prompt loop for inspecting, modifying, adding, and removing
134
+ * HTTP headers of an existing MCP server configuration.
135
+ */
136
+ declare const promptEditHeadersConfig: (currentHeaders?: Record<string, string>) => Promise<Record<string, string>>;
137
+
138
+ /**
139
+ * Parses a command-line argument string into an array of arguments,
140
+ * respecting single and double quotes for arguments with spaces.
141
+ */
142
+ declare const parseArgsString: (rawText: string) => string[];
143
+ /**
144
+ * Prompts the user for additional command-line arguments.
145
+ */
146
+ declare const promptArgsConfig: (initialArgs?: string[]) => Promise<string[]>;
147
+ /**
148
+ * Formats an array of argument strings into a space-separated CLI string,
149
+ * quoting arguments containing spaces or quotes.
150
+ */
151
+ declare const formatArgsString: (args: string[]) => string;
152
+ /**
153
+ * Dedicated prompt for editing command arguments with current arguments pre-filled.
154
+ */
155
+ declare const promptEditArgs: (currentArgs?: string[]) => Promise<string[]>;
156
+
157
+ interface PromptEditKeyValueOptions {
158
+ title: string;
159
+ itemNoun: string;
160
+ itemsNoun: string;
161
+ maskValue: (key: string, value: string) => string;
162
+ isSecretKey: (key: string) => boolean;
163
+ formatText: (items: Record<string, string>) => string;
164
+ parseText: (text: string) => Record<string, string>;
165
+ editorPostfix?: string;
166
+ editorMessage: string;
167
+ pasteMessage: string;
168
+ keyPromptMessage: string;
169
+ valuePromptMessage: string;
170
+ separator: "=" | ":";
171
+ }
172
+ /**
173
+ * Generic reusable interactive key-value editing loop supporting:
174
+ * - Editor launch with pre-filled content ($EDITOR)
175
+ * - Single item upsert (with secret detection & password masking)
176
+ * - Single item deletion
177
+ * - Multiline paste (with merge or replace choices)
178
+ * - Clear all items
179
+ */
180
+ declare const promptEditKeyValueConfig: (currentItems: Record<string, string> | undefined, options: PromptEditKeyValueOptions) => Promise<Record<string, string>>;
181
+
182
+ interface ReadMultilineOptions {
183
+ message: string;
184
+ defaultText?: string;
185
+ postfix?: string;
186
+ }
187
+ /**
188
+ * Reliably reads multiline text from terminal stdin without premature line truncation.
189
+ * Completes when user enters empty line after content or types 'END'.
190
+ */
191
+ declare const readMultilineTextFromTerminal: (message: string, endHint?: string) => Promise<string>;
192
+ /**
193
+ * Opens system $EDITOR (or nano/vi) to edit/paste multiline text with fallback.
194
+ */
195
+ declare const promptEditorText: (options: ReadMultilineOptions) => Promise<string>;
196
+
197
+ interface WizardManageOptions extends McpScopeOptions {
198
+ serverName?: string;
199
+ }
200
+ interface EditServerConfigOptions extends McpScopeOptions {
201
+ targetGroup: GroupedInstalledServer;
202
+ }
203
+ /**
204
+ * Interactive prompt flow to switch an MCP server between stdio and remote protocols.
205
+ */
206
+ declare const promptSwitchServerType: (currentConfig: McpServerConfig, serverName: string) => Promise<McpServerConfig>;
207
+ declare const wizardManage: (options?: WizardManageOptions) => Promise<void>;
208
+
209
+ declare const mainMenu: () => Promise<void>;
210
+
211
+ interface WizardAddOptions extends McpScopeOptions {
212
+ source?: string;
213
+ name?: string;
214
+ agents?: McpAgentType[];
215
+ args?: string[];
216
+ transport?: McpRemoteTransport;
217
+ headers?: Record<string, string>;
218
+ env?: Record<string, string>;
219
+ }
220
+ declare const wizardAdd: (initial?: WizardAddOptions) => Promise<boolean>;
221
+
222
+ interface WizardRemoveOptions extends McpScopeOptions {
223
+ name?: string;
224
+ agents?: McpAgentType[];
225
+ }
226
+ declare const wizardRemove: (options?: WizardRemoveOptions) => Promise<boolean>;
227
+
228
+ export { type BuildLinkedAgentChoicesOptions, type EditServerConfigOptions, type LinkedCheckboxConfig, type LinkedCheckboxPrompt, type LinkedCheckboxTheme, type LinkedChoice, type NormalizedLinkedChoice, type PromptEditKeyValueOptions, type PromptScopeAndAgentsOptions, type PromptScopeOptions, type ReadMultilineOptions, type ScopeAndAgentsResult, type WizardAddOptions, type WizardManageOptions, type WizardRemoveOptions, buildLinkedAgentChoices, formatArgsString, formatEnvText, formatHeadersText, linkedCheckbox, mainMenu, parseArgsString, parseEnvText, parseHeadersText, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEditorText, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, promptSwitchServerType, readMultilineTextFromTerminal, wizardAdd, wizardManage, wizardRemove };
@@ -0,0 +1,53 @@
1
+ import {
2
+ buildLinkedAgentChoices,
3
+ formatArgsString,
4
+ formatEnvText,
5
+ formatHeadersText,
6
+ linkedCheckbox,
7
+ mainMenu,
8
+ parseArgsString,
9
+ parseEnvText,
10
+ parseHeadersText,
11
+ promptArgsConfig,
12
+ promptEditArgs,
13
+ promptEditEnvConfig,
14
+ promptEditHeadersConfig,
15
+ promptEditKeyValueConfig,
16
+ promptEditorText,
17
+ promptEnvConfig,
18
+ promptHeadersConfig,
19
+ promptScope,
20
+ promptScopeAndAgents,
21
+ promptSwitchServerType,
22
+ readMultilineTextFromTerminal,
23
+ wizardAdd,
24
+ wizardManage,
25
+ wizardRemove
26
+ } from "./chunk-AWD3VQ3S.js";
27
+ import "./chunk-O3BRJFEC.js";
28
+ export {
29
+ buildLinkedAgentChoices,
30
+ formatArgsString,
31
+ formatEnvText,
32
+ formatHeadersText,
33
+ linkedCheckbox,
34
+ mainMenu,
35
+ parseArgsString,
36
+ parseEnvText,
37
+ parseHeadersText,
38
+ promptArgsConfig,
39
+ promptEditArgs,
40
+ promptEditEnvConfig,
41
+ promptEditHeadersConfig,
42
+ promptEditKeyValueConfig,
43
+ promptEditorText,
44
+ promptEnvConfig,
45
+ promptHeadersConfig,
46
+ promptScope,
47
+ promptScopeAndAgents,
48
+ promptSwitchServerType,
49
+ readMultilineTextFromTerminal,
50
+ wizardAdd,
51
+ wizardManage,
52
+ wizardRemove
53
+ };
@@ -0,0 +1,128 @@
1
+ type McpAgentType = "amp" | "antigravity" | "antigravity-cli" | "augment" | "cline" | "cline-cli" | "claude-code" | "claude-desktop" | "codex" | "cursor" | "gemini-cli" | "grok" | "goose" | "github-copilot-cli" | "kimi-code-cli" | "kiro" | "opencode" | "pi" | "qoder" | "qwen-code" | "trae" | "vscode" | "zed";
2
+ type McpConfigFormat = "json" | "jsonc" | "yaml" | "toml";
3
+ type McpTransportType = "http" | "sse" | "stdio";
4
+ type McpRemoteTransport = "http" | "sse";
5
+ type McpSourceType = "remote" | "package" | "command";
6
+ interface ParsedMcpSource {
7
+ type: McpSourceType;
8
+ value: string;
9
+ inferredName: string;
10
+ }
11
+ interface McpServerConfig {
12
+ type?: McpRemoteTransport;
13
+ url?: string;
14
+ headers?: Record<string, string>;
15
+ command?: string;
16
+ args?: string[];
17
+ env?: Record<string, string>;
18
+ }
19
+ type ServerConfigDialectName = "vscode" | "augment" | "amp" | "trae" | "grok" | "cline" | "goose" | "kimi-code" | "kiro" | "opencode" | "pi" | "qwen-code" | "zed";
20
+ interface ServerConfigDialectOptions {
21
+ stdioTransport?: "none" | "type-stdio" | "transport-stdio" | "type-local";
22
+ remoteTransport?: "type-http-sse" | "sse-only-type" | "sse-only-transport" | "none" | "streamable-http" | "streamableHttp" | "streamable_http" | "remote-type" | "qwen";
23
+ commandArray?: boolean;
24
+ commandField?: string;
25
+ argsField?: string;
26
+ envField?: string;
27
+ urlField?: string;
28
+ defaultEnvEmpty?: boolean;
29
+ defaultHeadersEmpty?: boolean;
30
+ extraFields?: Record<string, unknown>;
31
+ includeServerName?: boolean;
32
+ timeoutSeconds?: number;
33
+ }
34
+ type ServerConfigDialect = ServerConfigDialectName | ServerConfigDialectOptions;
35
+ interface McpAgentConfig {
36
+ name: McpAgentType;
37
+ displayName: string;
38
+ globalConfigPath: string;
39
+ projectConfigPath?: string;
40
+ configKey: string;
41
+ projectConfigKey?: string;
42
+ format: McpConfigFormat;
43
+ supportedTransports: readonly McpTransportType[];
44
+ unsupportedTransportMessage?: string;
45
+ detectGlobalInstall: () => boolean;
46
+ detectProjectInstall?: (cwd: string) => boolean;
47
+ resolveConfigPath?: (options: {
48
+ global: boolean;
49
+ cwd: string;
50
+ }) => string;
51
+ transformDialect?: ServerConfigDialect;
52
+ transformConfig?: (serverName: string, config: McpServerConfig, context: {
53
+ global: boolean;
54
+ }) => unknown;
55
+ }
56
+ interface McpScopeOptions {
57
+ global?: boolean;
58
+ cwd?: string;
59
+ }
60
+ interface InstallMcpServerOptions extends McpScopeOptions {
61
+ source: string;
62
+ name?: string;
63
+ agents?: McpAgentType[];
64
+ args?: string[];
65
+ transport?: McpRemoteTransport;
66
+ headers?: Record<string, string>;
67
+ env?: Record<string, string>;
68
+ }
69
+ interface McpInstallResultForAgent {
70
+ agent: McpAgentType;
71
+ success: boolean;
72
+ path: string;
73
+ coConfiguredAgents?: McpAgentType[];
74
+ error?: string;
75
+ }
76
+ interface InstallMcpServerResult {
77
+ serverName: string;
78
+ config: McpServerConfig;
79
+ results: McpInstallResultForAgent[];
80
+ }
81
+ interface ListedMcpServer {
82
+ serverName: string;
83
+ agent: McpAgentType;
84
+ path: string;
85
+ config: unknown;
86
+ serverConfig?: McpServerConfig;
87
+ }
88
+ interface GroupedInstalledServer {
89
+ serverName: string;
90
+ agents: McpAgentType[];
91
+ paths: string[];
92
+ config: McpServerConfig;
93
+ hasDivergence?: boolean;
94
+ }
95
+ interface RemoveMcpServerOptions extends McpScopeOptions {
96
+ name: string;
97
+ agents?: McpAgentType[];
98
+ }
99
+ interface RemoveMcpServerResult {
100
+ agent: McpAgentType;
101
+ path: string;
102
+ removed: boolean;
103
+ coAffectedAgents?: McpAgentType[];
104
+ error?: string;
105
+ }
106
+ interface ConfigCluster {
107
+ configPath: string;
108
+ configKey: string;
109
+ targetAgents: McpAgentType[];
110
+ coHostedAgents: McpAgentType[];
111
+ }
112
+ interface UpdateMcpServerOptions extends McpScopeOptions {
113
+ serverName: string;
114
+ config: McpServerConfig;
115
+ previousConfig?: McpServerConfig;
116
+ agents?: McpAgentType[];
117
+ }
118
+ interface UpdateMcpServerResult {
119
+ serverName: string;
120
+ config: McpServerConfig;
121
+ results: McpInstallResultForAgent[];
122
+ incompatible: {
123
+ agent: McpAgentType;
124
+ reason: string;
125
+ }[];
126
+ }
127
+
128
+ export type { ConfigCluster as C, GroupedInstalledServer as G, InstallMcpServerOptions as I, ListedMcpServer as L, McpAgentType as M, ParsedMcpSource as P, RemoveMcpServerResult as R, ServerConfigDialect as S, UpdateMcpServerOptions as U, McpScopeOptions as a, McpServerConfig as b, McpRemoteTransport as c, McpAgentConfig as d, McpTransportType as e, McpConfigFormat as f, McpInstallResultForAgent as g, InstallMcpServerResult as h, UpdateMcpServerResult as i, RemoveMcpServerOptions as j, McpSourceType as k, ServerConfigDialectName as l, ServerConfigDialectOptions as m };