René's URL Explorer Experiment


Title: Propagate contextvars.Context through anyio streams without modifying SessionMessage by Kludex · Pull Request #2298 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Propagate contextvars.Context through anyio streams without modifying SessionMessage by Kludex · Pull Request #2298 · modelcontextprotocol/python-sdk

X Title: Propagate contextvars.Context through anyio streams without modifying SessionMessage by Kludex · Pull Request #2298 · modelcontextprotocol/python-sdk

Description: The official Python SDK for Model Context Protocol servers and clients - Propagate contextvars.Context through anyio streams without modifying SessionMessage by Kludex · Pull Request #2298 · modelcontextprotocol/python-sdk

Open Graph Description: Summary MCP server handlers currently lose the sender's contextvars.Context. When a client sets context variables (e.g. OpenTelemetry trace/span IDs) before sending a request, the server handle...

X Description: Summary MCP server handlers currently lose the sender's contextvars.Context. When a client sets context variables (e.g. OpenTelemetry trace/span IDs) before sending a request, the server ha...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2298

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:da282ea3-fc79-96de-baa0-19bb0f137ead
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id84C4:162130:157C9E:1F13B0:6A61FAD8
html-safe-noncea3634d048239e01415e580d699af0b9b829e01e1135e077f5085abb8d1d4cb21
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEM0OjE2MjEzMDoxNTdDOUU6MUYxM0IwOjZBNjFGQUQ4IiwidmlzaXRvcl9pZCI6IjU1ODIzMTQ2OTc3NDk5NDEzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1a25bee9e5b4e9ab27c88def8cbb436c0b09496e6978b07f3dd18e904da944ce
hovercard-subject-tagpull_request:3403036968
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
twitter:imagehttps://opengraph.githubassets.com/25d95c94ed199177e632717063aa878cf23f8ba136d4bc24affc6754297f0153/modelcontextprotocol/python-sdk/pull/2298
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/25d95c94ed199177e632717063aa878cf23f8ba136d4bc24affc6754297f0153/modelcontextprotocol/python-sdk/pull/2298
og:image:altSummary MCP server handlers currently lose the sender's contextvars.Context. When a client sets context variables (e.g. OpenTelemetry trace/span IDs) before sending a request, the server handle...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameKludex
hostnamegithub.com
expected-hostnamegithub.com
None9e41a6fd863e96b9c7e9185dc317bf107dbbf8cb10efd6dea957211963f33775
turbo-cache-controlno-cache
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2ed5e9c44acb35dcc1d752e449d2a6f7a6164b7b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2298%2Fcommits
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2298%2Fcommits
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 268 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 313 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Kludexhttps://github.com/Kludex
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
try-no-context-fieldhttps://github.com/modelcontextprotocol/python-sdk/tree/try-no-context-field
Conversationhttps://github.com/modelcontextprotocol/python-sdk/pull/2298
Commits16 (16)https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits
Checkshttps://github.com/modelcontextprotocol/python-sdk/pull/2298/checks
Files changedhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/files
Propagate contextvars.Context through anyio streams without modifying SessionMessagehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits#top
Kludexhttps://github.com/Kludex
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
try-no-context-fieldhttps://github.com/modelcontextprotocol/python-sdk/tree/try-no-context-field
Propagate contextvars.Context through anyio streams without modifying SessionMessagehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/6fef500116b353a8c00a26bbbe24bca378bb6a8c
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
6fef500https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/6fef500116b353a8c00a26bbbe24bca378bb6a8c
https://github.com/modelcontextprotocol/python-sdk/tree/6fef500116b353a8c00a26bbbe24bca378bb6a8c
Add pragma: no cover to Protocol stubs and unused clone() methodshttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/2513380f03bba03cb2e5d5fa5c82a68dcbf9965b
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
2513380https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/2513380f03bba03cb2e5d5fa5c82a68dcbf9965b
https://github.com/modelcontextprotocol/python-sdk/tree/2513380f03bba03cb2e5d5fa5c82a68dcbf9965b
Use pragma: no branch for Protocol stubs to satisfy strict-no-coverhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/1b34f2eb21c5382f83b712dce2952fcc15dff6c0
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
1b34f2ehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/1b34f2eb21c5382f83b712dce2952fcc15dff6c0
https://github.com/modelcontextprotocol/python-sdk/tree/1b34f2eb21c5382f83b712dce2952fcc15dff6c0
Address review feedback: ExceptionGroup bug, reverse dependency, type wideninghttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/32565b3ebe3b0aba566a7150f637b0b3f86af7ac
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
32565b3https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/32565b3ebe3b0aba566a7150f637b0b3f86af7ac
https://github.com/modelcontextprotocol/python-sdk/tree/32565b3ebe3b0aba566a7150f637b0b3f86af7ac
Restore correct context propagation for async handlershttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/b321dd206bb318e4ccec416fd26f07d773b76efb
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
b321dd2https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/b321dd206bb318e4ccec416fd26f07d773b76efb
https://github.com/modelcontextprotocol/python-sdk/tree/b321dd206bb318e4ccec416fd26f07d773b76efb
Remove unnecessary pragmas and fix generic type propagationhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/ef7e4b4fa1b3a0a199153c4d9273accf9f739624
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
ef7e4b4https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/ef7e4b4fa1b3a0a199153c4d9273accf9f739624
https://github.com/modelcontextprotocol/python-sdk/tree/ef7e4b4fa1b3a0a199153c4d9273accf9f739624
Move sender context lookup into _handle_session_messagehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/ab4f1c54fd68465a0e74f6a105bbcbba073ab703
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
ab4f1c5https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/ab4f1c54fd68465a0e74f6a105bbcbba073ab703
https://github.com/modelcontextprotocol/python-sdk/tree/ab4f1c54fd68465a0e74f6a105bbcbba073ab703
Merge remote-tracking branch 'origin/main' into try-no-context-fieldhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/dc8d842d1b0f0b65822eb8791b2d9b9cbda01c25
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
dc8d842https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/dc8d842d1b0f0b65822eb8791b2d9b9cbda01c25
https://github.com/modelcontextprotocol/python-sdk/tree/dc8d842d1b0f0b65822eb8791b2d9b9cbda01c25
Add pragma: no branch to Protocol stubshttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/1517b79bc9ae96d36ed6fbf7852741a8f639dd29
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
1517b79https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/1517b79bc9ae96d36ed6fbf7852741a8f639dd29
https://github.com/modelcontextprotocol/python-sdk/tree/1517b79bc9ae96d36ed6fbf7852741a8f639dd29
Use exclude_also instead of exclude_lines for coverage confighttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/379fe57261edddf26e37abe4fb27745d3c435cf6
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
379fe57https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/379fe57261edddf26e37abe4fb27745d3c435cf6
https://github.com/modelcontextprotocol/python-sdk/tree/379fe57261edddf26e37abe4fb27745d3c435cf6
Use exclude_also instead of exclude_lines for coverage confighttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/8dd89fd19a0d6056e2160f4e43356b6fe76ebc51
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
8dd89fdhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/8dd89fd19a0d6056e2160f4e43356b6fe76ebc51
https://github.com/modelcontextprotocol/python-sdk/tree/8dd89fd19a0d6056e2160f4e43356b6fe76ebc51
Merge branch 'try-no-context-field' of github.com:modelcontextprotocol/python-sdk into try-no-context-fieldhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/aec97fb81e591c23e84f734f10b2627cd9a3169f
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
aec97fbhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/aec97fb81e591c23e84f734f10b2627cd9a3169f
https://github.com/modelcontextprotocol/python-sdk/tree/aec97fb81e591c23e84f734f10b2627cd9a3169f
Remove pragma: no branch from Protocol stubshttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/df6df0ec0525023acc5b77d6325f97f87e23513f
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
df6df0ehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/df6df0ec0525023acc5b77d6325f97f87e23513f
https://github.com/modelcontextprotocol/python-sdk/tree/df6df0ec0525023acc5b77d6325f97f87e23513f
Add test for contextvars propagation from client to server handlerhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/da049fb42ffea534464a3c7861cb53b6661c6f1f
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
da049fbhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/da049fb42ffea534464a3c7861cb53b6661c6f1f
https://github.com/modelcontextprotocol/python-sdk/tree/da049fb42ffea534464a3c7861cb53b6661c6f1f
Rewrite context propagation test to actually verify the featurehttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/dee12910b9e0c061501d52a232d1d35925b947a9
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
dee1291https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/dee12910b9e0c061501d52a232d1d35925b947a9
https://github.com/modelcontextprotocol/python-sdk/tree/dee12910b9e0c061501d52a232d1d35925b947a9
Add assertion message to context propagation testhttps://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/69568544a00a10347bd22a51ff91abb436434a6c
https://github.com/Kludex
Kludexhttps://github.com/modelcontextprotocol/python-sdk/commits?author=Kludex
6956854https://github.com/modelcontextprotocol/python-sdk/pull/2298/commits/69568544a00a10347bd22a51ff91abb436434a6c
https://github.com/modelcontextprotocol/python-sdk/tree/69568544a00a10347bd22a51ff91abb436434a6c
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.