Skip to content

[v2] Minor task-related refactors#1758

Open
KKonstantinov wants to merge 10 commits intomainfrom
chore/task-refactors-1
Open

[v2] Minor task-related refactors#1758
KKonstantinov wants to merge 10 commits intomainfrom
chore/task-refactors-1

Conversation

@KKonstantinov
Copy link
Contributor

Based on #1315 by @LucaButBoring , resolved conflicts

  • Disallows requesting a null TTL in a task, as that isn't in the spec for requests (only for responses) - this was an oversight in the initial implementation.
  • Groups all task-related fields into a single object to unflatten the extra fields a bit.

Motivation and Context

#1275

One topic from #1275 that doesn't have any changes here is the ? vs. undefined thing - I took a look through the task interfaces and we use ? consistently, which I think is the right approach. Let me know if there's any disagreement on this, and I can adjust things appropriately.

How Has This Been Tested?

Adjusted unit tests for the grouping, and added some unit tests for disallowing null in requests.

Breaking Changes

Both of these are breaking changes, and are therefore intended to be part of the v2 SDK. I think it would be reasonable to backport one or both commits to the v1 branch (especially given this is clearly marked as experimental), but I'm defaulting to v2 here.

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

Closes #1275

LucaButBoring and others added 8 commits December 17, 2025 15:03
The specification only allows the server to return a null TTL, it doesn't allow the client to request that.
This is intentional, as it forces clients to make a choice betwen a specific TTL or not caring what the TTL is, rather than defaulting to keeping tasks forever all the time.

Allowing the requested value to be null was an implementation oversight that diverged from the spec.
@KKonstantinov KKonstantinov requested a review from a team as a code owner March 25, 2026 15:51
@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: 6525bb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@modelcontextprotocol/client Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/express Patch
@modelcontextprotocol/hono Patch
@modelcontextprotocol/node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1758

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1758

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1758

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1758

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1758

commit: 6525bb6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: Refactor task-related properties and improve type definitions

2 participants