Skip to content

[BUG] upgrade mcp sdk to 1.25.3 #453

@lizradway

Description

@lizradway

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.ts
  • test/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.ts
  • test/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-error directives related to exactOptionalPropertyTypes incompatibilities are now obsolete
  • Remove outdated type suppression comments if the underlying type issues have been resolved

Testing Requirements

Unit Tests

  • Run npm run test to 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-check to ensure no TypeScript errors
  • Run npm run check for 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 StreamableHTTPServerTransport instances
  • 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/sdk upgraded to latest version (unpinned from 1.25.2)
  • All test fixtures updated with required sessionIdGenerator property
  • All tests passing (npm run test)
  • Type checking passing (npm run type-check)
  • Full check passing (npm run check)
  • No obsolete @ts-expect-error directives remaining

References

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions