Skip to content

Conversation

alexander-alderman-webb
Copy link
Contributor

Calling request.json() reads the request body, and nothing is left in the receive callable that fastapi_mcp passes to the mcp package to read the request.

The fix involves checking if we have a fastapi_mcp endpoint. If so, do not read the request body.

Closes #4764

@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner September 12, 2025 13:51
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.52%. Comparing base (94a92d8) to head (56ec01c).
⚠️ Report is 10 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/fastapi.py 66.66% 1 Missing and 1 partial ⚠️
sentry_sdk/integrations/starlette.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4794      +/-   ##
==========================================
- Coverage   84.55%   84.52%   -0.03%     
==========================================
  Files         158      158              
  Lines       16479    16513      +34     
  Branches     2855     2867      +12     
==========================================
+ Hits        13933    13957      +24     
- Misses       1700     1703       +3     
- Partials      846      853       +7     
Files with missing lines Coverage Δ
sentry_sdk/integrations/fastapi.py 87.35% <66.66%> (-1.67%) ⬇️
sentry_sdk/integrations/starlette.py 84.55% <33.33%> (-0.48%) ⬇️

... and 16 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requests to fastapi-mcp hangs if Sentry is enabled
1 participant