refactor: upgrade MCP client to SDK v2 packages - #449
Merged
Conversation
chore: promote dev to main (open-issues-batch + security fixes)
docs: add v1.0.33 release notes
This was referenced Aug 25, 2026
…tiation - swap @modelcontextprotocol/sdk@1.29.0 for @modelcontextprotocol/client@2.0.0 (+core, server dev-only); workspace zod ^4.2.0; drop stale v1 patch - remove StreamableHTTP->SSE fallback; Streamable HTTP failure is terminal - handler registration moved to method strings; oauth-provider types from client root; test mocks re-pointed to the v2 package root - ConfigMCPV1 local/remote gain optional protocol: auto|legacy|modern, mapped to ClientOptions.versionNegotiation (default auto probes server/discover with 2025 fallback; modern pins 2026-07-28) - regenerate JS SDK types; mcp auth diagnostics mirror the era mapping - behavior note: v2 removes transparent 404 session recovery and SSE-only (pre-2025-03-26) servers no longer connect; protocol: legacy is the escape hatch Closes#447Closes#448
LeXwDeX
marked this pull request as ready for review
August 25, 2026 14:04
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Closes#447
Closes#448
Why
The MCP ecosystem moved: the
2026-07-28specification is stateless (noinitializehandshake, noMcp-Session-Id,server/discoverera probing), and the TypeScript SDK v2 (@modelcontextprotocol/client@2.0.0) implements it with built-in era negotiation and automatic fallback. We were pinned to@modelcontextprotocol/sdk@1.29.0(v1, maintenance-only). Rather than building a v1↔v2 bridge process, the SDK'sversionNegotiationcovers both worlds: one v2 code path, legacy servers transparently supported.What changed
#447 — SDK v2 migration (behavior-preserving)
@modelcontextprotocol/sdk→@modelcontextprotocol/client@2.0.0+core@2.0.0(serverdev-only for tests); workspace zod^4.2.0; stale v1 patch entry and patch file removedconnectRemote— Streamable HTTP failure is terminalroots/list,elicitation/create,notifications/message,notifications/tools/list_changed);callToolschema-arg drop; test mocks re-pointed to the v2 package root#448 — configurable 2026-07-28 era negotiation
ConfigMCPV1local/remote entries gain optionalprotocol: "auto" | "legacy" | "modern"(defaultauto); JS SDK types regeneratedcreateClientmaps it toClientOptions.versionNegotiation:autoprobesserver/discoverwith conservative fallback to the 2025 handshake;legacyskips the probe;modernpins2026-07-28with no fallbackmcp authdiagnostics mirror the same mapping; elicitation handler verified compatible with 2026-erainput_requiredauto-fulfilment (no code change needed)Evidence
bun typecheck(packages/opencode): exit 0; root turbo typecheck 29/29bun test test/mcp: 92/92 pass (83 migrated + 9 new inprotocol.test.tscovering parsing + versionNegotiation mapping)bun run lint: 4814 / 4850 warnings (pre-change baseline 4833 → zero new; budget not weakened)test:httpapi: 230 pass / 0 fail / 0 missing; SDKcheck:generateddiff is exactly the+2 protocol?linesdag_fe5fc6f72541xbogE0yDEGwLXU: explore → migrate → era → verify (PASS) → review (PASS, 0 blocking / 7 informational, all informational items addressed in aa3fda5)Behavior notes (for release notes)
protocol: "legacy"does not help there; such servers must upgrade to Streamable HTTPSdkHttpError(CLIENT_HTTP_NOT_IMPLEMENTED, status 404) instead of silently re-initializing;session-recovery.test.tsdocuments the new contractconfig_assistantGo JSON schema embed has no freshness gate