@modelcontextprotocol/server-legacy
2.4.0 · 23 Oct 2026Apache-2.01M / weekRepositoryHomepagenpmAtom feed
2.4.0 is the newest release of 2.x.
In short
1 deprecated10 fixed2 changed
- 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.
Security
1 advisory affects 2.2.0; 2.3.1 fixes them
- ModerateMCP TypeScript SDK: Server bearer authentication accepted tokens issued for another serviceGHSA-rvq5-wwqv-78pq · 20 Oct 2026Fixed in 2.3.1
Release note
| Package | Version |
|---|---|
@modelcontextprotocol/client | 2.2.0 |
@modelcontextprotocol/server | 2.2.0 |
@modelcontextprotocol/core | 2.2.0 |
@modelcontextprotocol/server-legacy | 2.2.0 |
@modelcontextprotocol/codemod | 2.2.0 |
@modelcontextprotocol/node, express, hono, fastify | unchanged |
Upgrade notes
- 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. 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.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.
Fixes
CommonJS TypeScript projects type-check again: the
josetypes 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._metais preserved oninput_requiredresults.Hostnames ending in
.localhostcount as loopback for OAuth token endpoints, so host-based multi-tenant local setups work.OAuthTokensSchemaandOAuthClientInformationSchemaaccept the optionalissuerfield, so a provider that reads its storage back through them keeps it.createMcpHandlerno 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.createMcpHandlerends asubscriptions/listenstream 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-v2codemod 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
registerClientdeprecation 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.