@wuyax/mcps 0.1.0-beta.3 → 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.
- package/LICENSE +21 -0
- package/README.md +22 -14
- package/dist/chunk-AWD3VQ3S.js +1624 -0
- package/dist/chunk-O3BRJFEC.js +1898 -0
- package/dist/cli.cjs +1057 -979
- package/dist/cli.js +188 -17
- package/dist/index.cjs +702 -2478
- package/dist/index.d.cts +152 -452
- package/dist/index.d.ts +152 -452
- package/dist/index.js +9 -85
- package/dist/{chunk-BUKA3NPJ.js → interactive.cjs} +1555 -1779
- package/dist/interactive.d.cts +228 -0
- package/dist/interactive.d.ts +228 -0
- package/dist/interactive.js +53 -0
- package/dist/types-lEP3zGvf.d.cts +128 -0
- package/dist/types-lEP3zGvf.d.ts +128 -0
- package/package.json +31 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,129 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Command } from 'commander';
|
|
1
|
+
import { M as McpAgentType, d as McpAgentConfig, e as McpTransportType, b as McpServerConfig, c as McpRemoteTransport, P as ParsedMcpSource, f as McpConfigFormat, a as McpScopeOptions, C as ConfigCluster, g as McpInstallResultForAgent, R as RemoveMcpServerResult, I as InstallMcpServerOptions, h as InstallMcpServerResult, U as UpdateMcpServerOptions, i as UpdateMcpServerResult, j as RemoveMcpServerOptions, L as ListedMcpServer, G as GroupedInstalledServer, S as ServerConfigDialect } from './types-lEP3zGvf.js';
|
|
2
|
+
export { k as McpSourceType, l as ServerConfigDialectName, m as ServerConfigDialectOptions } from './types-lEP3zGvf.js';
|
|
4
3
|
|
|
5
|
-
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";
|
|
6
|
-
type McpConfigFormat = "json" | "jsonc" | "yaml" | "toml";
|
|
7
|
-
type McpTransportType = "http" | "sse" | "stdio";
|
|
8
|
-
type McpRemoteTransport = "http" | "sse";
|
|
9
|
-
type McpSourceType = "remote" | "package" | "command";
|
|
10
|
-
interface ParsedMcpSource {
|
|
11
|
-
type: McpSourceType;
|
|
12
|
-
value: string;
|
|
13
|
-
inferredName: string;
|
|
14
|
-
}
|
|
15
|
-
interface McpServerConfig {
|
|
16
|
-
type?: McpRemoteTransport;
|
|
17
|
-
url?: string;
|
|
18
|
-
headers?: Record<string, string>;
|
|
19
|
-
command?: string;
|
|
20
|
-
args?: string[];
|
|
21
|
-
env?: Record<string, string>;
|
|
22
|
-
}
|
|
23
|
-
type ServerConfigDialectName = "vscode" | "augment" | "amp" | "trae" | "grok" | "cline" | "goose" | "kimi-code" | "kiro" | "opencode" | "pi" | "qwen-code" | "zed";
|
|
24
|
-
interface ServerConfigDialectOptions {
|
|
25
|
-
stdioTransport?: "none" | "type-stdio" | "transport-stdio" | "type-local";
|
|
26
|
-
remoteTransport?: "type-http-sse" | "sse-only-type" | "sse-only-transport" | "none" | "streamable-http" | "streamableHttp" | "streamable_http" | "remote-type" | "qwen";
|
|
27
|
-
commandArray?: boolean;
|
|
28
|
-
commandField?: string;
|
|
29
|
-
argsField?: string;
|
|
30
|
-
envField?: string;
|
|
31
|
-
urlField?: string;
|
|
32
|
-
defaultEnvEmpty?: boolean;
|
|
33
|
-
defaultHeadersEmpty?: boolean;
|
|
34
|
-
extraFields?: Record<string, unknown>;
|
|
35
|
-
includeServerName?: boolean;
|
|
36
|
-
timeoutSeconds?: number;
|
|
37
|
-
}
|
|
38
|
-
type ServerConfigDialect = ServerConfigDialectName | ServerConfigDialectOptions;
|
|
39
|
-
interface McpAgentConfig {
|
|
40
|
-
name: McpAgentType;
|
|
41
|
-
displayName: string;
|
|
42
|
-
globalConfigPath: string;
|
|
43
|
-
projectConfigPath?: string;
|
|
44
|
-
configKey: string;
|
|
45
|
-
projectConfigKey?: string;
|
|
46
|
-
format: McpConfigFormat;
|
|
47
|
-
supportedTransports: readonly McpTransportType[];
|
|
48
|
-
unsupportedTransportMessage?: string;
|
|
49
|
-
detectGlobalInstall: () => boolean;
|
|
50
|
-
detectProjectInstall?: (cwd: string) => boolean;
|
|
51
|
-
resolveConfigPath?: (options: {
|
|
52
|
-
global: boolean;
|
|
53
|
-
cwd: string;
|
|
54
|
-
}) => string;
|
|
55
|
-
transformDialect?: ServerConfigDialect;
|
|
56
|
-
transformConfig?: (serverName: string, config: McpServerConfig, context: {
|
|
57
|
-
global: boolean;
|
|
58
|
-
}) => unknown;
|
|
59
|
-
}
|
|
60
|
-
interface McpScopeOptions {
|
|
61
|
-
global?: boolean;
|
|
62
|
-
cwd?: string;
|
|
63
|
-
}
|
|
64
|
-
interface InstallMcpServerOptions extends McpScopeOptions {
|
|
65
|
-
source: string;
|
|
66
|
-
name?: string;
|
|
67
|
-
agents?: McpAgentType[];
|
|
68
|
-
args?: string[];
|
|
69
|
-
transport?: McpRemoteTransport;
|
|
70
|
-
headers?: Record<string, string>;
|
|
71
|
-
env?: Record<string, string>;
|
|
72
|
-
}
|
|
73
|
-
interface McpInstallResultForAgent {
|
|
74
|
-
agent: McpAgentType;
|
|
75
|
-
success: boolean;
|
|
76
|
-
path: string;
|
|
77
|
-
coConfiguredAgents?: McpAgentType[];
|
|
78
|
-
error?: string;
|
|
79
|
-
}
|
|
80
|
-
interface InstallMcpServerResult {
|
|
81
|
-
serverName: string;
|
|
82
|
-
config: McpServerConfig;
|
|
83
|
-
results: McpInstallResultForAgent[];
|
|
84
|
-
}
|
|
85
|
-
interface ListedMcpServer {
|
|
86
|
-
serverName: string;
|
|
87
|
-
agent: McpAgentType;
|
|
88
|
-
path: string;
|
|
89
|
-
config: unknown;
|
|
90
|
-
serverConfig?: McpServerConfig;
|
|
91
|
-
}
|
|
92
|
-
interface RemoveMcpServerOptions extends McpScopeOptions {
|
|
93
|
-
name: string;
|
|
94
|
-
agents?: McpAgentType[];
|
|
95
|
-
}
|
|
96
|
-
interface RemoveMcpServerResult {
|
|
97
|
-
agent: McpAgentType;
|
|
98
|
-
path: string;
|
|
99
|
-
removed: boolean;
|
|
100
|
-
coAffectedAgents?: McpAgentType[];
|
|
101
|
-
error?: string;
|
|
102
|
-
}
|
|
103
|
-
interface ConfigCluster {
|
|
104
|
-
configPath: string;
|
|
105
|
-
configKey: string;
|
|
106
|
-
targetAgents: McpAgentType[];
|
|
107
|
-
coHostedAgents: McpAgentType[];
|
|
108
|
-
}
|
|
109
|
-
interface UpdateMcpServerOptions extends McpScopeOptions {
|
|
110
|
-
serverName: string;
|
|
111
|
-
config: McpServerConfig;
|
|
112
|
-
previousConfig?: McpServerConfig;
|
|
113
|
-
agents?: McpAgentType[];
|
|
114
|
-
}
|
|
115
|
-
interface UpdateMcpServerResult {
|
|
116
|
-
serverName: string;
|
|
117
|
-
config: McpServerConfig;
|
|
118
|
-
results: McpInstallResultForAgent[];
|
|
119
|
-
incompatible: {
|
|
120
|
-
agent: McpAgentType;
|
|
121
|
-
reason: string;
|
|
122
|
-
}[];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare const mcpAgents: Record<McpAgentType, McpAgentConfig>;
|
|
126
|
-
declare const mcpAgentAliases: Record<string, McpAgentType>;
|
|
127
4
|
declare const getMcpAgentConfig: (agentType: McpAgentType) => McpAgentConfig;
|
|
128
5
|
declare const getMcpAgentTypes: () => McpAgentType[];
|
|
129
6
|
declare const isMcpAgentType: (value: string) => value is McpAgentType;
|
|
@@ -133,14 +10,7 @@ declare const detectProjectInstalledMcpAgents: (cwd: string) => McpAgentType[];
|
|
|
133
10
|
declare const detectGloballyInstalledMcpAgents: () => McpAgentType[];
|
|
134
11
|
declare const getMcpAgentsSupportingProjectScope: () => McpAgentType[];
|
|
135
12
|
|
|
136
|
-
|
|
137
|
-
transport?: McpRemoteTransport;
|
|
138
|
-
headers?: Record<string, string>;
|
|
139
|
-
env?: Record<string, string>;
|
|
140
|
-
args?: string[];
|
|
141
|
-
}
|
|
142
|
-
declare const buildMcpServerConfig: (parsed: ParsedMcpSource, options?: BuildMcpServerConfigOptions) => McpServerConfig;
|
|
143
|
-
|
|
13
|
+
type UpdateTransitionType = "switch-to-remote" | "switch-to-stdio" | "merge-remote" | "merge-stdio";
|
|
144
14
|
interface McpRemoteServerConfig {
|
|
145
15
|
type: McpRemoteTransport;
|
|
146
16
|
url: string;
|
|
@@ -159,31 +29,81 @@ declare const isRemoteServerConfig: (config: McpServerConfig) => config is McpRe
|
|
|
159
29
|
* Type guard for local (stdio command/script) server configuration.
|
|
160
30
|
*/
|
|
161
31
|
declare const isStdioServerConfig: (config: McpServerConfig) => config is McpStdioServerConfig;
|
|
32
|
+
interface BuildMcpServerConfigOptions {
|
|
33
|
+
transport?: McpRemoteTransport;
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
env?: Record<string, string>;
|
|
36
|
+
args?: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deep module builder: Constructs a typed standard McpServerConfig from parsed MCP source.
|
|
40
|
+
*/
|
|
41
|
+
declare const buildMcpServerConfig: (parsed: ParsedMcpSource, options?: BuildMcpServerConfigOptions) => McpServerConfig;
|
|
162
42
|
/**
|
|
163
43
|
* Parses and normalizes any unknown raw configuration object from agent config files
|
|
164
44
|
* into a typed standard McpServerConfig domain model.
|
|
165
45
|
*/
|
|
166
46
|
declare const parseServerConfig: (raw: unknown) => McpServerConfig;
|
|
47
|
+
/**
|
|
48
|
+
* Transforms a server configuration into a clean remote configuration,
|
|
49
|
+
* stripping stdio-exclusive fields (command, args, env).
|
|
50
|
+
*/
|
|
51
|
+
declare const toRemoteServerConfig: (config: McpServerConfig, defaultTransport?: McpRemoteTransport) => McpServerConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Transforms a server configuration into a clean stdio configuration,
|
|
54
|
+
* stripping remote-exclusive fields (url, type, headers).
|
|
55
|
+
*/
|
|
56
|
+
declare const toStdioServerConfig: (config: McpServerConfig) => McpServerConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Determines the transition category when updating an MCP server configuration.
|
|
59
|
+
*/
|
|
60
|
+
declare const detectUpdateTransition: (incoming: McpServerConfig, previous?: McpServerConfig) => UpdateTransitionType;
|
|
61
|
+
/**
|
|
62
|
+
* Strips obsolete fields when switching between stdio and remote protocols.
|
|
63
|
+
* When switching to remote (url is provided), stdio fields (command, args, env) are removed.
|
|
64
|
+
* When switching to stdio (command is provided), remote fields (url, type, headers) are removed.
|
|
65
|
+
*/
|
|
66
|
+
declare const sanitizeUpdatedServerConfig: (incoming: McpServerConfig, previous?: McpServerConfig) => McpServerConfig;
|
|
67
|
+
interface ServerConfigDeltaOptions {
|
|
68
|
+
command?: string;
|
|
69
|
+
args?: string[];
|
|
70
|
+
clearArgs?: boolean;
|
|
71
|
+
env?: Record<string, string>;
|
|
72
|
+
clearEnv?: boolean;
|
|
73
|
+
url?: string;
|
|
74
|
+
transport?: McpRemoteTransport;
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
clearHeaders?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface ApplyServerConfigDeltaResult {
|
|
79
|
+
config: McpServerConfig;
|
|
80
|
+
transition: UpdateTransitionType;
|
|
81
|
+
protocol: "remote" | "stdio";
|
|
82
|
+
ignoredFlags: string[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Deep domain operation: Applies modification flags to an existing configuration,
|
|
86
|
+
* validates command vs url mutual exclusion, determines the target protocol,
|
|
87
|
+
* identifies ignored incompatible flags, and produces a clean, sanitized configuration.
|
|
88
|
+
*/
|
|
89
|
+
declare const applyServerConfigDelta: (previousConfig: McpServerConfig | undefined, options: ServerConfigDeltaOptions) => ApplyServerConfigDeltaResult;
|
|
167
90
|
|
|
168
91
|
declare const DEFAULT_REMOTE_TRANSPORT: "http";
|
|
169
|
-
declare const NPX_COMMAND = "npx";
|
|
170
|
-
declare const NPX_DASH_Y = "-y";
|
|
171
92
|
|
|
172
|
-
declare const
|
|
173
|
-
declare const
|
|
174
|
-
declare const
|
|
175
|
-
declare const listServersInConfigFile: (filePath: string, format: McpConfigFormat, dottedKey: string) => Record<string, unknown>;
|
|
93
|
+
declare const extractPackageName: (input: string) => string;
|
|
94
|
+
declare const parseMcpSource: (input: string) => ParsedMcpSource;
|
|
95
|
+
declare const isRemoteMcpSource: (parsed: ParsedMcpSource) => boolean;
|
|
176
96
|
|
|
177
97
|
interface McpConfigTarget {
|
|
178
98
|
configPath: string;
|
|
179
99
|
configKey: string;
|
|
180
100
|
}
|
|
181
|
-
|
|
182
|
-
global?: boolean;
|
|
183
|
-
cwd?: string;
|
|
184
|
-
}
|
|
185
|
-
declare const resolveMcpConfigTarget: (agent: McpAgentConfig, options?: ResolveMcpConfigTargetOptions) => McpConfigTarget;
|
|
101
|
+
declare const resolveMcpConfigTarget: (agent: McpAgentConfig, options?: McpScopeOptions) => McpConfigTarget;
|
|
186
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Returns candidate agent types relevant for the given scope.
|
|
105
|
+
*/
|
|
106
|
+
declare const getCandidateAgentsForScope: (options?: McpScopeOptions) => McpAgentType[];
|
|
187
107
|
interface ConfigTargetDescriptor {
|
|
188
108
|
filePath: string;
|
|
189
109
|
format: McpConfigFormat;
|
|
@@ -209,8 +129,8 @@ interface AgentConfigStoreListResult {
|
|
|
209
129
|
servers: Record<string, unknown>;
|
|
210
130
|
}
|
|
211
131
|
/**
|
|
212
|
-
* Deep module: Coordinates Agent config target resolution,
|
|
213
|
-
* and format persistence behind a unified seam.
|
|
132
|
+
* Deep module: Coordinates Agent config target resolution, cluster deduplication,
|
|
133
|
+
* dialect transforms, file checking, and format persistence behind a unified seam.
|
|
214
134
|
*/
|
|
215
135
|
declare class AgentConfigStore {
|
|
216
136
|
private adapter;
|
|
@@ -224,15 +144,70 @@ declare class AgentConfigStore {
|
|
|
224
144
|
writeServer(agent: McpAgentType | McpAgentConfig, serverName: string, serverConfig: unknown, options?: McpScopeOptions): AgentConfigStoreWriteResult;
|
|
225
145
|
removeServer(agent: McpAgentType | McpAgentConfig, serverName: string, options?: McpScopeOptions): AgentConfigStoreRemoveResult;
|
|
226
146
|
listServers(agent: McpAgentType | McpAgentConfig, options?: McpScopeOptions): AgentConfigStoreListResult;
|
|
147
|
+
/**
|
|
148
|
+
* Batch lists servers for multiple agents, caching adapter reads for co-hosted
|
|
149
|
+
* agents that share the exact same physical configuration file and dotted key.
|
|
150
|
+
*/
|
|
151
|
+
listServersForAgents(agents: McpAgentType[], options?: McpScopeOptions): Array<{
|
|
152
|
+
agent: McpAgentType;
|
|
153
|
+
path: string;
|
|
154
|
+
exists: boolean;
|
|
155
|
+
servers: Record<string, unknown>;
|
|
156
|
+
}>;
|
|
227
157
|
read(agent: McpAgentType | McpAgentConfig, options?: McpScopeOptions): Record<string, unknown>;
|
|
228
158
|
readServer(agent: McpAgentType | McpAgentConfig, serverName: string, options?: McpScopeOptions): unknown | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Returns all other agents sharing the exact same physical configuration target
|
|
161
|
+
* (same configPath and configKey) for the given scope.
|
|
162
|
+
*/
|
|
163
|
+
getCoHostedAgents(agentType: McpAgentType, options?: McpScopeOptions): McpAgentType[];
|
|
164
|
+
/**
|
|
165
|
+
* Resolves configuration clusters for a given list of requested agents.
|
|
166
|
+
* Groups requested agents sharing the same physical config path, and tracks
|
|
167
|
+
* any remaining co-hosted agents sharing the same target that were not in the request.
|
|
168
|
+
*/
|
|
169
|
+
resolveConfigClusters(agentTypes: McpAgentType[], options?: McpScopeOptions): ConfigCluster[];
|
|
170
|
+
/**
|
|
171
|
+
* Sorts agent types so that agents sharing the same physical config target
|
|
172
|
+
* appear adjacent to each other in the returned array.
|
|
173
|
+
*/
|
|
174
|
+
sortAgentsByClusters(agentTypes: McpAgentType[], options?: McpScopeOptions): McpAgentType[];
|
|
175
|
+
/**
|
|
176
|
+
* Alias for sortAgentsByClusters for backward compatibility.
|
|
177
|
+
*/
|
|
178
|
+
sortAgentsWithClusters(agentTypes: McpAgentType[], options?: McpScopeOptions): McpAgentType[];
|
|
179
|
+
/**
|
|
180
|
+
* Batch write: transforms and writes a server config to multiple agents,
|
|
181
|
+
* with automatic cluster deduplication, dialect transform, and co-hosted awareness.
|
|
182
|
+
* Callers pass standard McpServerConfig; the Store applies per-Agent dialect transforms
|
|
183
|
+
* internally before persisting.
|
|
184
|
+
*/
|
|
185
|
+
writeServers(agents: McpAgentType[], serverName: string, serverConfig: McpServerConfig, options?: McpScopeOptions): McpInstallResultForAgent[];
|
|
186
|
+
/**
|
|
187
|
+
* Batch remove: removes a server from multiple agents' configs,
|
|
188
|
+
* with automatic cluster deduplication and co-hosted awareness.
|
|
189
|
+
*/
|
|
190
|
+
removeServers(agents: McpAgentType[], serverName: string, options?: McpScopeOptions): RemoveMcpServerResult[];
|
|
229
191
|
}
|
|
230
192
|
/**
|
|
231
193
|
* Singleton AgentConfigStore using standard file system adapter.
|
|
232
194
|
*/
|
|
233
195
|
declare const agentConfigStore: AgentConfigStore;
|
|
234
196
|
|
|
235
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Returns all other agents sharing the exact same physical configuration target
|
|
199
|
+
* (same configPath and configKey) for the given scope.
|
|
200
|
+
*/
|
|
201
|
+
declare const getCoHostedAgents: (agentType: McpAgentType, options?: McpScopeOptions) => McpAgentType[];
|
|
202
|
+
/**
|
|
203
|
+
* Resolves configuration clusters for a given list of requested agents.
|
|
204
|
+
*/
|
|
205
|
+
declare const resolveConfigClusters: (agentTypes: McpAgentType[], options?: McpScopeOptions) => ConfigCluster[];
|
|
206
|
+
/**
|
|
207
|
+
* Sorts agent types so that agents sharing the same physical config target
|
|
208
|
+
* appear adjacent to each other in the returned array.
|
|
209
|
+
*/
|
|
210
|
+
declare const sortAgentsByClusters: (agentTypes: McpAgentType[], options?: McpScopeOptions) => McpAgentType[];
|
|
236
211
|
|
|
237
212
|
interface TargetResolutionQuery extends McpScopeOptions {
|
|
238
213
|
requested?: string[] | McpAgentType[];
|
|
@@ -267,9 +242,9 @@ interface TargetResolutionResult {
|
|
|
267
242
|
*/
|
|
268
243
|
declare const resolveTargetAgents: (query?: TargetResolutionQuery) => TargetResolutionResult;
|
|
269
244
|
|
|
245
|
+
declare const installMcpServer: (options: InstallMcpServerOptions) => InstallMcpServerResult;
|
|
246
|
+
|
|
270
247
|
type InstallMcpServerForAgentOptions = McpScopeOptions;
|
|
271
|
-
declare const installMcpServerForAgent: (serverName: string, serverConfig: McpServerConfig, agentType: McpAgentType, options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent;
|
|
272
|
-
declare const installMcpServerForAgents: (serverName: string, serverConfig: McpServerConfig, agentTypes: McpAgentType[], options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent[];
|
|
273
248
|
interface InstallToCompatibleAgentsOptions extends McpScopeOptions {
|
|
274
249
|
allAgents: McpAgentType[];
|
|
275
250
|
incompatible?: Array<{
|
|
@@ -277,329 +252,43 @@ interface InstallToCompatibleAgentsOptions extends McpScopeOptions {
|
|
|
277
252
|
reason: string;
|
|
278
253
|
}>;
|
|
279
254
|
}
|
|
280
|
-
declare const installToCompatibleAgents: (serverName: string, serverConfig: McpServerConfig, options: InstallToCompatibleAgentsOptions) => McpInstallResultForAgent[];
|
|
281
|
-
|
|
282
255
|
/**
|
|
283
|
-
*
|
|
256
|
+
* Backward-compatible wrapper: installs a server config for a single agent
|
|
257
|
+
* via the deepened AgentConfigStore.
|
|
284
258
|
*/
|
|
285
|
-
declare const
|
|
259
|
+
declare const installMcpServerForAgent: (serverName: string, serverConfig: McpServerConfig, agentType: McpAgentType, options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent;
|
|
286
260
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
261
|
+
* Backward-compatible wrapper: installs a server config to multiple agents
|
|
262
|
+
* via the deepened AgentConfigStore.
|
|
289
263
|
*/
|
|
290
|
-
declare const
|
|
291
|
-
/**
|
|
292
|
-
* Resolves configuration clusters for a given list of requested agents.
|
|
293
|
-
* Groups requested agents sharing the same physical config path, and tracks
|
|
294
|
-
* any remaining co-hosted agents sharing the same target that were not in the request.
|
|
295
|
-
*/
|
|
296
|
-
declare const resolveConfigClusters: (agentTypes: McpAgentType[], options?: McpScopeOptions) => ConfigCluster[];
|
|
264
|
+
declare const installMcpServerForAgents: (serverName: string, serverConfig: McpServerConfig, agentTypes: McpAgentType[], options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent[];
|
|
297
265
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
266
|
+
* Backward-compatible wrapper: filters out incompatible agents and installs
|
|
267
|
+
* to the remaining compatible ones via the deepened AgentConfigStore.
|
|
300
268
|
*/
|
|
301
|
-
declare const
|
|
302
|
-
|
|
303
|
-
interface ListInstalledMcpServersOptions extends McpScopeOptions {
|
|
304
|
-
agents?: McpAgentType[];
|
|
305
|
-
}
|
|
306
|
-
declare const listInstalledMcpServers: (options?: ListInstalledMcpServersOptions) => ListedMcpServer[];
|
|
307
|
-
|
|
308
|
-
declare const extractPackageName: (input: string) => string;
|
|
309
|
-
declare const parseMcpSource: (input: string) => ParsedMcpSource;
|
|
310
|
-
declare const isRemoteMcpSource: (parsed: ParsedMcpSource) => boolean;
|
|
311
|
-
|
|
312
|
-
declare const removeMcpServerFromAgent: (serverName: string, agentType: McpAgentType, options?: {
|
|
313
|
-
global?: boolean;
|
|
314
|
-
cwd?: string;
|
|
315
|
-
}) => RemoveMcpServerResult;
|
|
316
|
-
declare const removeMcpServer: (options: RemoveMcpServerOptions) => RemoveMcpServerResult[];
|
|
269
|
+
declare const installToCompatibleAgents: (serverName: string, serverConfig: McpServerConfig, options: InstallToCompatibleAgentsOptions) => McpInstallResultForAgent[];
|
|
317
270
|
|
|
318
|
-
/**
|
|
319
|
-
* Transforms a server configuration into a clean remote configuration,
|
|
320
|
-
* stripping stdio-exclusive fields (command, args, env).
|
|
321
|
-
*/
|
|
322
|
-
declare const toRemoteServerConfig: (config: McpServerConfig, defaultTransport?: McpRemoteTransport) => McpServerConfig;
|
|
323
|
-
/**
|
|
324
|
-
* Transforms a server configuration into a clean stdio configuration,
|
|
325
|
-
* stripping remote-exclusive fields (url, type, headers).
|
|
326
|
-
*/
|
|
327
|
-
declare const toStdioServerConfig: (config: McpServerConfig) => McpServerConfig;
|
|
328
|
-
type UpdateTransitionType = "switch-to-remote" | "switch-to-stdio" | "merge-remote" | "merge-stdio";
|
|
329
|
-
/**
|
|
330
|
-
* Determines the transition category when updating an MCP server configuration.
|
|
331
|
-
*/
|
|
332
|
-
declare const detectUpdateTransition: (incoming: McpServerConfig, previous?: McpServerConfig) => UpdateTransitionType;
|
|
333
|
-
/**
|
|
334
|
-
* Strips obsolete fields when switching between stdio and remote protocols.
|
|
335
|
-
* When switching to remote (url is provided), stdio fields (command, args, env) are removed.
|
|
336
|
-
* When switching to stdio (command is provided), remote fields (url, type, headers) are removed.
|
|
337
|
-
*/
|
|
338
|
-
declare const sanitizeUpdatedServerConfig: (incoming: McpServerConfig, previous?: McpServerConfig) => McpServerConfig;
|
|
339
271
|
/**
|
|
340
272
|
* Core Orchestration: Updates an existing MCP server across specified or installed coding agents,
|
|
341
273
|
* sanitizing protocol dirty fields and validating transport capabilities.
|
|
342
274
|
*/
|
|
343
275
|
declare const updateMcpServer: (options: UpdateMcpServerOptions) => UpdateMcpServerResult;
|
|
344
276
|
|
|
345
|
-
declare const
|
|
346
|
-
|
|
347
|
-
interface WizardAddOptions extends McpScopeOptions {
|
|
348
|
-
source?: string;
|
|
349
|
-
name?: string;
|
|
350
|
-
agents?: McpAgentType[];
|
|
351
|
-
args?: string[];
|
|
352
|
-
transport?: McpRemoteTransport;
|
|
353
|
-
headers?: Record<string, string>;
|
|
354
|
-
env?: Record<string, string>;
|
|
355
|
-
}
|
|
356
|
-
declare const wizardAdd: (initial?: WizardAddOptions) => Promise<boolean>;
|
|
357
|
-
|
|
358
|
-
interface DisplayServerDetailsOptions extends McpScopeOptions {
|
|
359
|
-
serverName: string;
|
|
360
|
-
config: McpServerConfig;
|
|
361
|
-
agents?: McpAgentType[];
|
|
362
|
-
hasDivergence?: boolean;
|
|
363
|
-
titlePrefix?: string;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Reusable display function for server details with secret masking.
|
|
367
|
-
*/
|
|
368
|
-
declare const displayServerDetails: ({ serverName, config, agents, hasDivergence, global: isGlobal, titlePrefix, }: DisplayServerDetailsOptions) => void;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Validates and resolves remote transport string into McpRemoteTransport.
|
|
372
|
-
*/
|
|
373
|
-
declare const resolveTransport: (input: string | undefined) => McpRemoteTransport | undefined;
|
|
374
|
-
|
|
375
|
-
declare const SECRET_KEY_PATTERN: RegExp;
|
|
376
|
-
/**
|
|
377
|
-
* Masks sensitive values for secure CLI display.
|
|
378
|
-
*/
|
|
379
|
-
declare const maskSecretValue: (key: string, value: string) => string;
|
|
380
|
-
declare const SECRET_HEADER_PATTERN: RegExp;
|
|
381
|
-
/**
|
|
382
|
-
* Masks sensitive HTTP header values for secure CLI display.
|
|
383
|
-
*/
|
|
384
|
-
declare const maskSecretHeader: (key: string, value: string) => string;
|
|
385
|
-
|
|
386
|
-
interface GroupedInstalledServer {
|
|
387
|
-
serverName: string;
|
|
388
|
-
agents: McpAgentType[];
|
|
389
|
-
paths: string[];
|
|
390
|
-
config: McpServerConfig;
|
|
391
|
-
hasDivergence?: boolean;
|
|
392
|
-
}
|
|
393
|
-
declare const normalizeServerConfig: (raw: unknown) => McpServerConfig;
|
|
394
|
-
/**
|
|
395
|
-
* Groups a flat array of ListedMcpServer entries by serverName.
|
|
396
|
-
*/
|
|
397
|
-
declare const groupInstalledServersByName: (installed: ListedMcpServer[]) => Map<string, GroupedInstalledServer>;
|
|
398
|
-
|
|
399
|
-
interface WizardManageOptions extends McpScopeOptions {
|
|
400
|
-
serverName?: string;
|
|
401
|
-
}
|
|
402
|
-
interface EditServerConfigOptions extends McpScopeOptions {
|
|
403
|
-
targetGroup: GroupedInstalledServer;
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Interactive prompt flow to switch an MCP server between stdio and remote protocols.
|
|
407
|
-
*/
|
|
408
|
-
declare const promptSwitchServerType: (currentConfig: McpServerConfig, serverName: string) => Promise<McpServerConfig>;
|
|
409
|
-
declare const wizardManage: (options?: WizardManageOptions) => Promise<void>;
|
|
277
|
+
declare const removeMcpServer: (options: RemoveMcpServerOptions) => RemoveMcpServerResult[];
|
|
410
278
|
|
|
411
|
-
interface
|
|
412
|
-
name?: string;
|
|
279
|
+
interface ListInstalledMcpServersOptions extends McpScopeOptions {
|
|
413
280
|
agents?: McpAgentType[];
|
|
414
281
|
}
|
|
415
|
-
declare const wizardRemove: (options?: WizardRemoveOptions) => Promise<boolean>;
|
|
416
|
-
|
|
417
|
-
interface PromptEditKeyValueOptions {
|
|
418
|
-
title: string;
|
|
419
|
-
itemNoun: string;
|
|
420
|
-
itemsNoun: string;
|
|
421
|
-
maskValue: (key: string, value: string) => string;
|
|
422
|
-
isSecretKey: (key: string) => boolean;
|
|
423
|
-
formatText: (items: Record<string, string>) => string;
|
|
424
|
-
parseText: (text: string) => Record<string, string>;
|
|
425
|
-
editorPostfix?: string;
|
|
426
|
-
editorMessage: string;
|
|
427
|
-
pasteMessage: string;
|
|
428
|
-
keyPromptMessage: string;
|
|
429
|
-
valuePromptMessage: string;
|
|
430
|
-
separator: "=" | ":";
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Generic reusable interactive key-value editing loop supporting:
|
|
434
|
-
* - Editor launch with pre-filled content ($EDITOR)
|
|
435
|
-
* - Single item upsert (with secret detection & password masking)
|
|
436
|
-
* - Single item deletion
|
|
437
|
-
* - Multiline paste (with merge or replace choices)
|
|
438
|
-
* - Clear all items
|
|
439
|
-
*/
|
|
440
|
-
declare const promptEditKeyValueConfig: (currentItems: Record<string, string> | undefined, options: PromptEditKeyValueOptions) => Promise<Record<string, string>>;
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Formats a key-value env record into .env formatted multiline string.
|
|
444
|
-
*/
|
|
445
|
-
declare const formatEnvText: (env: Record<string, string>) => string;
|
|
446
|
-
/**
|
|
447
|
-
* Parses multiline .env formatted text into a key-value record.
|
|
448
|
-
* Supports:
|
|
449
|
-
* - Empty lines and comments (#)
|
|
450
|
-
* - `export KEY=VALUE` or `KEY=VALUE`
|
|
451
|
-
* - Values with `=` inside
|
|
452
|
-
* - Single/double quoted values
|
|
453
|
-
*/
|
|
454
|
-
declare const parseEnvText: (rawText: string) => Record<string, string>;
|
|
455
|
-
/**
|
|
456
|
-
* Prompts user for environment variables.
|
|
457
|
-
* Offers choices:
|
|
458
|
-
* 1. Skip / No env vars
|
|
459
|
-
* 2. Paste multiline .env text
|
|
460
|
-
* 3. Add key-value one by one (with secret mask detection)
|
|
461
|
-
*/
|
|
462
|
-
declare const promptEnvConfig: (initialEnv?: Record<string, string>) => Promise<Record<string, string>>;
|
|
463
|
-
/**
|
|
464
|
-
* Dedicated prompt loop for inspecting, modifying, adding, and removing
|
|
465
|
-
* environment variables of an existing MCP server configuration.
|
|
466
|
-
*/
|
|
467
|
-
declare const promptEditEnvConfig: (currentEnv?: Record<string, string>) => Promise<Record<string, string>>;
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Formats a key-value headers record into multiline Key: Value text.
|
|
471
|
-
*/
|
|
472
|
-
declare const formatHeadersText: (headers: Record<string, string>) => string;
|
|
473
|
-
/**
|
|
474
|
-
* Parses multiline HTTP headers text (Key: Value or Key=Value) into a Record<string, string>.
|
|
475
|
-
*/
|
|
476
|
-
declare const parseHeadersText: (rawText: string) => Record<string, string>;
|
|
477
|
-
/**
|
|
478
|
-
* Interactively prompts user for HTTP headers.
|
|
479
|
-
*/
|
|
480
|
-
declare const promptHeadersConfig: (initialHeaders?: Record<string, string>) => Promise<Record<string, string>>;
|
|
481
|
-
/**
|
|
482
|
-
* Dedicated prompt loop for inspecting, modifying, adding, and removing
|
|
483
|
-
* HTTP headers of an existing MCP server configuration.
|
|
484
|
-
*/
|
|
485
|
-
declare const promptEditHeadersConfig: (currentHeaders?: Record<string, string>) => Promise<Record<string, string>>;
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Parses a command-line argument string into an array of arguments,
|
|
489
|
-
* respecting single and double quotes for arguments with spaces.
|
|
490
|
-
*/
|
|
491
|
-
declare const parseArgsString: (rawText: string) => string[];
|
|
492
|
-
/**
|
|
493
|
-
* Prompts the user for additional command-line arguments.
|
|
494
|
-
*/
|
|
495
|
-
declare const promptArgsConfig: (initialArgs?: string[]) => Promise<string[]>;
|
|
496
|
-
/**
|
|
497
|
-
* Formats an array of argument strings into a space-separated CLI string,
|
|
498
|
-
* quoting arguments containing spaces or quotes.
|
|
499
|
-
*/
|
|
500
|
-
declare const formatArgsString: (args: string[]) => string;
|
|
501
|
-
/**
|
|
502
|
-
* Dedicated prompt for editing command arguments with current arguments pre-filled.
|
|
503
|
-
*/
|
|
504
|
-
declare const promptEditArgs: (currentArgs?: string[]) => Promise<string[]>;
|
|
505
|
-
|
|
506
|
-
interface PromptScopeAndAgentsOptions extends McpScopeOptions {
|
|
507
|
-
defaultGlobal?: boolean;
|
|
508
|
-
defaultAgents?: McpAgentType[];
|
|
509
|
-
}
|
|
510
|
-
interface ScopeAndAgentsResult {
|
|
511
|
-
global: boolean;
|
|
512
|
-
agents: McpAgentType[];
|
|
513
|
-
}
|
|
514
282
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
283
|
+
* Deep module query: Lists installed MCP servers across agents.
|
|
284
|
+
* Adapter read caching is encapsulated by AgentConfigStore.
|
|
517
285
|
*/
|
|
518
|
-
declare const
|
|
519
|
-
|
|
520
|
-
interface PromptScopeOptions extends McpScopeOptions {
|
|
521
|
-
defaultGlobal?: boolean;
|
|
522
|
-
message?: string;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Prompts user to choose between project and global scope.
|
|
526
|
-
* Returns true for global, false for project.
|
|
527
|
-
*/
|
|
528
|
-
declare const promptScope: (options?: PromptScopeOptions) => Promise<boolean>;
|
|
529
|
-
|
|
530
|
-
interface LinkedChoice<Value> {
|
|
531
|
-
value: Value;
|
|
532
|
-
name?: string;
|
|
533
|
-
checkedName?: string;
|
|
534
|
-
description?: string;
|
|
535
|
-
short?: string;
|
|
536
|
-
disabled?: boolean | string;
|
|
537
|
-
checked?: boolean;
|
|
538
|
-
linkedValues?: Value[];
|
|
539
|
-
}
|
|
540
|
-
interface NormalizedLinkedChoice<Value> {
|
|
541
|
-
value: Value;
|
|
542
|
-
name: string;
|
|
543
|
-
checkedName: string;
|
|
544
|
-
description?: string;
|
|
545
|
-
short: string;
|
|
546
|
-
disabled: boolean | string;
|
|
547
|
-
checked: boolean;
|
|
548
|
-
linkedValues: Value[];
|
|
549
|
-
}
|
|
550
|
-
interface LinkedCheckboxTheme {
|
|
551
|
-
icon: {
|
|
552
|
-
checked: string;
|
|
553
|
-
unchecked: string;
|
|
554
|
-
cursor: string;
|
|
555
|
-
disabledChecked: string;
|
|
556
|
-
disabledUnchecked: string;
|
|
557
|
-
};
|
|
558
|
-
style: {
|
|
559
|
-
disabled: (text: string) => string;
|
|
560
|
-
renderSelectedChoices: <T>(selectedChoices: ReadonlyArray<NormalizedLinkedChoice<T>>, allChoices: ReadonlyArray<NormalizedLinkedChoice<T> | Separator>) => string;
|
|
561
|
-
description: (text: string) => string;
|
|
562
|
-
keysHelpTip: (keys: [key: string, action: string][]) => string;
|
|
563
|
-
highlight: (text: string) => string;
|
|
564
|
-
};
|
|
565
|
-
i18n: {
|
|
566
|
-
disabledError: string;
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
interface LinkedCheckboxConfig<Value = string> {
|
|
570
|
-
message: string;
|
|
571
|
-
prefix?: string;
|
|
572
|
-
pageSize?: number;
|
|
573
|
-
choices: ReadonlyArray<Separator | Value | LinkedChoice<Value>>;
|
|
574
|
-
loop?: boolean;
|
|
575
|
-
required?: boolean;
|
|
576
|
-
validate?: (choices: readonly NormalizedLinkedChoice<Value>[]) => boolean | string | Promise<string | boolean>;
|
|
577
|
-
theme?: Partial<Theme<LinkedCheckboxTheme>>;
|
|
578
|
-
}
|
|
579
|
-
type LinkedCheckboxPrompt = <Value>(config: LinkedCheckboxConfig<Value>, context?: Context) => Promise<Value[]>;
|
|
580
|
-
declare const linkedCheckbox: LinkedCheckboxPrompt;
|
|
581
|
-
|
|
582
|
-
declare const mcpManageCommand: Command;
|
|
583
|
-
|
|
584
|
-
interface BuildLinkedAgentChoicesOptions {
|
|
585
|
-
agents: McpAgentType[];
|
|
586
|
-
checkedAgents: McpAgentType[];
|
|
587
|
-
detectedAgents?: McpAgentType[];
|
|
588
|
-
scopeOptions?: McpScopeOptions;
|
|
589
|
-
}
|
|
286
|
+
declare const listInstalledMcpServers: (options?: ListInstalledMcpServersOptions) => ListedMcpServer[];
|
|
590
287
|
/**
|
|
591
|
-
*
|
|
592
|
-
* calculating co-hosted agents and attaching link indicators.
|
|
288
|
+
* High-level query combining server listing and grouping in a single call.
|
|
593
289
|
*/
|
|
594
|
-
declare const
|
|
290
|
+
declare const queryGroupedInstalledServers: (options?: ListInstalledMcpServersOptions) => Map<string, GroupedInstalledServer>;
|
|
595
291
|
|
|
596
|
-
/**
|
|
597
|
-
* Deep module: Transforms standard McpServerConfig into an Agent-specific configuration shape
|
|
598
|
-
* driven by declarative dialects.
|
|
599
|
-
*/
|
|
600
|
-
declare const transformServerConfig: (serverName: string, config: McpServerConfig, dialect: ServerConfigDialect, _context?: {
|
|
601
|
-
global?: boolean;
|
|
602
|
-
}) => unknown;
|
|
603
292
|
/**
|
|
604
293
|
* Factory creating an agent-bound transform function from a declarative dialect.
|
|
605
294
|
*/
|
|
@@ -614,4 +303,15 @@ declare const transformServerConfigForAgent: (agent: McpAgentConfig, serverName:
|
|
|
614
303
|
global: boolean;
|
|
615
304
|
}) => unknown;
|
|
616
305
|
|
|
617
|
-
|
|
306
|
+
declare const SECRET_KEY_PATTERN: RegExp;
|
|
307
|
+
/**
|
|
308
|
+
* Masks sensitive values for secure CLI display.
|
|
309
|
+
*/
|
|
310
|
+
declare const maskSecretValue: (key: string, value: string) => string;
|
|
311
|
+
declare const SECRET_HEADER_PATTERN: RegExp;
|
|
312
|
+
/**
|
|
313
|
+
* Masks sensitive HTTP header values for secure CLI display.
|
|
314
|
+
*/
|
|
315
|
+
declare const maskSecretHeader: (key: string, value: string) => string;
|
|
316
|
+
|
|
317
|
+
export { AgentConfigStore, type AgentConfigStoreListResult, type AgentConfigStoreRemoveResult, type AgentConfigStoreWriteResult, type ApplyServerConfigDeltaResult, type BuildMcpServerConfigOptions, ConfigCluster, type ConfigStoreAdapter, type ConfigTargetDescriptor, DEFAULT_REMOTE_TRANSPORT, GroupedInstalledServer, type IncompatibleAgent, InstallMcpServerOptions, InstallMcpServerResult, type InstallToCompatibleAgentsOptions, ListedMcpServer, McpAgentConfig, McpAgentType, McpConfigFormat, type McpConfigTarget, McpInstallResultForAgent, type McpRemoteServerConfig, McpRemoteTransport, McpScopeOptions, McpServerConfig, type McpStdioServerConfig, McpTransportType, ParsedMcpSource, RemoveMcpServerOptions, RemoveMcpServerResult, SECRET_HEADER_PATTERN, SECRET_KEY_PATTERN, type ServerConfigDeltaOptions, ServerConfigDialect, type TargetResolutionQuery, type TargetResolutionResult, UpdateMcpServerOptions, UpdateMcpServerResult, type UpdateTransitionType, agentConfigStore, applyServerConfigDelta, buildMcpServerConfig, createAgentTransform, detectGloballyInstalledMcpAgents, detectProjectInstalledMcpAgents, detectUpdateTransition, extractPackageName, getCandidateAgentsForScope, getCoHostedAgents, getMcpAgentConfig, getMcpAgentTypes, getMcpAgentsSupportingProjectScope, installMcpServer, installMcpServerForAgent, installMcpServerForAgents, installToCompatibleAgents, isMcpAgentType, isMcpTransportSupported, isRemoteMcpSource, isRemoteServerConfig, isStdioServerConfig, listInstalledMcpServers, maskSecretHeader, maskSecretValue, parseMcpSource, parseServerConfig, queryGroupedInstalledServers, removeMcpServer, resolveConfigClusters, resolveMcpAgentAlias, resolveMcpConfigTarget, resolveTargetAgents, sanitizeUpdatedServerConfig, sortAgentsByClusters, toRemoteServerConfig, toStdioServerConfig, transformServerConfigForAgent, updateMcpServer };
|