René's URL Explorer Experiment


Title: Fix CI failures for proxy tests by jlowin · Pull Request #1763 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Fix CI failures for proxy tests by jlowin · Pull Request #1763 · modelcontextprotocol/python-sdk

X Title: Fix CI failures for proxy tests by jlowin · Pull Request #1763 · modelcontextprotocol/python-sdk

Description: The proxy tests introduced in #1711 were failing CI due to two issues: pyright type errors and incomplete coverage. The type errors stemmed from untyped fixture parameters and assertions on union types. The coverage gaps were in both the source (proxy.py lines 67-69, the write-stream-closed-during-forward path) and the test file itself. The test file coverage failures appear to be due to a race condition with pytest-xdist parallel execution. Each xdist worker process collects coverage independently, then results are combined. However, when a worker finishes its assigned tests and exits, its process terminates before finally cleanup blocks from other workers' tests are recorded in that worker's coverage data. Since test-to-worker assignment is non-deterministic, different CI runs produce different coverage for these cleanup blocks—Python 3.10 happened to cover them all, Python 3.11 didn't. Marking them # pragma: no cover resolves this. This PR includes all commits from #1711 plus the necessary changes to get CI over the line. The major contribution of #1711 is the mcp_proxy() convenience function that enables bidirectional message forwarding between two MCP transports, porting the TypeScript proxy pattern to the Python SDK -- by @dgenio

Open Graph Description: The proxy tests introduced in #1711 were failing CI due to two issues: pyright type errors and incomplete coverage. The type errors stemmed from untyped fixture parameters and assertions on union t...

X Description: The proxy tests introduced in #1711 were failing CI due to two issues: pyright type errors and incomplete coverage. The type errors stemmed from untyped fixture parameters and assertions on union t...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:97d75f43-fe72-a9f0-4ba7-a47a560b65ff
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD398:196FB5:6E6526:97113D:6A61B3AB
html-safe-nonce6ff72aa2346f78d18b0984d453e48e1dd82d0588a4c8d47cf0d85131cacf45a8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzk4OjE5NkZCNTo2RTY1MjY6OTcxMTNEOjZBNjFCM0FCIiwidmlzaXRvcl9pZCI6IjYzMzAzMDI0ODYzMjg0ODg4NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5cdbc4469ccf5e6958d0d6ed563a864d5eba08dca6f47b56ec1e12554adc60e7
hovercard-subject-tagpull_request:3089432477
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/1763/files
twitter:imagehttps://avatars.githubusercontent.com/u/153965?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/153965?s=400&v=4
og:image:altThe proxy tests introduced in #1711 were failing CI due to two issues: pyright type errors and incomplete coverage. The type errors stemmed from untyped fixture parameters and assertions on union t...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9
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
releaseac296ae7f21856f1f92adbad22f870b6fbb4b907
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1763%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%2F1763%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/1763/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/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 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
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
jlowinhttps://github.com/jlowin
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
jlowin:fix/mcp-proxy-ci-fixhttps://github.com/jlowin/mcp-python-sdk/tree/fix/mcp-proxy-ci-fix
Conversation 32 https://github.com/modelcontextprotocol/python-sdk/pull/1763
Commits 10 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits
Checks 18 https://github.com/modelcontextprotocol/python-sdk/pull/1763/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Fix CI failures for proxy tests https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#top
Show all changes 10 commits https://github.com/modelcontextprotocol/python-sdk/pull/1763/files
0357258 feat: add MCP proxy pattern convenience function dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/03572580012098aebda4dee8c2ebc260856619cd
e1cff6c fix: refactor proxy to reduce complexity and improve coverage dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/e1cff6cb0936195ddfca08af30fb67e765e71ae1
f740e75 test: add coverage for missing exception paths dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/f740e75f2446e22dd354bd1fb53648b63c47a4b9
719c724 fix: address CI failures - pyright and test issues dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/719c724cb27a2406f07d55ea539191f79e9d43dd
75d8114 fix: address CI failures - pyright and test issues dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/75d8114da4a24cd0a73fcbcea3d62faba8f9c1f2
e5bdd4c Merge branch 'feature/12-mcp-proxy-pattern' of https://github.com/dge… dgenio Dec 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/e5bdd4c93066b7138363f9d38fb5ce0dbc843d1d
a2deae1 Update test_proxy.py jlowin Dec 10, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/a2deae112cfef9be261d2f0e85c8b16c5db97cb5
5de4410 Update coverage jlowin Dec 10, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/5de4410ece903a732da53810bb0dabfba3239f41
6c4f1bc no cover jlowin Dec 10, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/6c4f1bcbf344866aa20225d821f9ee8cae1817d3
2e2b8e5 chore: re-run CI jlowin Dec 10, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1763/commits/2e2b8e55b755f5501ad976f0c27f4e1afe67be7c
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
proxy.py https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#diff-b3ed783886b253bf75d8caae71cb07c2207b3a5c683d81063783282ff6d0e93a
test_proxy.py https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#diff-72eb2664a14b2363df377b146423b67e812e19954c13aa274465de8b1c647c04
src/mcp/shared/proxy.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files#diff-b3ed783886b253bf75d8caae71cb07c2207b3a5c683d81063783282ff6d0e93a
View file https://github.com/jlowin/mcp-python-sdk/blob/2e2b8e55b755f5501ad976f0c27f4e1afe67be7c/src/mcp/shared/proxy.py
Open in desktop https://desktop.github.com
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607222566
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1763/{{ revealButtonHref }}
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607220727
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607204160
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607247493
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607248422
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607206965
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
maxisbeyhttps://github.com/maxisbey
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#1553https://github.com/modelcontextprotocol/python-sdk/pull/1553
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
maxisbeyhttps://github.com/maxisbey
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607152220
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607266138
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
maxisbeyhttps://github.com/maxisbey
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607152661
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607267782
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607214181
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607233854
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Kludexhttps://github.com/Kludex
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607245235
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
maxisbeyhttps://github.com/maxisbey
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607153272
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
maxisbeyhttps://github.com/maxisbey
Dec 10, 2025https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607153517
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408https://github.com/modelcontextprotocol/python-sdk/pull/1763/files#r2607144408
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1763/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.