Repository navigation
feat(mcp): Keep get_sentry_resource loaded in Claude Code - #1989
sentry-junior[bot] wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Claude Code defers MCP tools behind tool search unless a tool sets `_meta["anthropic/alwaysLoad"]`. harnesses.md named get_sentry_resource as the tool to keep loaded, but no tool sent `_meta`. Add an optional `_meta` field to ToolConfig, pass it to registerTool, and set `anthropic/alwaysLoad` on get_sentry_resource only. A test checks that tools/list exports it on that tool and no other. Co-Authored-By: David Cramer <[email protected]>
bbbf943 to
cd23ede
Compare
Resolve the ToolConfig conflict with #2035: keep the _meta field and the outputSchema-typed handler.
|
@getsentry-bot It looks like it's added to all clients? Can server not sent this field if |
|
Yes. As written, every client gets the key on Why it isn't gated now:
What gating would take:
We're keeping it ungated for now, because clients ignore unknown |
|
This PR has had no activity for 3 days. It closes in 2 days unless someone pushes, comments, or adds the |
Summary
Claude Code hides MCP tools behind tool search unless a tool sets
_meta["anthropic/alwaysLoad"].docs/mcp/harnesses.mdalready namedget_sentry_resourceas the tool to keep loaded, but none of our tools sent_meta.ToolConfiggets an optional_metafield, whichbuildServerpasses toregisterTool.get_sentry_resourceis the only tool that sets{"anthropic/alwaysLoad": true}. A pasted Sentry URL then works without a tool search first. The key follows the current Claude Code docs ("Mark a tool to load upfront or stay deferred").harnesses.mdnow says we set it. A user's server-levelalwaysLoadsetting can still override it.measure-tokensnow includes_meta, so its count matches the wire.Impact
main, which now includes the feat(mcp): Add a display title to every tool #1991 titles (47,553 → 47,564).server.all-tools.test.tschecks thatget_sentry_resourceis the only tool intools/listwith_meta.Checks: package-scoped
tscfor@sentry/mcp-coreand@sentry/mcp-cloudflare, rootlint, and the mcp-core and mcp-cloudflare test suites. After rebasing ontomain(with #1991), I re-ran mcp-coretsc,check:generated, rootlintand the mcp-core tests. I didn't run the roottscortestscripts, because they run the cloudflare build, which uploads source maps to Sentry.via @dcramer.
--
View Session [Sentry]