Conversation
holny
left a comment
There was a problem hiding this comment.
Ran the new suite locally at 3dce088: mcp-tools 7/7 and the help snapshots 35/35 pass (had to run the snapshots with LC_ALL=C — with my default locale yargs prints localized labels, which is a local environment thing, not this PR). The status branch coverage is good: aggregate vs named mode, description suppression in aggregate mode, empty tool list, missing server, disabled/failed/needs_auth all checked.
Two things I'd ask about before this lands:
-
mcp toolsexits non-zero whenever any configured server isn't connected, whilemcp listalways exits 0. In the unfiltered overview adisabledserver is tolerated butneeds_authisn't, so plainopencode mcp toolsfails on any machine where one unrelated server happens to need auth. If that's deliberate it probably deserves a comment marking the asymmetry; if the overview is meant to be informational, only failing for a requested name (or not failing at all in overview mode) would match the rest of the subcommands. -
The listing prints the raw MCP tool name, but the registered name is sanitize(server)_sanitize(tool) (catalog.ts:119, applied at mcp/index.ts:624) — that's what shows up in tool calls and permission configs. Worth saying which one this command lists, or showing the registered form, so people don't copy a name that doesn't match what they see in a session.
Small thing otherwise, but the needs_auth hint pointing at opencode mcp auth <name> is a nice touch.
Thanks for testing this and sharing the feedback! The current exit behavior treats connection/authentication failures as an incomplete tool listing, while disabled servers are intentionally skipped in overview mode. For naming, this command lists the tools exposed by each MCP server, so it preserves the original names and groups them by server. I agree that these can differ from the registered names used in sessions and permission configs. I'd prefer to keep the current behavior, but I'm open to maintainer guidance on these two choices. |
Issue for this PR
Closes #41499
Type of change
What does this PR do?
opencode mcp toolsto list tools grouped by server, andopencode mcp tools <name>to include tool descriptions without starting a chat.How did you verify your code works?
bun typecheck, Prettier, andgit diff --checkpassed.Screenshots / recordings
Actual CLI output rendered from a local MCP demo, showing the server overview and tool descriptions.
Checklist