René's URL Explorer Experiment


Title: Propagate contextvars through anyio streams by aabmass · Pull Request #1996 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Propagate contextvars through anyio streams by aabmass · Pull Request #1996 · modelcontextprotocol/python-sdk

X Title: Propagate contextvars through anyio streams by aabmass · Pull Request #1996 · modelcontextprotocol/python-sdk

Description: Fixes #1969 Part of #421 This PR propagates contextvars.Context through internal anyio memory streams and restores it in long running async tasks, so that they run with the correct context. Works for in memory, streamable http, and sse transports. For MCP clients, this captures the caller's active context and restores it before using the transport. For MCP servers, it captures the active context from the transport and restores it before using the Server's handlers Motivation and Context The goal is to make contextvars "work" with the MCP SDK as users expect. The main motivation is OpenTelemetry #421, but there are other use cases e.g. per-request auth, stdlib decimal, starlette-context, etc. How Has This Been Tested? Added several integration tests which are failing at main. I also manually tested e2e with the some of the samples by using OpenTelemetry httpx instrumentation (I can share screenshots). Tests failures at main ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ inline-snapshot ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Fix snapshots ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tests/test_context_propagation.py ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ @@ -83,7 +83,7 @@ │ │ │ │ result = await client.call_tool(name="my_tool") │ │ │ │ assert isinstance(result, types.CallToolResult) │ │ - assert result.content == snapshot([types.TextContent(text="client_value")]) │ │ + assert result.content == snapshot([types.TextContent(text="initial")]) │ │ │ │ │ │ class ContextVarMiddleware(BaseHTTPMiddleware): # pragma: lax no cover │ │ @@ -127,7 +127,7 @@ │ │ │ │ ): │ │ transport.client_header_value = "expected_value" │ │ result = await client.call_tool("my_tool") │ │ - assert result.content == snapshot([types.TextContent(text="from middleware CLIENT_HEADER=expected_value")]) │ │ + assert result.content == snapshot([types.TextContent(text="from middleware CLIENT_HEADER=initial")]) │ │ │ │ │ │ @pytest.mark.anyio │ │ @@ -142,7 +142,7 @@ │ │ │ │ ): │ │ with set_test_contextvar("client_value_list"): │ │ await client.list_tools() │ │ - assert transport.captured_context_var == snapshot("client_value_list") │ │ + assert transport.captured_context_var == snapshot("initial") │ │ │ │ with set_test_contextvar("client_value_call_tool"): │ │ await client.call_tool("my_tool") │ │ @@ -167,7 +167,7 @@ │ │ │ │ ) as client: │ │ transport.client_header_value = "expected_value" │ │ result = await client.call_tool("my_tool") │ │ - assert result.content == snapshot([types.TextContent(text="from middleware CLIENT_HEADER=expected_value")]) │ │ + assert result.content == snapshot([types.TextContent(text="from middleware CLIENT_HEADER=initial")]) │ │ │ │ │ │ @pytest.mark.anyio │ │ @@ -187,7 +187,7 @@ │ │ │ │ ) as client: │ │ with set_test_contextvar("client_value_list"): │ │ await client.list_tools() │ │ - assert transport.captured_context_var == snapshot("client_value_list") │ │ + assert transport.captured_context_var == snapshot("initial") │ │ │ │ with set_test_contextvar("client_value_call_tool"): │ │ await client.call_tool("my_tool") │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ These changes are not applied. Use --inline-snapshot=fix to apply them, or use the interactive mode with --inline-snapshot=review Breaking Changes No Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context N/A

Open Graph Description: Fixes #1969 Part of #421 This PR propagates contextvars.Context through internal anyio memory streams and restores it in long running async tasks, so that they run with the correct context. Works f...

X Description: Fixes #1969 Part of #421 This PR propagates contextvars.Context through internal anyio memory streams and restores it in long running async tasks, so that they run with the correct context. Works f...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0e7c3ea9-ce03-8bcd-e5f8-9ac2c1b51332
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA41E:D1132:4252F8:600560:6A61E92B
html-safe-nonce25bc5fca862191a3e168003dc628bf04ebd72df44281ce3aab73cf4060258d2e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDFFOkQxMTMyOjQyNTJGODo2MDA1NjA6NkE2MUU5MkIiLCJ2aXNpdG9yX2lkIjoiODk5NjI4ODY4MTI2NzYzMzA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac787686d884ffa3f82cee02c6733e6e1572c786bb3980244937d3786772a817a6
hovercard-subject-tagpull_request:3247714680
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/1996/files
twitter:imagehttps://avatars.githubusercontent.com/u/1510004?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1510004?s=400&v=4
og:image:altFixes #1969 Part of #421 This PR propagates contextvars.Context through internal anyio memory streams and restores it in long running async tasks, so that they run with the correct context. Works f...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5dd1217fff37e297563b9d318ee02bf6378c8957c6195b77786bb8896fc9c95d
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release554667f6dda2a53c83687de64fabc457970f0f04
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1996%2Ffiles
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%2F1996%2Ffiles
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%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
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 314 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
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
aabmasshttps://github.com/aabmass
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
aabmass:propagate-contextvarshttps://github.com/aabmass/mcp-python-sdk/tree/propagate-contextvars
Conversation 5 https://github.com/modelcontextprotocol/python-sdk/pull/1996
Commits 2 https://github.com/modelcontextprotocol/python-sdk/pull/1996/commits
Checks 26 https://github.com/modelcontextprotocol/python-sdk/pull/1996/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Propagate contextvars through anyio streams https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#top
Show all changes 2 commits https://github.com/modelcontextprotocol/python-sdk/pull/1996/files
4445a3a Test cases aabmass Jan 9, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/1996/commits/4445a3af0c8a61b91d4680f1cf7d09dc7c08c115
ab27726 Propagate contextvars through anyio streams aabmass Jan 9, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/1996/commits/ab277262da6ba85e3e5be41f3b684c6a096ba185
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
sse.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-41ed2e8548ae223801c0a37a6b50ce913e24f0e660bbbc2ddd91686820c86336
streamable_http.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
server.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
message.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e87607af2a5ca4eeaf91e471c711340e954899e1504ebb1fcc981afe4639bc70
session.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
test_context_propagation.py https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-4b0e8445ac28fb3b8d2e2524bde34bd60d9e1b542c767f979e99940fb6f76ec0
uv.lock https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-84321598744d84dbee2318e634c74c9aae39a1c253f1c4bd17ebf9ef2f807b11
src/mcp/client/sse.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-41ed2e8548ae223801c0a37a6b50ce913e24f0e660bbbc2ddd91686820c86336
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/src/mcp/client/sse.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-41ed2e8548ae223801c0a37a6b50ce913e24f0e660bbbc2ddd91686820c86336
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-41ed2e8548ae223801c0a37a6b50ce913e24f0e660bbbc2ddd91686820c86336
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-41ed2e8548ae223801c0a37a6b50ce913e24f0e660bbbc2ddd91686820c86336
src/mcp/client/streamable_http.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/src/mcp/client/streamable_http.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e8c18a3067a9b157c5c39a947f53d395afeb00e7026dad2d5a279011da943b5e
src/mcp/server/lowlevel/server.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/src/mcp/server/lowlevel/server.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
src/mcp/shared/message.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e87607af2a5ca4eeaf91e471c711340e954899e1504ebb1fcc981afe4639bc70
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/src/mcp/shared/message.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e87607af2a5ca4eeaf91e471c711340e954899e1504ebb1fcc981afe4639bc70
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e87607af2a5ca4eeaf91e471c711340e954899e1504ebb1fcc981afe4639bc70
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-e87607af2a5ca4eeaf91e471c711340e954899e1504ebb1fcc981afe4639bc70
Kludexhttps://github.com/Kludex
Feb 16, 2026https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#r2813932367
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
aabmasshttps://github.com/aabmass
Feb 17, 2026https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#r2817647783
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
python-sdk/src/mcp/shared/session.pyhttps://github.com/modelcontextprotocol/python-sdk/blob/12d68ee1c9f7f603725bd925d4a9f58c6fd22710/src/mcp/shared/session.py#L182-L185
12d68eehttps://github.com/modelcontextprotocol/python-sdk/commit/12d68ee1c9f7f603725bd925d4a9f58c6fd22710
python-sdk/src/mcp/client/_transport.pyhttps://github.com/modelcontextprotocol/python-sdk/blob/12d68ee1c9f7f603725bd925d4a9f58c6fd22710/src/mcp/client/_transport.py#L12
12d68eehttps://github.com/modelcontextprotocol/python-sdk/commit/12d68ee1c9f7f603725bd925d4a9f58c6fd22710
Distributed traces with Pydantic-AI and Streamable HTTP MCP servers not correlated properly pydantic/logfire#1459 (comment)https://github.com/pydantic/logfire/issues/1459#issuecomment-3371866831
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
aabmasshttps://github.com/aabmass
Feb 17, 2026https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#r2819646985
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
aabmasshttps://github.com/aabmass
Feb 26, 2026https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#r2859660083
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
PEP568https://peps.python.org/pep-0568/#:~:text=%23%20GeneratorType.__next__%0Adef%20__next__(self)%3A%0A%20%20%20%20if%20self.context%20is%20not%20None%3A%0A%20%20%20%20%20%20%20%20return%20self.context.push(self.__real_next__)%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20return%20self.__real_next__()
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
src/mcp/shared/session.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/src/mcp/shared/session.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
https://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
tests/test_context_propagation.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files#diff-4b0e8445ac28fb3b8d2e2524bde34bd60d9e1b542c767f979e99940fb6f76ec0
View file https://github.com/aabmass/mcp-python-sdk/blob/ab277262da6ba85e3e5be41f3b684c6a096ba185/tests/test_context_propagation.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1996/{{ revealButtonHref }}
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1996/files
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.