Packages

HighVulnerabilityGHSA-46jr-4wx8-v453CVE-2026-111768Published 20 Oct 2026

MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation

Affected releases · @modelcontextprotocol/sdk

  • 1.x1.3.0 – 1.31.0Fixed in 1.32.0

On 1.x, the newest line:

npm install @modelcontextprotocol/sdk@1.32.0
  1. Not affected

    0.4.0 – 1.2.0

    13 releases

  2. Affected

    1.3.0 – 1.31.0

    67 releases

  3. Fixed

    1.32.0 – 1.32.1

    2 releases, latest

82 stable releases of @modelcontextprotocol/sdk, oldest to newest.

Affected releases · @modelcontextprotocol/server

  • 2.x2.0.0 – 2.2.0Fixed in 2.3.0

On 2.x, the newest line:

npm install @modelcontextprotocol/server@2.3.0
  1. Affected

    2.0.0 – 2.2.0

    3 releases

  2. Fixed

    2.3.0 – 2.3.1

    2 releases, latest

5 stable releases of @modelcontextprotocol/server, oldest to newest.

Is your project affected?

Paste your package.json, or type the range you declare for @modelcontextprotocol/sdk. It is read in your browser and sent nowhere.

Is your project affected?

Paste your package.json, or type the range you declare for @modelcontextprotocol/server. It is read in your browser and sent nowhere.

What happens

Summary

In affected versions, servers put no limit on how many array elements and object keys they validated in one request. One HTTP request within the default 4 MiB size limit could exhaust the server's memory, and the process aborted with JavaScript heap out of memory.

No credentials are needed, unless you authenticate requests before they reach the SDK.

Am I affected?

Yes, if clients you do not fully trust can reach your server over HTTP. The risk is highest for McpServer tools whose input contains an array or a record. stdio-only servers are not affected.

Affected versions:

Fix

Upgrade to:

Upgrading alone changes nothing. The patched versions add an McpServer option, maxToolInputElements, that is off by default. Make both of these changes:

  1. Set maxToolInputElements just above the largest input your tools need, for example new McpServer(info, { maxToolInputElements: 10_000 }). It counts array elements and object keys in a call's arguments. A call over the limit gets an isError: true result.

  2. Lower the request size limit to what your tools need. The option covers tool arguments only, and the size limit covers everything else. Set maxRequestBodySize on the transport or createMcpHandler(). If you parse the body yourself, for example with express.json() or Fastify, set that parser's limit.

If you cannot upgrade yet, make the second change. maxRequestBodySize needs @modelcontextprotocol/sdk 1.30.1 or @modelcontextprotocol/server 2.1.0. Below that, use a reverse proxy.