fix: upgrade @modelcontextprotocol/sdk to 1.26.0 and zod to 4.x#102
Open
fix: upgrade @modelcontextprotocol/sdk to 1.26.0 and zod to 4.x#102
Conversation
c4bc133 to
37893fc
Compare
rado0x54
commented
Feb 4, 2026
| _options?: RequestOptions, | ||
| ): Promise<SchemaOutput<U>> => { | ||
| // biome-ignore lint/suspicious/noExplicitAny: stub function with complex SDK-internal types | ||
| sendRequest: (): Promise<any> => { |
Contributor
Author
There was a problem hiding this comment.
I don't understand this change.
- Upgrade @modelcontextprotocol/sdk from ^1.17.1 to ^1.26.0 to fix GHSA-345p-7cg4-v4c7 (cross-client data leak vulnerability) - Upgrade zod from ^3.x to ^4.x for SDK compatibility - Replace zod-to-json-schema with Zod 4's built-in z.toJSONSchema() - Update code for Zod 4 API changes (z.record requires key schema) - Update code for SDK 1.26.0 API changes: - Use AnySchema/SchemaOutput types from zod-compat - Add assertTaskCapability/assertTaskHandlerCapability methods - Use safeParse for cross-Zod-version compatibility - Update tests for SDK behavioral changes: - Tool errors now returned as results with isError: true - Remove deprecated toolDefinition field from tests � Conflicts: � packages/audit-hook/package.json � packages/custom-description-hook/package.json � packages/explain-hook/package.json � packages/fetch-docs/package.json � packages/guardrail-hook/package.json � packages/hook-common/package.json � packages/local-tools-hook/package.json � packages/local-tools-hook/src/hook.test.ts � packages/local-tools-hook/src/hook.ts � packages/passthrough-mcp-server/package.json � packages/passthrough-mcp-server/src/integration-tests/continueAsync.integration.test.ts � packages/passthrough-mcp-server/src/integration-tests/error-callbacks.integration.test.ts � packages/passthrough-mcp-server/src/protocol/passthroughBaseProtocol.ts � packages/server-hook/src/hook.test.ts � packages/simple-log-hook/package.json � packages/whoami-server/package.json � pnpm-lock.yaml � test/integration/package.json � test/integration/servers/api-key-protected/package.json � test/integration/servers/echo/package.json � test/integration/servers/local-stdio/package.json
37893fc to
206ad5f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@modelcontextprotocol/sdkfrom ^1.17.1 to ^1.26.0 to fix GHSA-345p-7cg4-v4c7 (cross-client data leak vulnerability)zodfrom ^3.x to ^4.x for SDK compatibilityzod-to-json-schemawith Zod 4's built-inz.toJSONSchema()Changes
Dependencies
@modelcontextprotocol/sdk@^1.26.0zod@^4.xzod-to-json-schemadependency (replaced with native Zod 4 API)Code Changes
z.record(z.string())→z.record(z.string(), z.string())(Zod 4 requires explicit key schema)AnySchema/SchemaOutputtypes from SDK's zod-compat layerassertTaskCapability/assertTaskHandlerCapabilitymethods to PassthroughBaseProtocolsafeParsefrom SDK's zod-compat for cross-Zod-version compatibilityzodToJsonSchema()withz.toJSONSchema()Test Updates
isError: trueinstead of throwingtoolDefinitionfield from test fixturesTest plan