Skip to content

AgentsNews

MCP TypeScript SDK v2.2.0 Enhances OAuth, List Calls

The Model Context Protocol TypeScript SDK v2.2.0 has been released, updating key client and server packages. This update introduces a mandatory expectedIssuer parameter for machine-to-machine OAuth providers and enhances list call behavior.

AI Dev Hub Editorial

Human-reviewed

Published
Updated
Reading time
3 min read
  • 2 sources cited
  • 20 facts quote-verified
  • Human-approved
Listen to this article0:00 / 7:34

Narrated with an AI voice (Heart (US female), Kokoro-82M (open-weight)).

The Model Context Protocol (MCP) TypeScript SDK has released version 2.2.0, bringing updates to several core packages including @modelcontextprotocol/client and @modelcontextprotocol/server 1. This release focuses on bolstering security for machine-to-machine OAuth communications and improving data retrieval efficiency for list operations 1.

Developers using the SDK, which implements the 2026-07-28 MCP specification 2 and runs on Node.js, Bun, and Deno environments 2, should review the changes, particularly regarding OAuth provider configuration 1. For a deeper understanding of the protocol itself, refer to /articles/what-is-the-model-context-protocol.

What Changed in v2.2.0

OAuth expectedIssuer Requirement

Version 2.2.0 introduces a significant change for machine-to-machine OAuth providers 1. Developers must now explicitly pass the expectedIssuer parameter when constructing ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider, or CrossAppAccessProvider 1. Failing to provide expectedIssuer is now deprecated and will log a warning 1. The expectedIssuer value should correspond to the issuer of the authorization server where the credentials were registered 1.

Additionally, the fetchToken() function now performs validation to ensure the client information belongs to the correct authorization server 1. If a provider's client information is bound to a different authorization server, fetchToken() will proactively throw an AuthorizationServerMismatchError before initiating any requests 1. This enhances security by preventing tokens from being used with unintended issuers.

Hostnames ending in .localhost are now correctly recognized as loopback addresses for OAuth token endpoints, facilitating multi-tenant local setups based on hostnames 1. The OAuthTokensSchema and OAuthClientInformationSchema have also been updated to support an optional issuer field, allowing providers to retain this information when reading from storage 1.

Enhanced List Call Behavior

List calls within the SDK, such as listTools(), listPrompts(), listResources(), and listResourceTemplates(), now retrieve the entire list by default when called without a cursor 1. The SDK achieves this by automatically following nextCursor until the server no longer provides one 1. The listMaxPages option remains available to cap this full list retrieval process 1.

Bug Fixes and Stability Improvements

Several issues have been addressed in this release:

  • CommonJS Type-Checking: CommonJS TypeScript projects can now correctly type-check again 1. The jose types used by the DPoP API are inlined into declaration files, resolving a regression introduced in version 2.1.0 1.
  • Client.listen() Stability: The Client.listen() method has been improved to prevent rejections from escaping as process-level unhandled rejections 1. It also no longer hangs if a send operation fails to settle 1.
  • createMcpHandler Stack Overflow: A stack overflow issue in createMcpHandler has been fixed, which previously occurred when the factory returned the same server instance for multiple requests 1. Developers are still required to return a fresh instance per request 1.
  • Codemod Improvements: The v1-to-v2 codemod now preserves a file's leading comment block and directives when rewriting imports 1.

Why It Matters for Developers

The expectedIssuer requirement for machine-to-machine OAuth providers 1 and the fetchToken() validation 1 ensure that tokens are issued and validated against the correct authorization server 1. This explicit validation helps prevent potential misuse or misconfiguration.

For developers working with lists, the enhanced default behavior of list calls simplifies data retrieval. Instead of manually iterating through paginated results, developers can now often get a complete list with a single call 1, reducing boilerplate code. The fix for CommonJS TypeScript projects is crucial for maintaining type safety and development workflow for users of that module system 1. For more on structured outputs and type safety in TypeScript SDKs, see /articles/structured-outputs-typescript-ai-sdk-zod.

How to Try It

To upgrade to MCP TypeScript SDK v2.2.0, update the relevant @modelcontextprotocol packages to version 2.2.0 1. Packages such as @modelcontextprotocol/node, express, hono, and fastify remain unchanged 1.

Install the client or server packages using your preferred package manager 2:

bash
npm install @modelcontextprotocol/server
# or
bun add @modelcontextprotocol/server
# or
deno add npm:@modelcontextprotocol/server
bash
npm install @modelcontextprotocol/client
# or
bun add @modelcontextprotocol/client
# or
deno add npm:@modelcontextprotocol/client

Optional middleware packages for specific runtimes or frameworks can be installed as needed 2:

bash
# Node.js HTTP (IncomingMessage/ServerResponse) Streamable HTTP transport:
npm install @modelcontextprotocol/node

# Express integration:
npm install @modelcontextprotocol/express express

# Fastify integration:
npm install @modelcontextprotocol/fastify fastify

# Hono integration:
npm install @modelcontextprotocol/hono hono

Here is a minimal example of an MCP server exposing a 'greet' tool over stdio 2:

typescript
import { McpServer } from '@modelcontextprotocol/server';
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
import * as z from 'zod/v4';

const server = new McpServer({ name: 'greeting-server', version: '1.0.0' });

server.registerTool(
 'greet',
 {
 description: 'Greet someone by name',
 inputSchema: z.object({ name: z.string() })
 },
 async ({ name }) => ({
 content: [{ type: 'text', text: `Hello, ${name}!` }]
 })
);

async function main() {
 const transport = new StdioServerTransport();
 await server.connect(transport);
}

main();

Limitations and Open Questions

While this release introduces several improvements, some aspects remain for further clarification or future development:

  • It is currently unknown if there are any breaking changes for existing v2.x users beyond the expectedIssuer deprecation.
  • The specific performance implications of the fetchToken() authorization server mismatch check have not been detailed.
  • The exact behavior or error message when listMaxPages caps a list call is not specified in the release notes.
  • Specific migration steps or considerations for developers upgrading from v2.1.0 to v2.2.0, especially regarding the jose types fix, are not explicitly provided.
  • The specific use cases or benefits of the CrossAppAccessProvider mentioned in the expectedIssuer deprecation are not elaborated upon.
  • The recommended approach for handling the AuthorizationServerMismatchError in client applications is not explicitly outlined.
  • The full implications for CommonJS projects affected by the jose types regression in 2.1.0, and the precise steps they should take to upgrade, are not detailed beyond the fix itself.

Frequently asked questions

Which packages were updated in MCP TypeScript SDK v2.2.0?

In MCP TypeScript SDK v2.2.0, the @modelcontextprotocol/client, @modelcontextprotocol/server, @modelcontextprotocol/core, @modelcontextprotocol/server-legacy, and @modelcontextprotocol/codemod packages were all updated to version 2.2.0.

What is the new requirement for machine-to-machine OAuth providers in v2.2.0?

Machine-to-machine OAuth providers such as ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider, or CrossAppAccessProvider now require the expectedIssuer parameter to be passed during construction. Constructing these providers without it is deprecated and will log a warning.

How do list calls behave differently in v2.2.0?

When called without a cursor, list calls like listTools(), listPrompts(), listResources(), and listResourceTemplates() now automatically follow nextCursor until the entire list is retrieved. The listMaxPages option can still cap this retrieval.

Sources

Every factual claim above cites one of these documents, retrieved and snapshotted by our research pipeline.

  1. S1
    typescript-sdk 2.2.0
    Model Context ProtocolOfficialRetrieved Oct 4, 2026
  2. S2

Frameworks & SDKsNews

OpenAI Node SDK v7.28.0 Adds Custom Voice, Agent Events

The OpenAI Node SDK v7.28.0, released on October 2, 2026, introduces new API features for custom voice creation and agent session events. This update expands the SDK's capabilities for developers building AI-powered applications.

1 min read

Open SourceNews

Sopro V2 Turbo 2610 Improves Cloned Voice Quality

Sopro V2 Turbo 2610 is an interim update to the lightweight Sopro text-to-speech (TTS) model, primarily focused on improving the quality of cloned voices.

1 min readListen · 3 min