@modelcontextprotocol/server
2.4.0 · 23 Oct 2026Apache-2.033.9M / weekRepositoryHomepagenpmAtom feed
Upgrading @modelcontextprotocol/server From 2.0.0 to 2.3.0
3 releases in betweenevery note read
Start here
Before you upgrade
Tick each one off as you go- Deprecated2.2.0
- Deprecated2.1.0
Security
Fixes 4 advisories affecting 2.0.0
- MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validationhigh · GHSA-46jr-4wx8-v453
- MCP TypeScript SDK: HTTP server transports and handlers did not limit request body size or JSON-RPC batch lengthhigh · GHSA-f897-62hf-6gxq
- MCP TypeScript server SDK: Shared transport or server instances delivered one HTTP client's messages to anotherhigh · GHSA-jm63-cq47-j5jp
- MCP TypeScript SDK: Server bearer authentication accepted tokens issued for another servicemoderate · GHSA-rvq5-wwqv-78pq
Release by release
- New
validateOriginHeaderand theallowedOriginsoption of the Express, Fastify and Hono app helpers accept<scheme>://*entries such asmoz-extension://*, so a server can admit MCP clients that run as a browser extension. - New
tasks/getandtasks/cancelof the Tasks extension can be served and called on a 2026-07-28 connection. - Fixed
A large message received as a single SSE event over Streamable HTTP is fast again: a 50 MB tool result that took about 13 seconds arrives in under a second.
- Fixed
prompts/getwithoutargumentsno longer fails when every argument of the prompt is optional.
- New
- Deprecated
Pass
expectedIssuerto the machine-to-machine OAuth providers. ConstructingClientCredentialsProvider,PrivateKeyJwtProvider,StaticPrivateKeyJwtProviderorCrossAppAccessProviderwithout it is deprecated and logs a warning. Set it to theissuerof the authorization server the credentials were registered with. - Fixed
CommonJS TypeScript projects type-check again: the
josetypes used by the DPoP API are inlined into the declaration files (regression in 2.1.0). - Fixed
Client.listen()no longer lets a rejection escape as a process-level unhandled rejection, and no longer hangs when a send never settles. - Fixed
_metais preserved oninput_requiredresults.
- Deprecated
- Deprecated
SdkErrorandSdkHttpErroraccept standardErrorOptionsas an optional fourth constructor argument and forward it toError, so a wrapped error is reachable through the standardError.causechain. Version-negotiation probe failures (SdkErrorCode.EraNegotiationFailed) now use it: the underlyingTypeError: fetch failedand the DNS or socket error beneath it surface viaerror.cause, so pino, Sentry, andutil.inspectrenderENOTFOUND/ECONNREFUSED/ETIMEDOUTinstead of stopping at theSdkError(#2657). The previouserror.data.causeslot is still populated for compatibility but is deprecated and slated for removal; readerror.causeinstead. - New
Add request-time OAuth scope challenges for tools, resources, resource templates, and prompts. Each primitive's
scopeChallengecallback receives the parsed request and verified authentication info, then either continues or returns the exact scope set for aninsufficient_scoperesponse.requireScopesprovides a small helper for static all-of checks. - Fixed
Treat request id
0as a real id. Two guards tested aRequestIdfor truthiness, so the legal JSON-RPC ids0and''were read as absent. Id0is not a corner case: the outbound request counter is zero-based, so it is the first id every peer assigns, which on the server→client leg is the firstsampling/createMessage,elicitation/create, orroots/lista server sends. - Fixed
Stop sending
notifications/cancelledfor theinitializehandshake. The spec is explicit that a client MUST NOT attempt to cancel itsinitializerequest, but the outbound cancel path fired for any in-flight request: aborting theAbortSignalpassed toconnect(), or letting the handshake hit its timeout, put a forbidden cancellation on the wire naming the initialize request id.
- Deprecated
7 other lines we could not sort, mostly version bumps
- 2.3.0
One server per request.
Server.connect()now rejects while the instance is already connected, and a stateless Streamable HTTP transport handles one request. Create theMcpServerand the transport inside the request handler (or in thecreateMcpHandlerfactory) instead of sharing one instance across requests. Creating a server is cheap since #2889. - 2.3.0
Redirects stay on the same origin. The HTTP client transports now follow a redirect only when it stays on the same origin (same scheme, host and port; http to https on the same host is allowed). A deployment whose endpoint redirects to another host or port either configures the final URL or sets
redirectPolicy: 'follow'on the transport. In browsers, a redirected request fails unless that option is set. - 2.3.0
New options, both off unless you set them.
maxToolInputElementsonMcpServerlimits the number of array elements and object members in a tool call's arguments.expectedResourceonrequireBearerAuth/verifyBearerTokenaccepts only tokens issued for this server (the token's audience); with Express, upgrade@modelcontextprotocol/expresstogether with@modelcontextprotocol/server. (#2926, #2929) - 2.3.0
prompts/getwithoutargumentsis validated as{}, astools/callalready is. A top-level.optional()or.default(...)on a prompt'sargsSchemano longer seesundefined. - 2.3.0
The client requires
eventsource-parser3.0.8 or later. It cuts the time and memory needed to receive a large message sent as a single SSE event: in our test a 100 MB tool result went from about a minute and 1.7 GB of peak memory to under a second and about 0.5 GB. - 2.2.0
fetchToken()checks which authorization server the client information belongs to. It throwsAuthorizationServerMismatchErrorbefore sending anything when the provider's client information is bound to a different authorization server. - 2.2.0
List calls return the whole list.
listTools(),listPrompts(),listResources()andlistResourceTemplates()called without a cursor now follownextCursoruntil the server stops sending one.listMaxPagesstill caps the walk.
1 internal line (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.