Draft
Conversation
Without this, rate limiting uses the proxy's IP instead of actual client IPs, causing all requests through Cloudflare to be rate limited together.
Add task-based execution support for the longRunningOperation tool, demonstrating the MCP Tasks protocol. Changes include: - Add InMemoryTaskStore and InMemoryTaskMessageQueue - Declare tasks capability with list, cancel, and tool call support - Extract runLongOperation helper for background task execution - Add task status updates and cancellation checking during long operations - Update SDK to 1.26.0 for tasks support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add task-based execution support for the
longRunningOperationtool, demonstrating the MCP Tasks protocol.Changes:
InMemoryTaskStoreandInMemoryTaskMessageQueuefrom SDK 1.26.0taskscapability with list, cancel, and tool call supportrunLongOperation()helper for background task execution with status updates@modelcontextprotocol/sdkto 1.26.0How it works:
longRunningOperation, the server creates a task and returns aCreateTaskResultimmediatelyCompanion PR: anthropics/apps (client-side tasks support in claude-ai)
Testing
longRunningOperation— should return task ID immediately, then complete asynchronously