Packages

@modelcontextprotocol/server-legacy

2.4.0 · 23 Oct 2026Apache-2.01M / weekRepositoryHomepagenpmAtom feed

Deprecated by its maintainers: This package is a frozen copy of v1's SSE transport and OAuth Authorization Server helpers for migration purposes only. Use StreamableHTTP from @modelcontextprotocol/server and a dedicated OAuth server in production. Will not receive new features.What to use instead
Your version

2.3.0

2 Oct 2026Where it was published

2.4.0 is the newest release of 2.x.

npm marks 2.3.0 as deprecated: This package is a frozen copy of v1's SSE transport and OAuth Authorization Server helpers for migration purposes only. Use StreamableHTTP from @modelcontextprotocol/server and a dedicated OAuth server in production. Will not receive new features.

In short

2 new8 fixed5 changed

Security

1 advisory affects 2.3.0; 2.3.1 fixes them

Release note

Upgrade notes

  • One server per request. Server.connect() now rejects while the instance is already connected, and a stateless Streamable HTTP transport handles one request. Create the McpServer and the transport inside the request handler (or in the createMcpHandler factory) instead of sharing one instance across requests. Creating a server is cheap since #2889.

  • 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.

  • New options, both off unless you set them. maxToolInputElements on McpServer limits the number of array elements and object members in a tool call's arguments. expectedResource on requireBearerAuth / verifyBearerToken accepts only tokens issued for this server (the token's audience); with Express, upgrade @modelcontextprotocol/express together with @modelcontextprotocol/server. (#2926, #2929)

  • prompts/get without arguments is validated as {}, as tools/call already is. A top-level .optional() or .default(...) on a prompt's argsSchema no longer sees undefined.

  • The client requires eventsource-parser 3.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.

New

  • validateOriginHeader and the allowedOrigins option of the Express, Fastify and Hono app helpers accept <scheme>://* entries such as moz-extension://*, so a server can admit MCP clients that run as a browser extension.

  • tasks/get and tasks/cancel of the Tasks extension can be served and called on a 2026-07-28 connection.

Fixes

  • 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.

  • prompts/get without arguments no longer fails when every argument of the prompt is optional.

  • SSEClientTransport refreshes once after a 401 on connect instead of retrying without limit. (#2905, #2934)

  • registerTool no longer converts tool schemas up front, so a server built per request stops converting every tool on every request.

  • hono is a regular dependency of @modelcontextprotocol/node, so installs with strict peer-dependency checking no longer fail.

  • A server/discover probe answered with an unusable 2xx reply now says so instead of reading like a network failure.

  • McpServer.registerPrompt() types the callback correctly when no argsSchema is given.

  • The license field of the package manifests is Apache-2.0.

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.