Skip to content

Conversation

@constantinius
Copy link
Contributor

Description

Fixes the wrong handling of mcp.transport, it should be one of "http", "sse", or "stdio", not "pipe" or "tcp". These values are for the network.transport attribute which was also introduced.

Issues

@constantinius constantinius requested a review from a team as a code owner November 4, 2025 12:11
@linear
Copy link

linear bot commented Nov 4, 2025

@constantinius constantinius requested a review from a team November 4, 2025 12:11
"mcp-session-id"
):
# StreamableHTTP transport uses header
mcp_transport = "http"
Copy link

Choose a reason for hiding this comment

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

Bug: Misclassified Requests Default to Stdio Transport Mode

The _get_request_context_data function defaults mcp_transport to "stdio" even when a request object is present. This misclassifies network-based HTTP requests as "stdio" if specific session ID indicators are absent.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.90%. Comparing base (7264a9f) to head (c498e4e).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/mcp.py 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5063      +/-   ##
==========================================
- Coverage   83.94%   83.90%   -0.05%     
==========================================
  Files         179      179              
  Lines       17904    17922      +18     
  Branches     3179     3188       +9     
==========================================
+ Hits        15030    15037       +7     
- Misses       1902     1910       +8     
- Partials      972      975       +3     
Files with missing lines Coverage Δ
sentry_sdk/consts.py 99.40% <100.00%> (+<0.01%) ⬆️
sentry_sdk/integrations/mcp.py 80.00% <90.90%> (+0.36%) ⬆️

... and 4 files with indirect coverage changes

constantinius added a commit to getsentry/sentry-docs that referenced this pull request Nov 4, 2025
@constantinius constantinius merged commit d0e7d14 into master Nov 4, 2025
134 of 136 checks passed
@constantinius constantinius deleted the constantinius/fix/integrations/mcp-transport branch November 4, 2025 13:40
constantinius added a commit to getsentry/sentry-docs that referenced this pull request Nov 4, 2025
## DESCRIBE YOUR PR

Correcting emitted values for `mcp.transport` attributes.

Contributes to
https://linear.app/getsentry/issue/TET-1354/mcp-transport-vs-network-transport

Addressing changes from here
getsentry/sentry-python#5063


## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
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.

4 participants