Skip to content

Conversation

@mattzcarey
Copy link
Contributor

Summary

  • Create mapping.ts as single source of truth for method → schema mappings
  • Remove resultSchema parameter from Protocol.request() - now derived from method name
  • Add HandlerResultTypeMap for typed setRequestHandler return values
  • Remove schema arguments from all Client and Server request methods

Breaking Changes

  • Protocol.request() no longer accepts a resultSchema parameter
  • Client.callTool() no longer accepts a resultSchema parameter
  • Handler return types are now strictly typed based on method name

Test plan

  • All core tests pass (430)
  • All client tests pass (245)
  • All server tests pass (37)
  • Type checking passes

🤖 Generated with Claude Code

BREAKING CHANGE: This SDK now requires Zod v4.0 or later.

- Remove all Zod v3 imports, types, and runtime detection
- Simplify `SchemaOutput<S>` to use direct indexed access `S['_zod']['output']`
- Remove `zod-to-json-schema` dependency (z4-mini has built-in JSON schema support)
- Add closure-based handlers for prompts and tools to eliminate runtime type casts
- Simplify `executeToolHandler` and `handleAutomaticTaskPolling`
- Remove v3 test blocks from integration tests
- Create mapping.ts as single source of truth for method-to-schema mappings
- Remove resultSchema parameter from Protocol.request() - now derived from method name
- Add HandlerResultTypeMap for typed setRequestHandler return values
- Update Client/Server setRequestHandler to use method-specific result types
- Remove schema arguments from all call sites (examples, tests)
- Fix test method names to use real MCP methods (ping, tools/call, etc.)

BREAKING CHANGE: Protocol.request() no longer accepts a resultSchema parameter.
The result type is now automatically inferred from the method name.
…args

- Update Server/Client setRequestHandler to use HandlerResultTypeMap[M]
- Remove schema arguments from all this.request() calls
- Clean up unused schema imports
@mattzcarey mattzcarey requested a review from a team as a code owner February 3, 2026 15:07
@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

⚠️ No Changeset found

Latest commit: cc7a95a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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