René's URL Explorer Experiment


Title: In-process callback failures break tool calls and notification sends · Issue #3434 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: In-process callback failures break tool calls and notification sends · Issue #3434 · modelcontextprotocol/python-sdk

X Title: In-process callback failures break tool calls and notification sends · Issue #3434 · modelcontextprotocol/python-sdk

Description: Initial Checks I confirm that I am using the newest release of the 2.x line. I confirm that I searched the issue tracker before opening this issue. Release line 2.x (current stable) Description Client(server) uses DirectDispatcher. If a ...

Open Graph Description: Initial Checks I confirm that I am using the newest release of the 2.x line. I confirm that I searched the issue tracker before opening this issue. Release line 2.x (current stable) Description Cli...

X Description: Initial Checks I confirm that I am using the newest release of the 2.x line. I confirm that I searched the issue tracker before opening this issue. Release line 2.x (current stable) Description Cli...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3434

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"In-process callback failures break tool calls and notification sends","articleBody":"## Initial Checks\n\n- [x] I confirm that I am using the newest release of the 2.x line.\n- [x] I confirm that I searched the issue tracker before opening this issue.\n\n## Release line\n\n2.x (current stable)\n\n## Description\n\n`Client(server)` uses `DirectDispatcher`. If a progress callback raises, that exception crosses back into server tool execution, so a tool that otherwise returns successfully fails with `UnexpectedToolError`. `DirectDispatcher` also lets an inbound notification handler exception escape back to the sender's `notify()` call.\n\nThe stream-backed `JSONRPCDispatcher` logs and contains both callback failures. I expected the in-process path to keep the same boundary: log the callback failure, but let the protocol operation continue.\n\nI have a small patch and regression tests for both paths and would like to fix this if maintainers want an outside pull request.\n\nI used GitHub Copilot CLI to inspect the dispatcher paths, write the patch, and draft this report. I verified the reproduction and tests.\n\n## Example Code\n\n```python\nimport anyio\n\nfrom mcp import Client\nfrom mcp.server.mcpserver import Context, MCPServer\n\nserver = MCPServer(\"callback-repro\")\n\n\n@server.tool()\nasync def work(context: Context) -> str:\n    await context.report_progress(1, 1)\n    return \"done\"\n\n\nasync def broken_progress(progress: float, total: float | None, message: str | None) -> None:\n    raise RuntimeError(\"consumer failed\")\n\n\nasync def main() -> None:\n    async with Client(server, mode=\"2026-07-28\") as client:\n        result = await client.call_tool(\"work\", progress_callback=broken_progress)\n        print(result.content[0].text)\n\n\nanyio.run(main)\n```\n\nCurrent `main` ends with:\n\n```text\nUnexpectedToolError: Error executing tool work\n```\n\nThe tool should print `done`. The callback failure should still be logged.\n\n## Verification\n\nWith only the regression tests applied to clean `main`:\n\n```console\nuv run --frozen pytest tests/shared/test_dispatcher.py \\\n  -k 'progress_callback_exception_does_not_fail_request or notification_handler_exception_does_not_reach_sender' -q\n# 2 failed, 2 passed. Both DirectDispatcher cases failed.\n```\n\nWith the two callback guards applied:\n\n```console\nuv run --frozen pytest tests/shared/test_dispatcher.py \\\n  -k 'progress_callback_exception_does_not_fail_request or notification_handler_exception_does_not_reach_sender' -q\n# 4 passed\n```\n\n## Python & MCP Python SDK\n\n```text\nPython 3.12.13\nmcp 2.1.1\nmcp 2.1.2.dev4+d060b36e at d060b36e1d095ef6e93e07ba5d59bb69b2ad449a\nmacOS\n```\n","author":{"url":"https://github.com/1fanwang","@type":"Person","name":"1fanwang"},"datePublished":"2026-09-03T07:11:40Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3434"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8c4dc89a-c7ca-c4f9-6a4a-db21ac1094c7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8890:24014:FF7C12:15CB6CA:6B055D12
html-safe-nonce8e15cc921f5596341350196c54dddaf330863284de62c488d527d671c488ab1f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODkwOjI0MDE0OkZGN0MxMjoxNUNCNkNBOjZCMDU1RDEyIiwidmlzaXRvcl9pZCI6IjQ3Nzc3Nzk4NjU5MTc0MTQ2NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3dacb90e3682d11fb20e5c5867f63175bf22e73d90223e542a4c8d25fda1cff9
hovercard-subject-tagissue:5333502826
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3434/issue_layout
twitter:imagehttps://opengraph.githubassets.com/93f06bb58fd0c1d2d1f5950d4c3f4a3b816dc4a1a52b757fd3b255547f432ea2/modelcontextprotocol/python-sdk/issues/3434
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/93f06bb58fd0c1d2d1f5950d4c3f4a3b816dc4a1a52b757fd3b255547f432ea2/modelcontextprotocol/python-sdk/issues/3434
og:image:altInitial Checks I confirm that I am using the newest release of the 2.x line. I confirm that I searched the issue tracker before opening this issue. Release line 2.x (current stable) Description Cli...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:username1fanwang
hostnamegithub.com
expected-hostnamegithub.com
None8a6760da3cce5e2d079d07e3b62df71194316c4478db1a5e38050f44fce72c72
turbo-cache-controlno-preview
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
release8327739ac0648b9c3c722b5f401f7338553936b8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3434#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3434
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3434
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3434
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3434
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3434
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues320 (320)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3434
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3434
#3623https://github.com/modelcontextprotocol/python-sdk/pull/3623
luojiyin1987/python-sdk#1https://github.com/luojiyin1987/python-sdk/pull/1
In-process callback failures break tool calls and notification sendshttps://github.com/modelcontextprotocol/python-sdk/issues/3434#top
#3623https://github.com/modelcontextprotocol/python-sdk/pull/3623
luojiyin1987/python-sdk#1https://github.com/luojiyin1987/python-sdk/pull/1
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
https://github.com/1fanwang
1fanwanghttps://github.com/1fanwang
on Sep 3, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3434#issue-5333502826
claudehttps://github.com/apps/claude
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
on Sep 3, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3434#event-30471476225
https://github.com/UniversePeak
UniversePeakhttps://github.com/UniversePeak
on Sep 3, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3434#issuecomment-5523169193
#3434https://github.com/modelcontextprotocol/python-sdk/issues/3434
maxisbeyhttps://github.com/maxisbey
completedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3623https://github.com/modelcontextprotocol/python-sdk/pull/3623
on Oct 2, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3434#event-32334343393
https://github.com/maxisbey
maxisbeyhttps://github.com/maxisbey
on Oct 2, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3434#issuecomment-5957020112
#3623https://github.com/modelcontextprotocol/python-sdk/pull/3623
#3436https://github.com/modelcontextprotocol/python-sdk/pull/3436
AI Disclaimerhttps://gist.github.com/maxisbey/6123d132484e4c533eab519a2800693d
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3434
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3434
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.