@wuyax/mcps 0.1.0-beta.2 → 0.1.0-beta.3

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/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ import { Separator, Theme } from '@inquirer/core';
2
+ import { Context } from '@inquirer/type';
1
3
  import { Command } from 'commander';
2
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";
@@ -72,6 +74,7 @@ interface McpInstallResultForAgent {
72
74
  agent: McpAgentType;
73
75
  success: boolean;
74
76
  path: string;
77
+ coConfiguredAgents?: McpAgentType[];
75
78
  error?: string;
76
79
  }
77
80
  interface InstallMcpServerResult {
@@ -94,8 +97,30 @@ interface RemoveMcpServerResult {
94
97
  agent: McpAgentType;
95
98
  path: string;
96
99
  removed: boolean;
100
+ coAffectedAgents?: McpAgentType[];
97
101
  error?: string;
98
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
+ }
99
124
 
100
125
  declare const mcpAgents: Record<McpAgentType, McpAgentConfig>;
101
126
  declare const mcpAgentAliases: Record<string, McpAgentType>;
@@ -245,6 +270,35 @@ declare const resolveTargetAgents: (query?: TargetResolutionQuery) => TargetReso
245
270
  type InstallMcpServerForAgentOptions = McpScopeOptions;
246
271
  declare const installMcpServerForAgent: (serverName: string, serverConfig: McpServerConfig, agentType: McpAgentType, options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent;
247
272
  declare const installMcpServerForAgents: (serverName: string, serverConfig: McpServerConfig, agentTypes: McpAgentType[], options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent[];
273
+ interface InstallToCompatibleAgentsOptions extends McpScopeOptions {
274
+ allAgents: McpAgentType[];
275
+ incompatible?: Array<{
276
+ agent: McpAgentType;
277
+ reason: string;
278
+ }>;
279
+ }
280
+ declare const installToCompatibleAgents: (serverName: string, serverConfig: McpServerConfig, options: InstallToCompatibleAgentsOptions) => McpInstallResultForAgent[];
281
+
282
+ /**
283
+ * Returns candidate agent types relevant for the given scope.
284
+ */
285
+ declare const getCandidateAgentsForScope: (options?: McpScopeOptions) => McpAgentType[];
286
+ /**
287
+ * Returns all other agents sharing the exact same physical configuration target
288
+ * (same configPath and configKey) for the given scope.
289
+ */
290
+ declare const getCoHostedAgents: (agentType: McpAgentType, options?: McpScopeOptions) => McpAgentType[];
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[];
297
+ /**
298
+ * Sorts agent types so that agents sharing the same physical config target
299
+ * appear adjacent to each other in the returned array.
300
+ */
301
+ declare const sortAgentsWithClusters: (agentTypes: McpAgentType[], options?: McpScopeOptions) => McpAgentType[];
248
302
 
249
303
  interface ListInstalledMcpServersOptions extends McpScopeOptions {
250
304
  agents?: McpAgentType[];
@@ -261,6 +315,33 @@ declare const removeMcpServerFromAgent: (serverName: string, agentType: McpAgent
261
315
  }) => RemoveMcpServerResult;
262
316
  declare const removeMcpServer: (options: RemoveMcpServerOptions) => RemoveMcpServerResult[];
263
317
 
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
+ /**
340
+ * Core Orchestration: Updates an existing MCP server across specified or installed coding agents,
341
+ * sanitizing protocol dirty fields and validating transport capabilities.
342
+ */
343
+ declare const updateMcpServer: (options: UpdateMcpServerOptions) => UpdateMcpServerResult;
344
+
264
345
  declare const mainMenu: () => Promise<void>;
265
346
 
266
347
  interface WizardAddOptions extends McpScopeOptions {
@@ -274,19 +355,57 @@ interface WizardAddOptions extends McpScopeOptions {
274
355
  }
275
356
  declare const wizardAdd: (initial?: WizardAddOptions) => Promise<boolean>;
276
357
 
277
- interface WizardManageOptions extends McpScopeOptions {
278
- serverName?: string;
358
+ interface DisplayServerDetailsOptions extends McpScopeOptions {
359
+ serverName: string;
360
+ config: McpServerConfig;
361
+ agents?: McpAgentType[];
362
+ hasDivergence?: boolean;
363
+ titlePrefix?: string;
279
364
  }
280
365
  /**
281
366
  * Reusable display function for server details with secret masking.
282
367
  */
283
- declare const displayServerDetails: ({ serverName, config, agents, isGlobal, titlePrefix, }: {
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 {
284
387
  serverName: string;
388
+ agents: McpAgentType[];
389
+ paths: string[];
285
390
  config: McpServerConfig;
286
- agents?: McpAgentType[];
287
- isGlobal?: boolean;
288
- titlePrefix?: string;
289
- }) => void;
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>;
290
409
  declare const wizardManage: (options?: WizardManageOptions) => Promise<void>;
291
410
 
292
411
  interface WizardRemoveOptions extends McpScopeOptions {
@@ -320,10 +439,6 @@ interface PromptEditKeyValueOptions {
320
439
  */
321
440
  declare const promptEditKeyValueConfig: (currentItems: Record<string, string> | undefined, options: PromptEditKeyValueOptions) => Promise<Record<string, string>>;
322
441
 
323
- /**
324
- * Masks sensitive values for secure CLI display.
325
- */
326
- declare const maskSecretValue: (key: string, value: string) => string;
327
442
  /**
328
443
  * Formats a key-value env record into .env formatted multiline string.
329
444
  */
@@ -351,10 +466,6 @@ declare const promptEnvConfig: (initialEnv?: Record<string, string>) => Promise<
351
466
  */
352
467
  declare const promptEditEnvConfig: (currentEnv?: Record<string, string>) => Promise<Record<string, string>>;
353
468
 
354
- /**
355
- * Masks sensitive HTTP header values for secure CLI display.
356
- */
357
- declare const maskSecretHeader: (key: string, value: string) => string;
358
469
  /**
359
470
  * Formats a key-value headers record into multiline Key: Value text.
360
471
  */
@@ -416,19 +527,71 @@ interface PromptScopeOptions extends McpScopeOptions {
416
527
  */
417
528
  declare const promptScope: (options?: PromptScopeOptions) => Promise<boolean>;
418
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
+
419
582
  declare const mcpManageCommand: Command;
420
583
 
421
- interface GroupedInstalledServer {
422
- serverName: string;
584
+ interface BuildLinkedAgentChoicesOptions {
423
585
  agents: McpAgentType[];
424
- paths: string[];
425
- config: McpServerConfig;
586
+ checkedAgents: McpAgentType[];
587
+ detectedAgents?: McpAgentType[];
588
+ scopeOptions?: McpScopeOptions;
426
589
  }
427
- declare const normalizeServerConfig: (raw: unknown) => McpServerConfig;
428
590
  /**
429
- * Groups a flat array of ListedMcpServer entries by serverName.
591
+ * Builds normalized LinkedChoice items for an interactive agent list,
592
+ * calculating co-hosted agents and attaching link indicators.
430
593
  */
431
- declare const groupInstalledServersByName: (installed: ListedMcpServer[]) => Map<string, GroupedInstalledServer>;
594
+ declare const buildLinkedAgentChoices: (options: BuildLinkedAgentChoicesOptions) => LinkedChoice<McpAgentType>[];
432
595
 
433
596
  /**
434
597
  * Deep module: Transforms standard McpServerConfig into an Agent-specific configuration shape
@@ -451,4 +614,4 @@ declare const transformServerConfigForAgent: (agent: McpAgentConfig, serverName:
451
614
  global: boolean;
452
615
  }) => unknown;
453
616
 
454
- export { AgentConfigStore, type AgentConfigStoreListResult, type AgentConfigStoreRemoveResult, type AgentConfigStoreWriteResult, type ConfigStoreAdapter, type ConfigTargetDescriptor, DEFAULT_REMOTE_TRANSPORT, type GroupedInstalledServer, type IncompatibleAgent, type InstallMcpServerOptions, type InstallMcpServerResult, type ListedMcpServer, type McpAgentConfig, type McpAgentType, type McpConfigFormat, type McpInstallResultForAgent, type McpRemoteServerConfig, type McpRemoteTransport, type McpScopeOptions, type McpServerConfig, type McpSourceType, type McpStdioServerConfig, type McpTransportType, NPX_COMMAND, NPX_DASH_Y, type ParsedMcpSource, type PromptEditKeyValueOptions, type RemoveMcpServerOptions, type RemoveMcpServerResult, type ServerConfigDialect, type ServerConfigDialectName, type ServerConfigDialectOptions, type TargetResolutionQuery, type TargetResolutionResult, type WizardManageOptions, installMcpServer as add, agentConfigStore, buildMcpServerConfig, createAgentTransform, detectGloballyInstalledMcpAgents, detectProjectInstalledMcpAgents, displayServerDetails, extractPackageName, formatArgsString, formatEnvText, formatHeadersText, getMcpAgentConfig, getMcpAgentTypes, getMcpAgentsSupportingProjectScope, groupInstalledServersByName, installMcpServer as install, installMcpServer, installMcpServerForAgent, installMcpServerForAgents, isMcpAgentType, isMcpTransportSupported, isRemoteMcpSource, isRemoteServerConfig, isStdioServerConfig, listInstalledMcpServers as list, listInstalledMcpServers, listServersInConfigFile, mainMenu, maskSecretHeader, maskSecretValue, mcpAgentAliases, mcpAgents, mcpManageCommand, normalizeServerConfig, parseArgsString, parseEnvText, parseHeadersText, parseMcpSource, parseServerConfig, parseMcpSource as parseSource, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, readConfigFile, removeMcpServer as remove, removeMcpServer, removeMcpServerFromAgent, removeServerFromConfigFile, resolveMcpAgentAlias, resolveMcpConfigTarget, resolveTargetAgents, transformServerConfig, transformServerConfigForAgent, installMcpServerForAgent as updateMcpServerForAgent, installMcpServerForAgents as updateMcpServerForAgents, wizardAdd, wizardManage, wizardRemove, writeServerToConfigFile };
617
+ export { AgentConfigStore, type AgentConfigStoreListResult, type AgentConfigStoreRemoveResult, type AgentConfigStoreWriteResult, type BuildLinkedAgentChoicesOptions, type ConfigCluster, type ConfigStoreAdapter, type ConfigTargetDescriptor, DEFAULT_REMOTE_TRANSPORT, type DisplayServerDetailsOptions, type EditServerConfigOptions, type GroupedInstalledServer, type IncompatibleAgent, type InstallMcpServerOptions, type InstallMcpServerResult, type InstallToCompatibleAgentsOptions, type LinkedCheckboxPrompt, type LinkedChoice, type ListedMcpServer, type McpAgentConfig, type McpAgentType, type McpConfigFormat, type McpInstallResultForAgent, type McpRemoteServerConfig, type McpRemoteTransport, type McpScopeOptions, type McpServerConfig, type McpSourceType, type McpStdioServerConfig, type McpTransportType, NPX_COMMAND, NPX_DASH_Y, type ParsedMcpSource, type PromptEditKeyValueOptions, type RemoveMcpServerOptions, type RemoveMcpServerResult, SECRET_HEADER_PATTERN, SECRET_KEY_PATTERN, type ServerConfigDialect, type ServerConfigDialectName, type ServerConfigDialectOptions, type TargetResolutionQuery, type TargetResolutionResult, type UpdateMcpServerOptions, type UpdateMcpServerResult, type UpdateTransitionType, type WizardManageOptions, installMcpServer as add, agentConfigStore, buildLinkedAgentChoices, buildMcpServerConfig, createAgentTransform, detectGloballyInstalledMcpAgents, detectProjectInstalledMcpAgents, detectUpdateTransition, displayServerDetails, extractPackageName, formatArgsString, formatEnvText, formatHeadersText, getCandidateAgentsForScope, getCoHostedAgents, getMcpAgentConfig, getMcpAgentTypes, getMcpAgentsSupportingProjectScope, groupInstalledServersByName, installMcpServer as install, installMcpServer, installMcpServerForAgent, installMcpServerForAgents, installToCompatibleAgents, isMcpAgentType, isMcpTransportSupported, isRemoteMcpSource, isRemoteServerConfig, isStdioServerConfig, linkedCheckbox, listInstalledMcpServers as list, listInstalledMcpServers, listServersInConfigFile, mainMenu, maskSecretHeader, maskSecretValue, mcpAgentAliases, mcpAgents, mcpManageCommand, normalizeServerConfig, parseArgsString, parseEnvText, parseHeadersText, parseMcpSource, parseServerConfig, parseMcpSource as parseSource, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, promptSwitchServerType, readConfigFile, removeMcpServer as remove, removeMcpServer, removeMcpServerFromAgent, removeServerFromConfigFile, resolveConfigClusters, resolveMcpAgentAlias, resolveMcpConfigTarget, resolveTargetAgents, resolveTransport, sanitizeUpdatedServerConfig, sortAgentsWithClusters, toRemoteServerConfig, toStdioServerConfig, transformServerConfig, transformServerConfigForAgent, updateMcpServer as update, updateMcpServer, wizardAdd, wizardManage, wizardRemove, writeServerToConfigFile };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { Separator, Theme } from '@inquirer/core';
2
+ import { Context } from '@inquirer/type';
1
3
  import { Command } from 'commander';
2
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";
@@ -72,6 +74,7 @@ interface McpInstallResultForAgent {
72
74
  agent: McpAgentType;
73
75
  success: boolean;
74
76
  path: string;
77
+ coConfiguredAgents?: McpAgentType[];
75
78
  error?: string;
76
79
  }
77
80
  interface InstallMcpServerResult {
@@ -94,8 +97,30 @@ interface RemoveMcpServerResult {
94
97
  agent: McpAgentType;
95
98
  path: string;
96
99
  removed: boolean;
100
+ coAffectedAgents?: McpAgentType[];
97
101
  error?: string;
98
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
+ }
99
124
 
100
125
  declare const mcpAgents: Record<McpAgentType, McpAgentConfig>;
101
126
  declare const mcpAgentAliases: Record<string, McpAgentType>;
@@ -245,6 +270,35 @@ declare const resolveTargetAgents: (query?: TargetResolutionQuery) => TargetReso
245
270
  type InstallMcpServerForAgentOptions = McpScopeOptions;
246
271
  declare const installMcpServerForAgent: (serverName: string, serverConfig: McpServerConfig, agentType: McpAgentType, options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent;
247
272
  declare const installMcpServerForAgents: (serverName: string, serverConfig: McpServerConfig, agentTypes: McpAgentType[], options?: InstallMcpServerForAgentOptions) => McpInstallResultForAgent[];
273
+ interface InstallToCompatibleAgentsOptions extends McpScopeOptions {
274
+ allAgents: McpAgentType[];
275
+ incompatible?: Array<{
276
+ agent: McpAgentType;
277
+ reason: string;
278
+ }>;
279
+ }
280
+ declare const installToCompatibleAgents: (serverName: string, serverConfig: McpServerConfig, options: InstallToCompatibleAgentsOptions) => McpInstallResultForAgent[];
281
+
282
+ /**
283
+ * Returns candidate agent types relevant for the given scope.
284
+ */
285
+ declare const getCandidateAgentsForScope: (options?: McpScopeOptions) => McpAgentType[];
286
+ /**
287
+ * Returns all other agents sharing the exact same physical configuration target
288
+ * (same configPath and configKey) for the given scope.
289
+ */
290
+ declare const getCoHostedAgents: (agentType: McpAgentType, options?: McpScopeOptions) => McpAgentType[];
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[];
297
+ /**
298
+ * Sorts agent types so that agents sharing the same physical config target
299
+ * appear adjacent to each other in the returned array.
300
+ */
301
+ declare const sortAgentsWithClusters: (agentTypes: McpAgentType[], options?: McpScopeOptions) => McpAgentType[];
248
302
 
249
303
  interface ListInstalledMcpServersOptions extends McpScopeOptions {
250
304
  agents?: McpAgentType[];
@@ -261,6 +315,33 @@ declare const removeMcpServerFromAgent: (serverName: string, agentType: McpAgent
261
315
  }) => RemoveMcpServerResult;
262
316
  declare const removeMcpServer: (options: RemoveMcpServerOptions) => RemoveMcpServerResult[];
263
317
 
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
+ /**
340
+ * Core Orchestration: Updates an existing MCP server across specified or installed coding agents,
341
+ * sanitizing protocol dirty fields and validating transport capabilities.
342
+ */
343
+ declare const updateMcpServer: (options: UpdateMcpServerOptions) => UpdateMcpServerResult;
344
+
264
345
  declare const mainMenu: () => Promise<void>;
265
346
 
266
347
  interface WizardAddOptions extends McpScopeOptions {
@@ -274,19 +355,57 @@ interface WizardAddOptions extends McpScopeOptions {
274
355
  }
275
356
  declare const wizardAdd: (initial?: WizardAddOptions) => Promise<boolean>;
276
357
 
277
- interface WizardManageOptions extends McpScopeOptions {
278
- serverName?: string;
358
+ interface DisplayServerDetailsOptions extends McpScopeOptions {
359
+ serverName: string;
360
+ config: McpServerConfig;
361
+ agents?: McpAgentType[];
362
+ hasDivergence?: boolean;
363
+ titlePrefix?: string;
279
364
  }
280
365
  /**
281
366
  * Reusable display function for server details with secret masking.
282
367
  */
283
- declare const displayServerDetails: ({ serverName, config, agents, isGlobal, titlePrefix, }: {
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 {
284
387
  serverName: string;
388
+ agents: McpAgentType[];
389
+ paths: string[];
285
390
  config: McpServerConfig;
286
- agents?: McpAgentType[];
287
- isGlobal?: boolean;
288
- titlePrefix?: string;
289
- }) => void;
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>;
290
409
  declare const wizardManage: (options?: WizardManageOptions) => Promise<void>;
291
410
 
292
411
  interface WizardRemoveOptions extends McpScopeOptions {
@@ -320,10 +439,6 @@ interface PromptEditKeyValueOptions {
320
439
  */
321
440
  declare const promptEditKeyValueConfig: (currentItems: Record<string, string> | undefined, options: PromptEditKeyValueOptions) => Promise<Record<string, string>>;
322
441
 
323
- /**
324
- * Masks sensitive values for secure CLI display.
325
- */
326
- declare const maskSecretValue: (key: string, value: string) => string;
327
442
  /**
328
443
  * Formats a key-value env record into .env formatted multiline string.
329
444
  */
@@ -351,10 +466,6 @@ declare const promptEnvConfig: (initialEnv?: Record<string, string>) => Promise<
351
466
  */
352
467
  declare const promptEditEnvConfig: (currentEnv?: Record<string, string>) => Promise<Record<string, string>>;
353
468
 
354
- /**
355
- * Masks sensitive HTTP header values for secure CLI display.
356
- */
357
- declare const maskSecretHeader: (key: string, value: string) => string;
358
469
  /**
359
470
  * Formats a key-value headers record into multiline Key: Value text.
360
471
  */
@@ -416,19 +527,71 @@ interface PromptScopeOptions extends McpScopeOptions {
416
527
  */
417
528
  declare const promptScope: (options?: PromptScopeOptions) => Promise<boolean>;
418
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
+
419
582
  declare const mcpManageCommand: Command;
420
583
 
421
- interface GroupedInstalledServer {
422
- serverName: string;
584
+ interface BuildLinkedAgentChoicesOptions {
423
585
  agents: McpAgentType[];
424
- paths: string[];
425
- config: McpServerConfig;
586
+ checkedAgents: McpAgentType[];
587
+ detectedAgents?: McpAgentType[];
588
+ scopeOptions?: McpScopeOptions;
426
589
  }
427
- declare const normalizeServerConfig: (raw: unknown) => McpServerConfig;
428
590
  /**
429
- * Groups a flat array of ListedMcpServer entries by serverName.
591
+ * Builds normalized LinkedChoice items for an interactive agent list,
592
+ * calculating co-hosted agents and attaching link indicators.
430
593
  */
431
- declare const groupInstalledServersByName: (installed: ListedMcpServer[]) => Map<string, GroupedInstalledServer>;
594
+ declare const buildLinkedAgentChoices: (options: BuildLinkedAgentChoicesOptions) => LinkedChoice<McpAgentType>[];
432
595
 
433
596
  /**
434
597
  * Deep module: Transforms standard McpServerConfig into an Agent-specific configuration shape
@@ -451,4 +614,4 @@ declare const transformServerConfigForAgent: (agent: McpAgentConfig, serverName:
451
614
  global: boolean;
452
615
  }) => unknown;
453
616
 
454
- export { AgentConfigStore, type AgentConfigStoreListResult, type AgentConfigStoreRemoveResult, type AgentConfigStoreWriteResult, type ConfigStoreAdapter, type ConfigTargetDescriptor, DEFAULT_REMOTE_TRANSPORT, type GroupedInstalledServer, type IncompatibleAgent, type InstallMcpServerOptions, type InstallMcpServerResult, type ListedMcpServer, type McpAgentConfig, type McpAgentType, type McpConfigFormat, type McpInstallResultForAgent, type McpRemoteServerConfig, type McpRemoteTransport, type McpScopeOptions, type McpServerConfig, type McpSourceType, type McpStdioServerConfig, type McpTransportType, NPX_COMMAND, NPX_DASH_Y, type ParsedMcpSource, type PromptEditKeyValueOptions, type RemoveMcpServerOptions, type RemoveMcpServerResult, type ServerConfigDialect, type ServerConfigDialectName, type ServerConfigDialectOptions, type TargetResolutionQuery, type TargetResolutionResult, type WizardManageOptions, installMcpServer as add, agentConfigStore, buildMcpServerConfig, createAgentTransform, detectGloballyInstalledMcpAgents, detectProjectInstalledMcpAgents, displayServerDetails, extractPackageName, formatArgsString, formatEnvText, formatHeadersText, getMcpAgentConfig, getMcpAgentTypes, getMcpAgentsSupportingProjectScope, groupInstalledServersByName, installMcpServer as install, installMcpServer, installMcpServerForAgent, installMcpServerForAgents, isMcpAgentType, isMcpTransportSupported, isRemoteMcpSource, isRemoteServerConfig, isStdioServerConfig, listInstalledMcpServers as list, listInstalledMcpServers, listServersInConfigFile, mainMenu, maskSecretHeader, maskSecretValue, mcpAgentAliases, mcpAgents, mcpManageCommand, normalizeServerConfig, parseArgsString, parseEnvText, parseHeadersText, parseMcpSource, parseServerConfig, parseMcpSource as parseSource, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, readConfigFile, removeMcpServer as remove, removeMcpServer, removeMcpServerFromAgent, removeServerFromConfigFile, resolveMcpAgentAlias, resolveMcpConfigTarget, resolveTargetAgents, transformServerConfig, transformServerConfigForAgent, installMcpServerForAgent as updateMcpServerForAgent, installMcpServerForAgents as updateMcpServerForAgents, wizardAdd, wizardManage, wizardRemove, writeServerToConfigFile };
617
+ export { AgentConfigStore, type AgentConfigStoreListResult, type AgentConfigStoreRemoveResult, type AgentConfigStoreWriteResult, type BuildLinkedAgentChoicesOptions, type ConfigCluster, type ConfigStoreAdapter, type ConfigTargetDescriptor, DEFAULT_REMOTE_TRANSPORT, type DisplayServerDetailsOptions, type EditServerConfigOptions, type GroupedInstalledServer, type IncompatibleAgent, type InstallMcpServerOptions, type InstallMcpServerResult, type InstallToCompatibleAgentsOptions, type LinkedCheckboxPrompt, type LinkedChoice, type ListedMcpServer, type McpAgentConfig, type McpAgentType, type McpConfigFormat, type McpInstallResultForAgent, type McpRemoteServerConfig, type McpRemoteTransport, type McpScopeOptions, type McpServerConfig, type McpSourceType, type McpStdioServerConfig, type McpTransportType, NPX_COMMAND, NPX_DASH_Y, type ParsedMcpSource, type PromptEditKeyValueOptions, type RemoveMcpServerOptions, type RemoveMcpServerResult, SECRET_HEADER_PATTERN, SECRET_KEY_PATTERN, type ServerConfigDialect, type ServerConfigDialectName, type ServerConfigDialectOptions, type TargetResolutionQuery, type TargetResolutionResult, type UpdateMcpServerOptions, type UpdateMcpServerResult, type UpdateTransitionType, type WizardManageOptions, installMcpServer as add, agentConfigStore, buildLinkedAgentChoices, buildMcpServerConfig, createAgentTransform, detectGloballyInstalledMcpAgents, detectProjectInstalledMcpAgents, detectUpdateTransition, displayServerDetails, extractPackageName, formatArgsString, formatEnvText, formatHeadersText, getCandidateAgentsForScope, getCoHostedAgents, getMcpAgentConfig, getMcpAgentTypes, getMcpAgentsSupportingProjectScope, groupInstalledServersByName, installMcpServer as install, installMcpServer, installMcpServerForAgent, installMcpServerForAgents, installToCompatibleAgents, isMcpAgentType, isMcpTransportSupported, isRemoteMcpSource, isRemoteServerConfig, isStdioServerConfig, linkedCheckbox, listInstalledMcpServers as list, listInstalledMcpServers, listServersInConfigFile, mainMenu, maskSecretHeader, maskSecretValue, mcpAgentAliases, mcpAgents, mcpManageCommand, normalizeServerConfig, parseArgsString, parseEnvText, parseHeadersText, parseMcpSource, parseServerConfig, parseMcpSource as parseSource, promptArgsConfig, promptEditArgs, promptEditEnvConfig, promptEditHeadersConfig, promptEditKeyValueConfig, promptEnvConfig, promptHeadersConfig, promptScope, promptScopeAndAgents, promptSwitchServerType, readConfigFile, removeMcpServer as remove, removeMcpServer, removeMcpServerFromAgent, removeServerFromConfigFile, resolveConfigClusters, resolveMcpAgentAlias, resolveMcpConfigTarget, resolveTargetAgents, resolveTransport, sanitizeUpdatedServerConfig, sortAgentsWithClusters, toRemoteServerConfig, toStdioServerConfig, transformServerConfig, transformServerConfigForAgent, updateMcpServer as update, updateMcpServer, wizardAdd, wizardManage, wizardRemove, writeServerToConfigFile };