Skip to content

fix: upgrade @modelcontextprotocol/sdk to 1.26.0 and zod to 4.x#102

Open
rado0x54 wants to merge 1 commit intomainfrom
chore/fix-mcp-sdk-advisory
Open

fix: upgrade @modelcontextprotocol/sdk to 1.26.0 and zod to 4.x#102
rado0x54 wants to merge 1 commit intomainfrom
chore/fix-mcp-sdk-advisory

Conversation

@rado0x54
Copy link
Contributor

@rado0x54 rado0x54 commented Feb 4, 2026

Summary

  • 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()

Changes

Dependencies

  • All packages updated to @modelcontextprotocol/sdk@^1.26.0
  • All packages updated to zod@^4.x
  • Removed zod-to-json-schema dependency (replaced with native Zod 4 API)

Code Changes

  • z.record(z.string())z.record(z.string(), z.string()) (Zod 4 requires explicit key schema)
  • Use AnySchema/SchemaOutput types from SDK's zod-compat layer
  • Add assertTaskCapability/assertTaskHandlerCapability methods to PassthroughBaseProtocol
  • Use safeParse from SDK's zod-compat for cross-Zod-version compatibility
  • Replace zodToJsonSchema() with z.toJSONSchema()

Test Updates

  • SDK 1.26.0 returns tool errors as successful responses with isError: true instead of throwing
  • Removed deprecated toolDefinition field from test fixtures
  • Updated error callback tests to reflect new SDK behavior

Test plan

  • Local typecheck passes
  • hook-common tests pass
  • local-tools-hook tests pass
  • passthrough-mcp-server tests pass (282 passed, 1 skipped)
  • CI tests

@rado0x54 rado0x54 force-pushed the chore/fix-mcp-sdk-advisory branch from c4bc133 to 37893fc Compare February 4, 2026 22:06
@github-actions github-actions bot added dependencies Pull requests that update a dependency file passthrough-mcp-server test labels Feb 4, 2026
_options?: RequestOptions,
): Promise<SchemaOutput<U>> => {
// biome-ignore lint/suspicious/noExplicitAny: stub function with complex SDK-internal types
sendRequest: (): Promise<any> => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@rado0x54 rado0x54 force-pushed the chore/fix-mcp-sdk-advisory branch from 37893fc to 206ad5f Compare February 4, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file passthrough-mcp-server test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant