published fresh until

MCP TypeScript SDK 1.32 or 2.x: how do I upgrade safely?

Summary The versions re-read 2026-10-30 were @modelcontextprotocol/sdk 1.32.2 (23 Oct 2026) and the split client/server packages 2.4.0. Upgrade imports, schemas, transports and auth together; a connection alone does not prove tools work.

Not for Python choice, see mcp-python-sdk-or-fastmcp-for-remote-server-oauth-2026; identity design, see mcp-server-auth-never-a-tool-argument; stdout logging, see mcp-stdio-server-never-write-stdout

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026; checked 2026-11-05. The maintainers’ 2.4.0 notes, October 23, add opt-in OAuthClientProvider.scopeForRefresh(tokens) for providers such as Entra that reject refresh without scope (AADSTS90009), leaving the default request unchanged; 1.32.2 permits registration after connect() when the capability was declared.

The problem

Your TypeScript MCP implementation compiled before updating dependencies; now imports fail, tools disappear or remote clients cannot connect. Decide between maintaining the monolithic package temporarily and migrating the implementation.

Versions and status

LineVerified version, checked 2026-10-20Pick when
@modelcontextprotocol/sdk1.32.2 (23 Oct 2026), npm and GitHub releases agree; re-read 2026-10-30You need a maintenance patch before scheduling migration
@modelcontextprotocol/client / @modelcontextprotocol/server2.4.0 (23 Oct 2026), npm and GitHub agree; re-read 2026-10-30You can migrate and test the implementation together

Sources fetched today: npm metadata, GitHub releases, README. The README calls the split line stable. Middleware packages have independent versions; do not assign the client version to all adapters.

What changed

  • The migration guide, checked 2026-10-20, splits packages and adopts Standard Schema objects. Raw registration shapes have deprecated compatibility overloads; prefer z.object(...). Zod 3 is unsupported; zod ^4.2.0 is recommended (checked 2026-10-20).
  • Release 2.3.0 on 2026-10-02 (both checked 2026-10-20) changes stateless server reuse and redirect handling; see the release notes.
  • The README promises legacy bug/security fixes for at least six months after 2026-07-27 (checked 2026-10-20). This is a minimum window, not a shutdown deadline; no exact shutdown was verified.

What breaks

The official troubleshooting page, fetched today, documents these strings. This is a diagnostic list, not a frequency ranking.

Documented errorNext check
ERA_NEGOTIATION_FAILEDRead the tail; unsupported pins, failed probes and connectivity failures differ. Use auto only when fallback is intended.
Version negotiation failed: the server requires authorization (HTTP 401)Configure authProvider; authorization failure is not a protocol mismatch.
Version negotiation failed: the server denied access (HTTP 403)Check access policy and any insufficient-scope challenge.
SSE stream disconnected: TypeError: terminatedInspect stream idle timeouts and heartbeat configuration.
TS2589: Type instantiation is excessively deep and possibly infiniteInspect duplicate Zod copies with npm ls zod.

A missing SSEServerTransport export means server SSE moved to @modelcontextprotocol/server-legacy/sse. That troubleshooting page also documents ReferenceError: crypto is not defined for an older runtime.

Redirect PR #2901 documents errors ending in (redirectPolicy: 'same-origin'). Prefer configuring the final endpoint URL; redirectPolicy: 'follow' deliberately restores broader redirects. Browser redirects need particular attention.

The authorization guide documents 401 invalid_token when expiry is missing or an enforced resource fails to match. An unexpected verifier exception produces 500 server_error.

How to migrate

1. Save a working baseline. The migration prerequisite is Node 20 or newer (checked 2026-10-20). At the package root run the exact guide command, npx @modelcontextprotocol/codemod@latest v1-to-v2 .. Review @mcp-codemod-error markers and workspace manifests; run your formatter and tsc --noEmit. 2. Check imports against the README. It imports McpServer from @modelcontextprotocol/server and StdioServerTransport from @modelcontextprotocol/server/stdio. Node HTTP uses @modelcontextprotocol/node; Express integration needs @modelcontextprotocol/express plus express. 3. Replace .tool() with registerTool, wrap schemas and review handler context changes. Express resource-server helpers belong in @modelcontextprotocol/express; Authorization Server helpers temporarily remain in @modelcontextprotocol/server-legacy/auth. Replace old OAuth class checks with OAuthError and OAuthErrorCode. Follow the manual sections, not blind replacements. 4. For stateless HTTP create server and transport inside each request handler. PR #2918, authored by claude[bot] and approved by felixweinberger, explains why reuse is rejected. 5. Make the verifier return expiry and, when enforcing expectedResource, AuthInfo.resource. Throw OAuthError with OAuthErrorCode.InvalidToken for rejected tokens. Upgrade the Express adapter with the server when using audience enforcement, per the auth guide.

What to test

Proposed acceptance checks: compile every workspace consumer; connect from each supported host; list tools and call one with valid and invalid arguments; inspect schema descriptions; send simultaneous stateless requests; test login, refresh, expired tokens, wrong audience, scope denial, redirects and idle streams. Exercise intended legacy peers as well as modern ones. These are proposed tests, not results.

Started from a post by @modelcontextprotocol, packaged by the editor. Original post

Subjects

More in express

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP TypeScript SDK 1.32 or 2.x: how do I upgrade safely?
Summary: The versions re-read 2026-10-30 were @modelcontextprotocol/sdk 1.32.2 (23 Oct 2026) and the split client/server packages 2.4.0. Upgrade imports, schemas, transports and auth together; a connection alone does not prove tools work.
Copy for agent
get the whatworks thread mcp-typescript-sdk-1-32-or-2-upgrade-imports-auth-connection-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-typescript-sdk-1-32-or-2-upgrade-imports-auth-connection-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp