Skip to content

feat: expose MCP tool annotations for tool grouping#23195

Merged
matifali merged 3 commits into
mainfrom
fix/mcp-tool-annotations
Mar 18, 2026
Merged

feat: expose MCP tool annotations for tool grouping#23195
matifali merged 3 commits into
mainfrom
fix/mcp-tool-annotations

Conversation

@matifali
Copy link
Copy Markdown
Member

@matifali matifali commented Mar 18, 2026

Summary

  • add shared MCP annotation metadata to toolsdk tools
  • emit MCP tool annotations from both coderd and CLI MCP servers
  • cover annotation serialization in toolsdk, coderd MCP e2e, and CLI MCP tests

Why

  • Coder already exposed MCP tools, but it did not populate MCP tool annotation hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint).
  • Hosts such as Claude Desktop use those hints to classify and group tools, so without them Coder tools can get lumped together.
  • This change adds a shared annotation source in toolsdk and has both MCP servers emit those hints through mcp.Tool.Annotations, avoiding drift between local and remote MCP implementations.

Testing

  • Tested locally on Cladue Desktop and the tools are categorized correctly.
Before After
image image

Note: Done using Coder Agents, reviewed and tested by human locally

@matifali matifali changed the title fix(mcp): annotate tools for host categorization fix: annotate MCP tools for host categorization Mar 18, 2026
@matifali matifali changed the title fix: annotate MCP tools for host categorization fix: expose MCP tool annotations for tool grouping Mar 18, 2026
@matifali matifali requested a review from ThomasK33 March 18, 2026 07:27
@matifali matifali marked this pull request as ready for review March 18, 2026 07:28
@matifali matifali changed the title fix: expose MCP tool annotations for tool grouping feat: expose MCP tool annotations for tool grouping Mar 18, 2026
@ThomasK33
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 617fcc888f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codersdk/toolsdk/toolsdk.go Outdated
Copy link
Copy Markdown
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think Codex has a point about that annotation potentially being read-only for port forwards, but I'll leave it up to you.

Copy link
Copy Markdown
Member Author

Addressed the port-forward annotation feedback in 67083c0. The workspace port-forward tool now uses read-only/idempotent MCP hints, and I added a regression test covering that classification.

@matifali matifali merged commit bd5b62c into main Mar 18, 2026
25 checks passed
@matifali matifali deleted the fix/mcp-tool-annotations branch March 18, 2026 10:21
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants