You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8b9fd2c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(mcp): retroactively wrap handlers registered before wrapMcpServerWithSentry
wrapMcpServerWithSentry patches the registration methods (registerTool etc.)
so only handlers registered after wrapping get instrumented. When wrapping
happens after registration, the already-stored executors/callbacks are never
touched, silently skipping error capture for those handlers.
Fix by scanning the McpServer's internal registries (_registeredTools,
_registeredResources, _registeredResourceTemplates, _registeredPrompts) after
patching the registration methods, and wrapping the stored callables in-place:
- tools: wrap `executor` (what the SDK calls on tools/call)
- resources/templates: wrap `readCallback`
- prompts: wrap `handler`
Both call orderings are now fully supported. JSDoc updated to reflect this
and reference the upstream SDK source line where executor is invoked.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
0 commit comments