npm package report

Is @modelcontextprotocol/server safe?

3 known vulnerabilities, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    1 packages depend on it

    an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


    cvss
    0.0
    high

    severity band, no base score published

    epss
    not scored

    chance of exploitation in 30 days

    xyz score
    not scored

    CyberXYZ composite out of 10

    fig. 01 — GHSA-46jr-4wx8-v453, the advisory selected below

    // 3 advisories

    GHSA-46jr-4wx8-v453

    HIGHCVE-2026-111768
    // 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:

    • @modelcontextprotocol/sdk 1.3.0 through 1.31.0
    • @modelcontextprotocol/server 2.0.0 through 2.2.0
    // fix

    Upgrade to:

    • 1.x: @modelcontextprotocol/sdk 1.32.0 or later
    • 2.x: @modelcontextprotocol/server 2.3.0 or later

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

    • Set maxToolInputElements just above the largest input your tools need, for example new McpServer(info, { maxToolInputElements: 10000 }). It counts array elements and object keys in a call's arguments. A call over the limit gets an isError: true result.
    • 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.


    Checked 2026-10-20 at 23:24 UTC. The most recent advisory here was published 2026-10-20. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.