@modelcontextprotocol/server-legacy
2.4.0 · 23 Oct 2026Apache-2.0832.3k / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgrade- 2.x2.4.0Safe from 2.3.1Latest line
What to use instead
Its maintainers name no replacement, and the e18e list has none yet.
Latest releases
2.4.0
23 Oct 2026outputSchemafromz.object(...).meta({ id }). On a 2025-11-25 connection the result is no longer wrapped in{ result }: readstructuredContent, notstructuredContent.result.The bundled Ajv validator uses fast-uri 3.1.8. It rejects a
$idor$refwith an invalid URI scheme, such asmy_tool:output.
Package Version @modelcontextprotocol/client2.4.0 @modelcontextprotocol/server2.4.0 @modelcontextprotocol/core2.4.0 @modelcontextprotocol/server-legacy2.4.0 @modelcontextprotocol/codemod2.4.0 @modelcontextprotocol/node2.1.2 @modelcontextprotocol/express,hono,fastifyunchanged Upgrade notes
x-mcp-headeron anumberparameter is rejected, as the 2026-07-28 spec requires: the client does not list such a tool, and the server answers a call to it with-32020. Usez.int()or remove the annotation. (#2762, #2960)outputSchemafromz.object(...).meta({ id }). On a 2025-11-25 connection the result is no longer wrapped in{ result }: readstructuredContent, notstructuredContent.result.The bundled Ajv validator uses fast-uri 3.1.8. It rejects a
$idor$refwith an invalid URI scheme, such asmy_tool:output.
New
Skills over MCP (SEP-2640). A server publishes a folder of skills with
loadSkills(folder)andskills.attach(server); a client lists, reads and verifies them withSkillsClient. It works on 2025-11-25 and 2026-07-28.attachis experimental and may change in a minor release. (#3047, #3080)Opt-in
scopeon token refresh. ImplementscopeForRefresh(tokens)on yourOAuthClientProviderfor an authorization server that rejects a refresh withoutscope(Microsoft Entra ID,AADSTS90009). The default request does not change.ServerEventtakes optionalparams, so a gateway can forward change notifications with their_meta.The v1 to v2 upgrade guide is also an installable agent skill.
Fixes
update({ title })on a resource or resource template shows up in list responses.A
Serverconnected to a per-request transport at a modern revision binds that revision instead of answering-32022.createMcpHandlersendsAllow: POSTon every405.@modelcontextprotocol/nodeaccepts@hono/node-server1.x or 2.x; a new install resolves 2.x.
2.3.1
5 Oct 2026requireBearerAuthin@modelcontextprotocol/server-legacytakes the optionalexpectedResourcethat@modelcontextprotocol/server2.3.0 added: it accepts only tokens issued for this server (the token's audience). Off unless you set it.The npm pages of
@modelcontextprotocol/serverand@modelcontextprotocol/clientnow open with one note that links the documentation, the migration guide and the issue form.
2.3.0
2 Oct 2026One 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.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.
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)
Package Version @modelcontextprotocol/client2.3.0 @modelcontextprotocol/server2.3.0 @modelcontextprotocol/core2.3.0 @modelcontextprotocol/server-legacy2.3.0 @modelcontextprotocol/codemod2.3.0 @modelcontextprotocol/node2.1.1 @modelcontextprotocol/express,hono2.0.2 @modelcontextprotocol/fastify2.0.1 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 theMcpServerand the transport inside the request handler (or in thecreateMcpHandlerfactory) 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.
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)prompts/getwithoutargumentsis validated as{}, astools/callalready is. A top-level.optional()or.default(...)on a prompt'sargsSchemano longer seesundefined.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.
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.tasks/getandtasks/cancelof 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/getwithoutargumentsno longer fails when every argument of the prompt is optional.SSEClientTransportrefreshes once after a 401 on connect instead of retrying without limit. (#2905, #2934)registerToolno longer converts tool schemas up front, so a server built per request stops converting every tool on every request.honois a regular dependency of@modelcontextprotocol/node, so installs with strict peer-dependency checking no longer fail.A
server/discoverprobe answered with an unusable 2xx reply now says so instead of reading like a network failure.McpServer.registerPrompt()types the callback correctly when noargsSchemais given.The
licensefield of the package manifests isApache-2.0.
Dependency tracking · free for 3 projects
Know when your own dependencies move
@modelcontextprotocol/server-legacy had 1 security advisory in the last 12 months. inlinr emails you the day one touches a project of yours, with the version that fixes it.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Reading releases, release notes and advisories…
Registry facts last checked 5 Nov 2026. Releases and advisories last read 5 Nov 2026.