René's URL Explorer Experiment


Title: Asynchronous Tool Execution by LucaButBoring · Pull Request #1398 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Asynchronous Tool Execution by LucaButBoring · Pull Request #1398 · modelcontextprotocol/python-sdk

X Title: Asynchronous Tool Execution by LucaButBoring · Pull Request #1398 · modelcontextprotocol/python-sdk

Description: This PR implements the required changes for modelcontextprotocol/modelcontextprotocol#1391, which adds asynchronous tool execution. This is a large PR, and I expect that if the associated SEP is accepted, we might want to break this down into several smaller PRs for SDK reviewers. I tried to generally have separate commits for each step of the implementation, to try and make this easier to review in its current form. Motivation and Context Today, most applications integrate with tools in a straightforward but naive manner, choosing to have agents invoke tools synchronously with the conversation instead of allowing agents to multitask where possible. There are a few reasons why we believe this is the case, including the lack of clarity around tool interfaces (single tool or multiple for job tracking), model failures when manually polling on operations, and not having a way to retrieve results with a well-defined TTL, among other problems (described in more detail in the linked issue). Here, we introduce an alternative API that establishes a clear integration path for async job-style use cases that are typically on the order of minutes to hours. The ultra high-level overview is as follows: Tools now support synchronous or asynchronous invocation modes A single tool only advertises itself as either sync or async to a given client, controlled by protocol version Sync tools behave just like they always did Async tools are split into start/poll/retrieve stages: Starting a call: tools/call begins an async tool call The result is a CallToolResult containing an operation token, which is used to interact with the async tool call across multiple RPC calls Polling: The operation token is used to call tools/async/status, which returns the current operation status The client should poll this method until the status reaches a terminal value Result retrieval: The operation token is used to call tools/async/result, which has the final tool output Whether a tool is sync, async, or both (on old/new protocol versions) is defined by tool implementors. This enables remote server operators to control this based on how long each tool is expected to take to execute, rather than potentially serving HTTP requests with widely varying execution times on the same endpoint. This also makes it much more clear to client applications what the "time contract" of a tool is, so that fast tools can still be executed synchronously while allowing long-running tools to be immediately backgrounded. Usage Defining an async-compatible tool is just a matter of adjusting the @mcp.tool() decorator to include an invocation_modes parameter, which is a list of "sync" and "async": @mcp.tool(invocation_modes=["async", "sync"]) async def data_processing_tool(dataset: str, operations: list[str], ctx: Context) -> dict[str, str]: await ctx.info(f"Starting data processing pipeline for {dataset}") results: dict[str, str] = {} total_ops = len(operations) for i, operation in enumerate(operations): await ctx.debug(f"Executing operation: {operation}") await asyncio.sleep(0.5 + (i * 0.2)) # Simulate processing time progress = (i + 1) / total_ops # Report progress await ctx.report_progress(progress, 1.0, f"Completed {operation}") results[operation] = f"Result of {operation} on {dataset}" # Store result await ctx.info("Data processing pipeline complete!") return results If invocation_modes contains "async", the tool is async-compatible and will only be called in async mode by clients on new versions, while if it contains "sync", the tool is sync-compatible and will be called in sync mode if async mode is not supported (a client will never have the option to choose one or the other itself). Behind the scenes, the SDK handles branching the behavior to either run synchronously (like today) or asynchronously (immediate return with job tracking) depending on if the client version supports async tools yet or not. To control how long the results are kept for to retrieve with tools/async/result, we can use the keep_alive parameter: @mcp.tool(invocation_modes=["async", "sync"], keep_alive=30) # retain result for 30s following completion We can also customize the content returned in the immediate CallToolResult with the immediate_result parameter: async def immediate_feedback(operation: str) -> list[types.ContentBlock]: return [types.TextContent(type="text", text=f"Starting {operation}... This may take a moment.")] @mcp.tool(invocation_modes=["async", "sync"], immediate_result=immediate_feedback) On the client side, we just add the polling and result retrieval like so: async def demonstrate_data_processing(session: ClientSession): """Demonstrate data processing pipeline.""" print("\n=== Data Processing Pipeline Demo ===") # Just like before operations = ["validate", "clean", "transform", "analyze", "export"] result = await session.call_tool( "data_processing_tool", arguments={"dataset": "customer_data.csv", "operations": operations} ) # We could choose to sent the immediate result content to an agent from here before continuing # New parts if result.operation: token = result.operation.token print(f"Data processing started with token: {token}") # Poll for completion while True: status = await session.get_operation_status(token) print(f"Status: {status.status}") if status.status == "completed": final_result = await session.get_operation_result(token) # Show structured result if available if final_result.result.structuredContent: print("Processing results:") for op, result_text in final_result.result.structuredContent.items(): print(f" {op}: {result_text}") break elif status.status == "failed": print(f"Processing failed: {status.error}") break elif status.status in ("canceled", "unknown"): print(f"Processing ended with status: {status.status}") break await asyncio.sleep(0.8) How Has This Been Tested? Unit tests, integration tests, and new example snippets. Breaking Changes Existing users will not need to update their applications to continue using synchronous tool calls. Asynchronous tool calls will require minor code changes that will be documented. 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 There were a bunch of decisions in the implementation we may want to discuss further, some of which were due to ambiguity in the proposal (which will be revised again) and some of which were due to working things into the SDK implementation. I added a faux-version called next to deal with the requirement that sessions on the current-latest version always advertise as sync-only. The tests and examples explicitly set the advertised client protocol version to next when calling async-only tools. Reusing the existing tool/call method creates some ambiguities in how outputSchema should be handled, as the immediate tool call result (communicating an accepted state) would no longer have meaningful structuredContent. The output that should be validated is actually the result of GetOperationPayloadResult, so for now I'm skipping validation of the immediate CallToolResult (only in async execution) and only validating GetOperationPayloadResult (sync tool executions are always validated, just like before). keepAlive should have a sentinel value representing "no expiration," and I'm leaning towards None. However, in SDK implementations, that becomes somewhat ambiguous with sync tool calls, which also implicitly have a keepAlive of None already. For now, I default it to 1 hour if not specified/None, but this should probably be changed before this is merged. In sHTTP, the SDK has behavior to send tool-related server messages on the same SSE stream that the server used as a response to the client's CallToolRequest, by attaching a related_request_id to the stream for fast lookups and session resumption. To support sampling and elicitation, we keep a map of operation tokens to their original request IDs to reuse the same event store entry between related calls. The client session needs to cache a mapping of in-flight operation tokens to tool names for validating structuredContent in async tool calls, as it otherwise has no way to look up the cached outputSchema. We could consider including a toolName in GetOperationPayloadResult to avoid the inconvenience, but in this draft I'm using a cache expiry based on keepAlive to avoid holding that mapping forever.

Open Graph Description: This PR implements the required changes for modelcontextprotocol/modelcontextprotocol#1391, which adds asynchronous tool execution. This is a large PR, and I expect that if the associated SEP is ac...

X Description: This PR implements the required changes for modelcontextprotocol/modelcontextprotocol#1391, which adds asynchronous tool execution. This is a large PR, and I expect that if the associated SEP is ac...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a0e31ff2-0e22-f192-807b-a54834226ddf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB498:29A644:FBFE2A:144F700:6A5C3278
html-safe-nonce6c46994e396e9aad958b2ab500a9c27844f460cc7378317064f56d1cb8bced1e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDk4OjI5QTY0NDpGQkZFMkE6MTQ0RjcwMDo2QTVDMzI3OCIsInZpc2l0b3JfaWQiOiI4OTY3Mjk1NDc5ODgyNDYxODE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac11a0720a29aafacfdcbb7448786474777711f59689368fdb232e27ee20393c10
hovercard-subject-tagpull_request:2858897259
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/1398/files
twitter:imagehttps://avatars.githubusercontent.com/u/131398524?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/131398524?s=400&v=4
og:image:altThis PR implements the required changes for modelcontextprotocol/modelcontextprotocol#1391, which adds asynchronous tool execution. This is a large PR, and I expect that if the associated SEP is ac...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
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
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1398%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
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%2F1398%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/1398/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/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 259 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 307 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
LucaButBoringhttps://github.com/LucaButBoring
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
LucaButBoring:feat/async-toolshttps://github.com/LucaButBoring/mcp-python-sdk/tree/feat/async-tools
Conversation 28 https://github.com/modelcontextprotocol/python-sdk/pull/1398
Commits 45 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits
Checks 18 https://github.com/modelcontextprotocol/python-sdk/pull/1398/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Asynchronous Tool Execution https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#top
Show all changes 45 commits https://github.com/modelcontextprotocol/python-sdk/pull/1398/files
395194a Implement new data models for async tools (SEP-1391) LucaButBoring Sep 19, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/395194a960c02d513d16e15bbf031be9302d7f36
cbda6e3 Add "next" protocol version to isolate async tools from existing clients LucaButBoring Sep 19, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/cbda6e336e935c7e29a8cae906a9c691291af31c
e5e4078 Implement session functions for async tools LucaButBoring Sep 19, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/e5e4078bedc1e7b9c5efb443ba45d7232f30de72
7dd550b Implement server-side handling for async tool calls LucaButBoring Sep 22, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/7dd550b40867d58571e910235aa4838890908dbd
8d281be Rename types for latest SEP-1391 revision LucaButBoring Sep 23, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/8d281be6bb55200db9f7bb06e71f0603087dee8c
0dc8d43 Handle cancellation notifications on async ops LucaButBoring Sep 23, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/0dc8d430d614b8c7d55fb63bcfbd68f0f5eb3db7
e70f441 Implement support for input_required status LucaButBoring Sep 23, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/e70f44190c78e83e6f6c3da5380fa0788cd616b2
2079230 Support configuring the broadcasted client version LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/207923048448467d6117ba9be0d3a75730041f59
04bac41 Pass AsyncOperations from FastMCP to Server LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/04bac419f22c2dfb3296d1f7dace776441fe1dd2
2df5e7c Implement lowlevel async CallTool LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/2df5e7cba50450a1315b78421e4ad42181a5ec36
759a9a3 Implement async tools snippets LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/759a9a39928808440bc78176b0c2bdc28c7769dc
011a363 Implement optoken to tool name map on client end for validation LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/011a363ea3db59baadf1d69e9859d4c0c047144f
e40055a Support configuring async tool keepalives LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/e40055a40f9b65376b7eaaa129feafe2192ff33a
600982e Control async op expiry by resolved_at, not created_at LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/600982effc364f42233256d5bd88087f1c78ee2b
37fb963 Add snippet for async tool with keepalive LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/37fb963cf689e4bd3fe7baaa5aa0339c5e2f609c
f8ca895 Support progress in async tools LucaButBoring Sep 24, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/f8ca895454038fe58e7bcd4a230df5d9baafe586
b802dc4 Operation token plumbing to support async elicitation/sampling LucaButBoring Sep 26, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/b802dc423bc74458830bfdcb3626ac55ca77bcaf
047664f Add decorator parameter for immediate return value in LRO LucaButBoring Sep 26, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/047664f63f417eff93ec9ac91881f4c97537a51a
07a2821 Support configuring immediate LRO result LucaButBoring Sep 26, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/07a2821d0689bb505f65501b7a0a3fde3e2684a6
2943631 Fix code complexity issue in sHTTP LucaButBoring Sep 27, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/2943631ece87d0c8c8093e2f323dae35cbf71890
e6a12e1 Merge branch 'main' of https://github.com/modelcontextprotocol/python… LucaButBoring Sep 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/e6a12e13c5beb364aa49a1d7a3a8ad22901abca4
4539c59 Add basic documentation for async tools LucaButBoring Sep 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/4539c597884acd093fe2ca12ab8ec372824971e2
97be6dd Remove misplaced server test LucaButBoring Sep 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/97be6dd26d26a2d2cb4f5ad087548eadd7baa78b
b0d3f30 Split up async tool snippets to improve README readability LucaButBoring Sep 29, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/b0d3f305d1dce1a88cbe73d18909d327f22ae010
b33721e Move operations into "working" state before tool execution LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/b33721e9a14a3e9fceb1afcbad60e98988a04a3c
5e7bc5e Add reconnect example for async tools LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/5e7bc5e52d50f642aef98023e466bc7342be3c45
0a5373e Merge branch 'main' into feat/async-tools LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/0a5373e5f6dbf52923c4e610723144b1b7a90a17
4a6c5a5 Fix README formatting LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/4a6c5a5374d029c7b836bab740f6b7e5541efd6b
9375927 Remove usages of asyncio in tests LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/9375927935f3a493553a1ea4500f578c91fdc15e
26055d9 Update README snippets LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/26055d959cb672003dd2912b02610c4bbd12dea3
a8e0831 Use anyio instead of asyncio in lowlevel server LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/a8e0831d5ca231aea236ad89ff94e7ff5af8009d
2ed562e Apply Copilot suggestions LucaButBoring Oct 1, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/2ed562eb667a5ba2d4425f6c247ea4361d8b95b8
76f135e Use server TaskGroup to fix operations blocking CallTool requests LucaButBoring Oct 3, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/76f135e5d13f28cd45a19cbbcd2ac7b676c27cb0
6be55ef Merge branch 'main' into feat/async-tools LucaButBoring Oct 3, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/6be55ef5487b1d097a0e4cb2c8f38d1b0d9dfa57
7255e4f Remove vestigial session operation cancellation LucaButBoring Oct 3, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/7255e4fdde43f4ec059ddd7ec316bb564624b9bc
c2f8bb1 Merge branch 'main' of https://github.com/modelcontextprotocol/python… LucaButBoring Oct 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/c2f8bb17f277f7a6b1702d589dae57cb0f8bbbd0
17bef50 Fully switch AsyncOperationManager to anyio LucaButBoring Oct 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/17bef50f7519fec8d89d8d04b7b36d9b8579e5e2
17fc21e import Self from typing_extensions for Python 3.10 LucaButBoring Oct 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/17fc21e7ff7af17029575634aa63163dc5ae4239
428e7a4 Fix sync/async detection and add failing test for reconnects LucaButBoring Oct 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/428e7a4538529580b51a87e3463492be6b3ee684
5f422e7 Fix async test assertion LucaButBoring Oct 6, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/5f422e71919c1db81eef545bed54284db31f9f34
40cf77e Convert ServerAsyncOperationManager into async context manager LucaButBoring Oct 7, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/40cf77ee4c683a2d8d3995976699485c4bf2634f
272b238 Tidy up debug/test cruft LucaButBoring Oct 7, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/272b2380ebc4e536e56d811c588f3fdc5831f17f
3701594 Split ServerAsyncOperationManager into AsyncOperationStore and AsyncO… LucaButBoring Oct 7, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/3701594ac4e959af414ad288e2b98683ffa0cac9
0d48861 Add dedicated event queues to fix IO and be transport-agnostic LucaButBoring Oct 9, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/0d48861924d0f2313a849745214d8b2f99422ddb
84c6e4b Clean up LRO code and update docs LucaButBoring Oct 11, 2025 https://github.com/modelcontextprotocol/python-sdk/pull/1398/commits/84c6e4b0b7904a8f98d9de4edad0e9e1e500d3d4
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
README.md https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
README.md https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-c4bd6af5f07319e06d0db506c81cfa807aae0464adcec115e3b7c1cc0bb9242b
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2e3c03feb1b0e639ffa9ba6f95a48fe0d4c77ecacdb40c017b21d45592b3d5b4
client.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-8081ad62be19693553617c987cb4314bbe3bc3c6469390ac5b88ac770cdaad9b
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-24f4e4c3d4d9be27cc1f3bf7600731a871e473b60b157d99a9c51dc1c04f22a4
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-aca301ff67e807e002fd467f276aad7eb3bd086eb09845bc2d248be4b7247768
uv.lock https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-8fe10b0307fb77bb24d15ebcfe2e9d7f3a3576c8379ffb89bc06ba3039cfdf37
uv.lock https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-196bbed354a23e723eeb9f354e06fb72415e6d2561249b65023ba45a33e8220e
.python-version https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-405dd9ada8daddcbda78ff6c4414779038360355975bcef6c65e20b5b56073b7
README.md https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2dd11b20785f32009438f3d27562469fd4e33ad1b316f1c241450a596a716c1c
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-3f939e96eebcfe3bd1511b189388c95464a8788229839dc49344db9c5c495607
__main__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-ba79848efe0bf1d7dac79297b6643122d4babfa4fcd6239a49e06cde61a5a1fe
server.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-3daf8633ffc79a537b0b1271b558d63d504b34e6fa8f73cdea0e0e416aae3ab3
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-f1c28ee338442713ca5de520dbb64eee8058b6d10ba18969fffb0713a3e596e9
.gitignore https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-1187434f62daf13e505ac34882756b60af28d5de7a4ec940516e20336c132991
README.md https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-1473e3fbc4630fa292c8759aa0bda83ac51cf0be01cf646248fa2b7785bd2af4
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-60836fb0ea064ff9d2179faba9f534f6275bca5974a969398093fc45ebfa1ef4
__main__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-5810136ced3d4bde3bfb7f00137507ccf713afb81f021fba112586529adf6e20
server.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-a8897f534dbfef0ee08eee3bce0b0a657f83bbe63153353fd0719dc900d0281f
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-3663466f8755e7db720a02827cbf00219b1350c385f50b66f1777007d0e533af
async_elicitation_client.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-f0ac8d5700c5f243e1199c8032e62dcf12aca118221a649941a1e4c26ae28177
async_progress_client.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-f026e30660299be7a9ea63ba5660edd27056de51c10640677ac0807e6860100a
async_sampling_client.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-510ff606e434de29b750ea71ecd137c198286ef054b3fba370fc03a197b05bec
async_tool_client.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2a7849e20f9eb34667df6d2a5873dcd51dff75f8b1eb6090af1be0949074008a
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2f2c2ebc66808ef1c1dadc6dce98d6f76a1298d9faf81b03d613f14d2137c802
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-7ba69ab49e24048be9cec660f89c5bfa9f2bd520203062b2f5ee7909647a34d0
async_tool_basic.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-639ff38aa720e2eac0839a0253584ac1fa8c2d1b0197e3ced887a870aa84260d
async_tool_elicitation.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-5ac55c4defd89aa8551f5e9c50ca5d106453a383358301d3297e1408d995329b
async_tool_immediate.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-7937e7ee2698f06ff34061b5ab305e94f876af92daa220ca2be96b3b8b4792b6
async_tool_progress.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-cee866c816760dd6691080a45e302e9f2a3cc5db34adb78558285d059a8b60e8
async_tool_sampling.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b4831de601c71e77828ac1f3815f8b50164d8379aa55f360021e8e52a1958c6e
pyproject.toml https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
session.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
elicitation.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-c4db625b035748b41b473c918e7d296aa97e84921be651e4a165beaf95b83b29
server.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-14a2991a8f2be5b9e60dab5fae92d2230dc23e57937ad5e5641b832d9c662738
base.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-69c6a7ada93ce277ad1ae8f79a6800160e437084559ca0a24255851cb061a3a1
tool_manager.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-d9f49c4155cf42f7f146266f7f51294f25359fd25241f6495ded5fa4c8718424
server.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4
session.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-9a603a2587011a188aa76ca19a32fcd343a253516325fbcfb4f7bfb6a814634c
streamable_http.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3
async_operations.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-d63dfbf45b22e38287d054d580de0475e0bc7994ee98101645feb94f3edcb18d
async_operations_utils.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-21159359a5be84f1ac4deea09944c7f32ad66dd333d2204f9ab67e1dad9f0a6f
context.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-39333468a87a8b7df9e7916239f97203647716e5465b846328ec277e179c7ceb
memory.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-fda62e83f7fbe11b6291a8eb980526a6465853fcc15dba2269425cd3de0801dc
session.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc
version.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-cbd997f5b52f8757771f4257216d82d29862715947778ae776ec13385baf9184
types.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-9b043ee327a542607e73b38ebb19c77049650efbe3a1f9d5891b0f8af09599ae
test_176_progress_token.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-efaa25bf0efec6c430b4f55170db0919caf81ed30266b026bad9993dc484aecd
test_immediate_result.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-16790811e1b0b347bc0e5765bd5ebddb9e299656cad49f45dbe279166ed66e0d
test_integration.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2a83726d3841510342d53ec2e4372b1b9ddb456bead430b070f2df6652f48e25
test_server.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2c82340ecf6b6a4c0adbc7f94f272d810dca759a8bba8c3066b4110afc2fd586
test_tool_manager.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b5b4bbafe34c06e716812137f400c45d7e1a454cce6f39f69a71b3e9cb4c1975
test_lowlevel_async_operations.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-4ae522a09bf4632a5171f0adcd5884aac38562d71ea3cafb86654111da5dcda0
test_async_operations.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-923e824196b11e03be8df1217d5eca483ba3978f1a8fd884dce0131575b66b60
test_progress_notifications.py https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-9df01c21bb5b7f1353ec56a7fa0efd594a04b3e109f49ca0a598fb9a6919a7eb
uv.lock https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-84321598744d84dbee2318e634c74c9aae39a1c253f1c4bd17ebf9ef2f807b11
README.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/LucaButBoring/mcp-python-sdk/blob/84c6e4b0b7904a8f98d9de4edad0e9e1e500d3d4/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1398/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
examples/clients/async-reconnect-client/README.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-c4bd6af5f07319e06d0db506c81cfa807aae0464adcec115e3b7c1cc0bb9242b
View file https://github.com/LucaButBoring/mcp-python-sdk/blob/84c6e4b0b7904a8f98d9de4edad0e9e1e500d3d4/examples/clients/async-reconnect-client/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1398/{{ revealButtonHref }}
examples/clients/async-reconnect-client/mcp_async_reconnect_client/__init__.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-2e3c03feb1b0e639ffa9ba6f95a48fe0d4c77ecacdb40c017b21d45592b3d5b4
View file https://github.com/LucaButBoring/mcp-python-sdk/blob/84c6e4b0b7904a8f98d9de4edad0e9e1e500d3d4/examples/clients/async-reconnect-client/mcp_async_reconnect_client/__init__.py
Open in desktop https://desktop.github.com
examples/clients/async-reconnect-client/mcp_async_reconnect_client/client.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files#diff-8081ad62be19693553617c987cb4314bbe3bc3c6469390ac5b88ac770cdaad9b
View file https://github.com/LucaButBoring/mcp-python-sdk/blob/84c6e4b0b7904a8f98d9de4edad0e9e1e500d3d4/examples/clients/async-reconnect-client/mcp_async_reconnect_client/client.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/1398/{{ revealButtonHref }}
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/1398/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.