Rightshold™ Sign up

Answers · MCP security

Our MCP servers and clients are built on the official Python SDK (the mcp package on PyPI, FastMCP and the 2.x MCPServer). Several 2026 advisories now list fixes in mcp 1.30.0 and 2.2.0. Is upgrading enough, or do some fixes need settings we have to turn on?

Last updated

TL;DR: Upgrade to mcp 1.30.0 or later on 1.x, or 2.2.0 or later on 2.x (2.3.0 was the newest release on PyPI on November 11, 2026). That covers every advisory the Python SDK has published since mid-2026, and most of the fixes work as soon as you upgrade: request bodies over 4 MiB get 413, idle Streamable HTTP sessions are closed after 1800 seconds with at most 10000 open at once, client transports no longer follow redirects to another origin, client-side output-schema validation no longer fetches server-chosen $ref URLs, and the interactive OAuthClientProvider refuses authorization server metadata whose issuer doesn't match. Three fixes do nothing until you change code or settings. The token-audience check (GHSA-w4fh-qvv9-3v23) needs validate_token_resource=True plus AccessToken.resource returned from verify_token(); the unattended OAuth providers (GHSA-qx49-fqc8-xw99) keep following whatever authorization server the MCP server names until you pass issuer=; and OAuth client registrations stored before 1.30.0 stay unbound to an issuer until you clear them. If many users share one OAuth client, sessions are only isolated per user when your token verifier fills in AccessToken.subject.

What should I check, step by step?

1. Run pip show mcp (or uv pip show mcp) in every environment you deploy and write down the version, including copies pulled in by other packages; a server and a client in the same codebase can pin different versions.

  1. Upgrade to mcp 1.30.0 or later (1.x) or 2.2.0 or later (2.x). There is no fixed 2.0.x release for the body-size limit, so anything still on 2.0.x has to move to 2.x latest.
  2. Server with bearer auth: set validate_token_resource=True in AuthSettings, set resource_server_url to the audience your authorization server puts in tokens for your server, and return the token's aud from verify_token() as AccessToken.resource. With only the setting, every request gets 401. Until you upgrade, reject any token whose aud doesn't include your server inside verify_token().
  3. Server shared by many users through one OAuth client (a hosted client or gateway): make verify_token() fill AccessToken.subject from the token's sub claim, so a session opened by one user can't be used by another holding a token for the same client.
  4. Client using ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider: pass issuer= with the authorization server your credentials belong to. On 1.30.0 leaving it out only raises a DeprecationWarning, which Python hides by default, so search your code for both class names rather than waiting for a warning. Move off the deprecated 1.x RFC7523OAuthClientProvider, which has no issuer option.
  5. Client with stored OAuth registrations: clear stored client information once after upgrading so the client registers again and the new record is bound to an issuer. If a client may already have connected to an untrusted MCP server, rotate its client secret and revoke its tokens at the authorization server.
  6. Small hosts: lower session_idle_timeout, max_sessions and max_request_body_size to fit your memory, or run stateless_http=True where you don't need per-session state. Passing None disables a limit, so grep for it.
  7. If you call server.experimental.enable_tasks() or still expose the deprecated WebSocket server transport on 1.x, check those two advisories separately (fixed in 1.27.2 and 1.28.1); the WebSocket fix also needs security_settings passed in, and the transport is gone in 2.x.

Which MCP Python SDK security fixes work as soon as you upgrade to mcp 1.30.0 or 2.2.0?

GHSA-fmmv-w9g8-j3gc (CVE-2026-109527, high): HTTP server transports and the SDK's OAuth endpoints read whole request bodies into memory before checking size, so one large request could grow memory by two to three times its size, with no credentials needed against the OAuth routes. Fixed in 1.29.1 and 2.1.0: every SDK HTTP endpoint answers 413 above a shared 4 MiB limit before parsing. Code that drives StreamableHTTPServerTransport directly, without the session manager, doesn't get the limit and must bound bodies itself.

Which MCP Python SDK fixes need validate_token_resource, issuer= or other settings turned on?

Token audience (GHSA-w4fh-qvv9-3v23, CVE-2026-116684, moderate): before the fix the SDK's server-side bearer authentication had no way to check that a token was issued for your server, so where one authorization server issues tokens for several services, a valid token for another service was accepted. The advisory says upgrading alone changes nothing: validate_token_resource is off unless you set it, and it will default to True in 3.0. You're affected if you use auth=AuthSettings(...) with token_verifier=, your authorization server serves other services too, and your verifier doesn't check aud.

How do you test that the MCP Python SDK audience check, session limits and issuer binding are working?

A dependency scanner only proves the version. For the audience check, send your server a token your authorization server issued for a different service and expect 401. For sessions, open sessions in a loop from a test client and confirm the server answers 503 at your max_sessions and that an idle session's ID answers 404 after the timeout. For bodies, POST just over max_request_body_size and expect 413.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “I just upgraded my Python MCP server to the patched SDK and turned on the audience check. Check what it serves now: has its tool list changed from what was recorded, and does any tool definition carry hidden text?”

One-click setup

{
  "tool": "precall_check",
  "arguments": {
    "url": "<your server's https MCP URL>"
  }
}

Rightshold reports what an MCP endpoint serves and what it has on record about it. It doesn't scan your code, dependencies or configuration, and an unchanged answer isn't a finding that a server or client is patched. Advisory details are as published by the MCP Python SDK maintainers on GitHub and release dates as listed on PyPI, both read on November 11, 2026; advisories get updated, so confirm fixed versions on the linked pages before you upgrade.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'