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

28 Sep 2026Where it was published

2.4.0 is the newest release of 2.x.

npm marks 2.2.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

1 deprecated10 fixed2 changed

  • Deprecated

    Pass expectedIssuer to the machine-to-machine OAuth providers. Constructing ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider or CrossAppAccessProvider without it is deprecated and logs a warning. Set it to the issuer of the authorization server the credentials were registered with.

Security

1 advisory affects 2.2.0; 2.3.1 fixes them

Release note

Upgrade notes

  • Deprecated

    Pass expectedIssuer to the machine-to-machine OAuth providers. Constructing ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider or CrossAppAccessProvider without it is deprecated and logs a warning. Set it to the issuer of the authorization server the credentials were registered with.

  • fetchToken() checks which authorization server the client information belongs to. It throws AuthorizationServerMismatchError before sending anything when the provider's client information is bound to a different authorization server.

  • List calls return the whole list. listTools(), listPrompts(), listResources() and listResourceTemplates() called without a cursor now follow nextCursor until the server stops sending one. listMaxPages still caps the walk.

Fixes

  • CommonJS TypeScript projects type-check again: the jose types used by the DPoP API are inlined into the declaration files (regression in 2.1.0).

  • Client.listen() no longer lets a rejection escape as a process-level unhandled rejection, and no longer hangs when a send never settles.

  • _meta is preserved on input_required results.

  • Hostnames ending in .localhost count as loopback for OAuth token endpoints, so host-based multi-tenant local setups work.

  • OAuthTokensSchema and OAuthClientInformationSchema accept the optional issuer field, so a provider that reads its storage back through them keeps it.

  • createMcpHandler no longer overflows the stack when the factory returns the same server instance for more than one request. Returning a fresh instance per request is still required.

  • createMcpHandler ends a subscriptions/listen stream right after the acknowledgement when it honored none of the requested notification types.

  • Sending a notification on a closed connection no longer produces a briefly unhandled promise rejection.

  • The v1-to-v2 codemod keeps a file's leading comment block and directives above the rewritten imports.

  • Corrected citations in the JSDoc for OAuth token endpoints and for the registerClient deprecation notice. (#2768, #2729)

Per-package changelogs

client · server · core · server-legacy · codemod

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.