-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Background
PR #445 upgraded @modelcontextprotocol/sdk from 1.25.2 to 1.25.3 as part of a dependency update. This introduced a breaking change that caused type checking failures in our test fixtures.
PR #449 temporarily pinned the SDK to version 1.25.2 to unblock development, but we need to properly upgrade to the latest version and address the breaking changes.
Breaking Change
The MCP SDK introduced a breaking change where sessionIdGenerator is now a required property in StreamableHTTPServerTransportOptions. Previously this was optional, but the SDK now requires it to be explicitly provided.
Error Details
Type errors occurred in integration test fixtures when creating StreamableHTTPServerTransport instances:
test/integ/__fixtures__/test-mcp-server.tstest/integ/__fixtures__/test-mcp-task-server.ts
Required Changes
1. Update package.json
- Remove the pinned version constraint
"@modelcontextprotocol/sdk": "1.25.2" - Update to use the latest version with caret range:
"@modelcontextprotocol/sdk": "^1.25.3"(or latest)
2. Fix Test Fixtures
Both test server files need to provide the now-required sessionIdGenerator property when creating StreamableHTTPServerTransport instances:
Files to modify:
test/integ/__fixtures__/test-mcp-server.tstest/integ/__fixtures__/test-mcp-task-server.ts
Required change:
Add sessionIdGenerator to the transport options. Since these are stateless test servers where session management isn't meaningful, provide a simple static session ID generator:
sessionIdGenerator: () => 'test-session'3. Review @ts-expect-error Directives
- Check if any
@ts-expect-errordirectives related toexactOptionalPropertyTypesincompatibilities are now obsolete - Remove outdated type suppression comments if the underlying type issues have been resolved
Testing Requirements
Unit Tests
- Run
npm run testto ensure all unit tests pass - Verify test fixtures properly instantiate MCP server transports
Integration Tests
- Run integration tests to confirm HTTP-based MCP request handling works correctly
- Verify session management behavior in test scenarios
Type Checking
- Run
npm run type-checkto ensure no TypeScript errors - Run
npm run checkfor full validation
User Impact
No user-facing impact expected. This is an internal test infrastructure change only.
- The breaking change only affects test fixture code that creates
StreamableHTTPServerTransportinstances - Production code using the SDK should not be affected
- Users of the SDK will not need to make any changes to their code
Acceptance Criteria
-
@modelcontextprotocol/sdkupgraded to latest version (unpinned from 1.25.2) - All test fixtures updated with required
sessionIdGeneratorproperty - All tests passing (
npm run test) - Type checking passing (
npm run type-check) - Full check passing (
npm run check) - No obsolete
@ts-expect-errordirectives remaining
References
- Breaking change PR: ci: bump the production-minor group across 1 directory with 3 updates #445
- Temporary fix PR: fix(tests): pin MCP SDK to 1.25.2 #449
- MCP SDK release notes: https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v1.25.3