5 Commits

Author SHA1 Message Date
can1357 2be93e7c84 fix(coding-agent): filter disabled MCP completions
(cherry picked from commit 33886ad9691cf4d330cf1a645e19cae7681c8e94)
2026-07-29 23:07:53 +02:00
Mathews-Tom 416a3cf65e fix(coding-agent): scope disabled-only autocomplete to enable/disable; fix changelog section
- collectMcpServerNames takes an includeDisabled flag (default true); the
  /mcp completer now passes false for test/reconnect/reauth/unauth, whose
  handlers (#resolveServerForAuth, reconnectServer) can never resolve a
  disabled-only discovered name (dropped from mcpManager, absent from
  mcpServers). enable/disable keep offering it since #handleSetEnabled
  handles that case for both directions.
- Moved the /mcp autocomplete CHANGELOG entry from the now-released
  ## [17.1.0] section (where an earlier upstream merge relocated it) back
  under ## [Unreleased].
2026-07-24 07:42:30 +05:30
Mathews-Tom c94873f3ae fix(coding-agent): scope /mcp remove autocomplete to config-file names
/mcp remove <name> only ever succeeds against a config-file mcpServers
entry (project scope by default, user scope via --scope user) —
runtime-discovered-only servers have no config entry and always fail
with "not found in <scope> config". Restrict remove completions to
config-file names, and tag a user-only name with --scope user so the
inserted command is directly executable.
2026-07-24 06:27:17 +05:30
Mathews-Tom d1c828b356 fix(coding-agent): include disabled-discovered servers in /mcp autocomplete, harden config-read failures
- collectMcpServerNames now unions userConfig.disabledServers so a
  third-party-discovered server that was /mcp disable'd (and thus dropped
  from mcpManager.getAllServerNames()) still tab-completes as an /mcp
  enable target.
- collectMcpServerNames accepts an optional preloaded { userConfig,
  projectConfig }; #handleList() passes what it already read instead of
  re-reading both config files a second time.
- /mcp's argument completer catches collectMcpServerNames failures (e.g.
  malformed config JSON) and returns null instead of letting the
  rejection escape un-awaited callers.
2026-07-24 06:24:17 +05:30
Mathews-Tom 5bb4282878 feat(coding-agent): autocomplete MCP server names in /mcp subcommands
Adds an exported collectMcpServerNames() helper (used by both /mcp list
and the new completer) and a runtime-bound getArgumentCompletions for
/mcp that resolves server names after enable/disable/test/remove/
reconnect/reauth/unauth, filtered by the typed prefix. Subcommands with
a different argument shape (add, smithery-search, ...) keep returning
null, and subcommand-name completion is unaffected.

Closes #5654.
2026-07-24 06:01:08 +05:30