Skip to content

chore: migrate to MCP TypeScript SDK v2#122

Open
mattzcarey wants to merge 1 commit into
mainfrom
chore/mcp-sdk-migration
Open

chore: migrate to MCP TypeScript SDK v2#122
mattzcarey wants to merge 1 commit into
mainfrom
chore/mcp-sdk-migration

Conversation

@mattzcarey
Copy link
Copy Markdown
Contributor

@mattzcarey mattzcarey commented May 14, 2026

Summary

  • Replace @modelcontextprotocol/sdk with @modelcontextprotocol/server v2 alpha.
  • Update MCP server and Web Standard Streamable HTTP transport imports to the v2 package.
  • Wrap tool inputSchema definitions with z.object(...) for the v2 Standard Schema API.
  • Manually fix the dynamic non-codemode inputSchema case that the codemod missed.
  • Add @cfworker/json-schema explicitly for the current @modelcontextprotocol/server@2.0.0-alpha.2 Workers validator dependency.
  • Add MIGRATION_TRACKER.md with the commands run, manual fixes, validation, and upstream codemod follow-ups.

Validation

npm run typecheck
npm test
npm run deploy

Results:

  • npm run typecheck: passed.
  • npm test: passed, 178 tests.
  • npm run deploy: deployed to staging.

Staging deploy:

Worker: cloudflare-api-mcp-staging
URL: https://staging.mcp.cloudflare.com
Version ID: f91b375b-d7ea-482d-8a10-d49e7e9dae43

Notes

  • The dynamic inputSchema codemod miss was reported upstream on feat: add v2 codemod draft modelcontextprotocol/typescript-sdk#1950.
  • @cfworker/json-schema is added manually for the current SDK alpha. If a later SDK release bundles runtime-selected validator defaults, this direct dependency can be removed.
  • Tests still emit the existing vitest-pool-workers / CIMD global-scope logging noise, but the run passes.

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.

1 participant