feat(mcp): Patch FastMCP's resource, prompt handlers#5233
Merged
sentrivana merged 12 commits intotoxgen/updatefrom Dec 16, 2025
Merged
feat(mcp): Patch FastMCP's resource, prompt handlers#5233sentrivana merged 12 commits intotoxgen/updatefrom
sentrivana merged 12 commits intotoxgen/updatefrom
Conversation
There was a problem hiding this comment.
Bug: Resource protocol extraction fails when URI passed as kwarg
The resource protocol extraction at line 404 accesses original_args[0] directly without checking if original_args is empty. With the new kwargs support added to _async_handler_wrapper, the URI can be passed as a keyword argument (in original_kwargs["uri"]), leaving original_args empty. This will raise an IndexError. The _prepare_handler_data function was correctly updated to handle both args and kwargs for resources, but the protocol extraction logic wasn't updated consistently.
sentry_sdk/integrations/mcp.py#L403-L404
sentry-python/sentry_sdk/integrations/mcp.py
Lines 403 to 404 in 1822003
alexander-alderman-webb
approved these changes
Dec 16, 2025
sentrivana
added a commit
that referenced
this pull request
Dec 16, 2025
FastMCP fix: #5233 --- Update our test matrix with new releases of integrated frameworks and libraries. ## How it works - Scan PyPI for all supported releases of all frameworks we have a dedicated test suite for. - Pick a representative sample of releases to run our test suite against. We always test the latest and oldest supported version. - Update [tox.ini](https://github.com/getsentry/sentry-python/blob/master/tox.ini) with the new releases. ## Action required - If CI passes on this PR, it's safe to approve and merge. It means our integrations can handle new versions of frameworks that got pulled in. - If CI doesn't pass on this PR, this points to an incompatibility of either our integration or our test setup with a new version of a framework. - Check what the failures look like and either fix them, or update the [test config](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/config.py) and rerun [scripts/generate-test-files.sh](https://github.com/getsentry/sentry-python/blob/master/scripts/generate-test-files.sh). See [scripts/populate_tox/README.md](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/README.md) for what configuration options are available. _____________________ _🤖 This PR was automatically created using [a GitHub action](https://github.com/getsentry/sentry-python/blob/master/.github/workflows/update-tox.yml)._ --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapt to new FastMCP release that broke our integration. FastMCP v2.14.0+ registers its own handlers for prompts and resources directly, bypassing the Server decorators we patch.