Skip to content

Conversation

@felixweinberger
Copy link
Contributor

Updates spec.types.ts from upstream and fixes compatibility issues:

  • Make requestId optional in CancelledNotificationParams (per spec change for task cancellation)
  • Make id optional in JSONRPCErrorSchema (per JSON-RPC spec for parse errors)
  • Handle optional id in protocol.ts when routing error responses
  • Add type compatibility tests for new task-related types
  • Add Fix helpers for spec/SDK type differences:
    • FixSDKTaskParams: SDK's task.ttl allows null, spec's TaskMetadata doesn't
    • FixSpecJSONRPCResponse: Spec's JSONRPCResponse is now a union
    • DeepAddIndexSignature: Handle spec's object vs SDK's {[x:string]:unknown}
  • Update MISSING_SDK_TYPES for spec-only types

Closes #1152

Motivation and Context

How Has This Been Tested?

Breaking Changes

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

Updates spec.types.ts from upstream and fixes compatibility issues:

- Make requestId optional in CancelledNotificationParams (per spec change for task cancellation)
- Make id optional in JSONRPCErrorSchema (per JSON-RPC spec for parse errors)
- Handle optional id in protocol.ts when routing error responses
- Add type compatibility tests for new task-related types
- Add Fix helpers for spec/SDK type differences:
  - FixSDKTaskParams: SDK's task.ttl allows null, spec's TaskMetadata doesn't
  - FixSpecJSONRPCResponse: Spec's JSONRPCResponse is now a union
  - DeepAddIndexSignature: Handle spec's object vs SDK's {[x:string]:unknown}
- Update MISSING_SDK_TYPES for spec-only types

Closes #1152
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 3, 2025

Open in StackBlitz

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

commit: 555909a

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.

2 participants