Repository navigation
Update dependency mcp to v2 [SECURITY] - #893
renovate[bot] wants to merge 1 commit into
Conversation
Pull request dashboard statusClosed · refreshed 2026-10-13 17:43 UTC Status above doesn't look right?
|
There was a problem hiding this comment.
🟡 Changes recommended
MCP 2 removes an API required by the pinned AgentScope 1.x dependency, potentially failing or skipping tests.
0 open findings
What changed in this PR
Updates QwenPaw’s latest test environment to permit MCP 2 for security remediation.
Changes:
- Expands the MCP upper bound from
<2to<3.
| File | Description |
|---|---|
instrumentation/opentelemetry-instrumentation-genai-qwenpaw/tests/requirements.latest.txt |
Allows MCP 2 in latest-version tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Root Cause Analysis (RCA): CI Failure on PR #893Summary Root Cause
Action Plan
|
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
<2→<3Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default
CVE-2025-66416 / GHSA-9h52-p55h-vw2f
More information
Details
Description
The Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection by default for HTTP-based servers. When an HTTP-based MCP server is run on localhost without authentication using
FastMCPwith streamable HTTP or SSE transport, and has not configuredTransportSecuritySettings, a malicious website could exploit DNS rebinding to bypass same-origin policy restrictions and send requests to the local MCP server. This could allow an attacker to invoke tools or access resources exposed by the MCP server on behalf of the user in those limited circumstances.Note that running HTTP-based MCP servers locally without authentication is not recommended per MCP security best practices. This issue does not affect servers using stdio transport.
Servers created via
FastMCP()now have DNS rebinding protection enabled by default when thehostparameter is127.0.0.1orlocalhost. Users are advised to update to version1.23.0to receive this automatic protection. Users with custom low-level server configurations usingStreamableHTTPSessionManagerorSseServerTransportdirectly should explicitly configureTransportSecuritySettingswhen running an unauthenticated server on localhost.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal
CVE-2026-52869 / GHSA-jpw9-pfvf-9f58
More information
Details
Summary
In affected versions, the SSE and Streamable HTTP server transports routed incoming requests to an existing session based only on the session identifier, without verifying that the request was authenticated as the same principal that created the session. Anyone who learned or guessed a session ID could send JSON-RPC messages on that session, regardless of which bearer token the request carried.
Am I affected?
Only if a developer's application server uses an HTTP transport (SSE, or Streamable HTTP in stateful mode) and authenticates requests. Servers on stdio, stateless Streamable HTTP, or with no authentication configured are not affected.
Details
Both transports look up the target session by its identifier alone — the
session_idquery parameter for SSE (mcp.server.sse.SseServerTransport) and theMcp-Session-Idheader for Streamable HTTP (mcp.server.streamable_http_manager.StreamableHTTPSessionManager). Once the lookup succeeded, the request was handled on that session without comparing its authentication context to the credentials presented when the session was created, so a request authenticated as a different OAuth client could inject messages into the session. On the SSE transport the response is delivered to the original client's event stream; on the Streamable HTTP transport it is returned on the injecting request, so the injecting client can also read the result. The SSE transport has been affected since the first release; the Streamable HTTP transport since version 1.8.0.Impact
Servers using either HTTP transport together with the SDK's built-in bearer-token authentication are affected: the per-client isolation that authentication provides can be bypassed for any session whose ID is known. Session IDs are randomly generated UUIDs, so exploitation requires obtaining one out of band (logs, network observation). Servers that do not enable bearer-token authentication have no per-client isolation to bypass and are not addressed by this advisory, and stateless Streamable HTTP deployments do not maintain sessions and are unaffected.
Mitigation
Upgrade to version 1.27.2 or later, which records the authenticated principal that created each session — the OAuth client ID together with the token's issuer and subject when the token verifier supplies them — and answers requests presenting a different principal with the same 404 response as for an unknown session.
Deployments where many end users share a single OAuth client (hosted MCP clients, gateways) should ensure their token verifier populates
AccessToken.subject(e.g. from the token'ssubclaim) so sessions are isolated per user rather than per client. Deployments using a custom authentication backend other than the built-inBearerAuthBackendshould enforce an equivalent check themselves.Severity
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
MCP Python SDK: WebSocket server transport does not support Host/Origin validation
CVE-2026-59950 / GHSA-vj7q-gjh5-988w
More information
Details
Summary
In affected versions, the deprecated WebSocket server transport (
mcp.server.websocket.websocket_server) accepted the WebSocket handshake without applying anyHostorOriginheader validation. TheTransportSecuritySettingsmechanism that the SSE and Streamable HTTP transports use for this purpose was not wired into the WebSocket transport, so there was no SDK-level way to restrict which origins could connect.Am I affected?
Only if a developer's application server exposes
mcp.server.websocket.websocket_server. This transport has never been part of the MCP specification, is marked deprecated, and is not reachable throughFastMCP— a developer must have wired it into an ASGI application themselves. Servers using stdio, SSE, or Streamable HTTP are not affected by this advisory.Details
websocket_server()constructed a StarletteWebSocketand calledaccept(subprotocol="mcp")immediately, with no inspection of the connection's headers. By contrast,SseServerTransportandStreamableHTTPServerTransportaccept an optionalsecurity_settings: TransportSecuritySettingsand runTransportSecurityMiddleware.validate_request()against the incomingHostandOriginheaders before establishing a session. Because browsers attach anOriginheader to cross-origin WebSocket upgrade requests but do not enforce a same-origin policy on the response, a web page served from any origin could open a WebSocket to a reachable MCP server on this transport, complete theinitializehandshake, and issue JSON-RPC requests on the resulting session.Impact
A user who runs an MCP server on this transport bound to localhost or a LAN address, without a separate authentication or origin gate in front of it, and visits a malicious web page, can have that page enumerate and invoke the server's tools and read its resources. The consequences depend entirely on what the server exposes. The transport itself requires no token or prior session. Some browsers prompt before allowing a public page to open a connection to a local-network address, which adds a user-interaction step but is not a substitute for server-side validation.
Mitigation
Upgrade to version 1.28.1 or later, in which
websocket_server()accepts the same optionalsecurity_settings: TransportSecuritySettingsargument as the other HTTP-based transports and validates theHostandOriginheaders before accepting the handshake; a request that fails validation is rejected with HTTP 403 andValueError("Request validation failed")is raised to the caller. As with the other transports the parameter defaults toNone, which leaves validation disabled, so upgrading alone does not change behaviour: pass aTransportSecuritySettingswithenable_dns_rebinding_protection=Trueand appropriateallowed_hosts/allowed_originsto receive the protection. The recommended path remains to migrate off this deprecated transport to Streamable HTTP, whereFastMCPenables this protection automatically for localhost binds. The WebSocket transport has been removed entirely in v2.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
modelcontextprotocol/python-sdk (mcp)
v2.3.0Compare Source
pip install -U mcp. Docs: https://py.sdk.modelcontextprotocol.io/Mostly fixes, plus three new options. A few things behave differently, so skim these first:
Behaviour changes
httpx2>=2.10.0is now required (#3600)>=2.5.0. The newmax_sse_event_sizeoption needs it.httpx2below 2.10.A tool with an invalid
x-mcp-headerannotation fails at registration (#3620)@mcp.tool(),add_toolandTool.from_functionraiseInvalidSignature, naming the tool and the problem.str,intorboolparameter (so alsostr | None,float, lists and enums), a header name that isn't a valid token, and two names that differ only by case.Annotated[str | None, WithJsonSchema({"type": "string", "x-mcp-header": "Region"})] = None.Empty
_metaandparamsare no longer sent (#3628)"_meta": {}on every request. Some servers reject that. It is now left out, as in v1.pingand list requests without a cursor go out with noparamsmember.ctx.metaisNonerather than{}, and middleware seesctx.paramsasNonefor a request without params.initializeleaves outexperimentalwhen none is configured (#3614)"experimental": {}.server/discoveralready left it out.capabilities.experimentalon a legacy connection should handleNone.Mcp-Param-*validation looks the tool up by name (#3630)MCPServerno longer runstools/listfor everytools/call, so middleware no longer sees that extra request.tools/listno longer affects it.An interactive OAuth login no longer counts against request timeouts (#3635)
OAuthClientProviderwaits onredirect_handlerandcallback_handler.Client(mode="auto")settling on2025-11-25when the login took longer than 10 seconds.callback_handlerif you need one.New
max_sse_event_size=onstreamable_http_clientandStreamableHttpParameters. The default stays 1 MiB per SSE event; raise it, or passNone, for larger tool results (#3600).MCPServer(subscriptions=False)stops servingsubscriptions/listenand advertiseslistChangedandsubscribeas false (#3626).Server(get_tool_input_schema=...)lets a low-level server supply a tool's schema for header validation without running itstools/listhandler (#3630).Client.call_toolre-lists the tools and retries once after aHeaderMismatch(-32020) rejection (#3627).Fixes
ctx: Context[AppState]works on prompts and resource templates, not only on tools (#3624)."structuredContent": nullis checked against the output schema instead of being treated as missing (#3621).progress_callbackthat raises no longer fails the call on an in-processClient(server)(#3623).mode="auto", connecting to a server withoutserver/discovernow shows oneERRORspan for the probe (#3629).stdio_clientresolves the executable off the event loop on Windows (#3510).Docs
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v2.2.0...v2.3.0
v2.2.0Compare Source
pip install -U mcp. Docs: https://py.sdk.modelcontextprotocol.io/A few defaults changed in this release. If you run a server or client on 2.x, skim these first:
Behaviour changes
HTTP client redirects are only followed within the endpoint's origin (#3397)
Client("https://..."),streamable_http_clientandsse_clientfollow a redirect only if it stays on the same scheme, host and port (or upgradeshttptohttpson the same host).MCPErrorand the session stays usable (an SSE connect fails withhttpx2.HTTPStatusError). If that other URL is the server you meant, use it as the endpoint URL.follow_redirectssetting on anhttpx2.AsyncClientyou pass in is no longer used for MCP requests, so you don't need it for the trailing-slash redirect any more.Idle Streamable HTTP sessions now expire (legacy <=2025-11-25 spec( (#3395)
Clientdoes) are not affected. Neither are stateless servers or 2026-07-28 connections.mcp.run(transport="streamable-http", session_idle_timeout=None, max_sessions=None)(also onstreamable_http_app()andrun_streamable_http_async()).The OAuth client checks the authorization server's
issueron the legacy path too (#3398)issuerisn't the server's own origin is now rejected withOAuthFlowError: Authorization server metadata issuer mismatch. The protected-resource-metadata path has done this since 2.0.insufficient_scopechallenge is returned to the caller instead of retried.Two new
MCPDeprecationWarnings (#3435, #3447)ClientCredentialsOAuthProvider/PrivateKeyJWTOAuthProviderwithoutissuer=. Pass your authorization server's issuer URL; 3.0 will require it.AuthSettingswithresource_server_urlset butvalidate_token_resourceunset. Set it toTrueorFalse; 3.0 defaults it toTrue.New
AuthSettings.validate_token_resource: only accept tokens yourTokenVerifierreports as issued for this server (#3447).issuer=onClientCredentialsOAuthProviderandPrivateKeyJWTOAuthProvider(#3398).session_idle_timeout=andmax_sessions=on the Streamable HTTP server entry points (#3395).Fixes
DELETEfrees its session immediately, and a refused opening request no longer leaves a session behind (#2455, #3228, #3300).$refs in a tool'soutputSchemaresolve within that schema only; an unresolvable one surfaces asRuntimeError: Invalid schema for tool ...(#3394).Known gaps
The tasks extension (SEP-2663), DPoP (SEP-1932) and the
jwt-bearergrant are not implemented yet; https://github.com/modelcontextprotocol/python-sdk/blob/main/ROADMAP.md tracks them.What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v2.1.1...v2.2.0
v2.1.1Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v2.1.0...v2.1.1
v2.1.0Compare Source
Highlights
ClientacceptsStdioServerParametersdirectly:Client(StdioServerParameters(command="uv", args=["run", "server.py"]))(#3321).ImageandAudio, prompt functions may return bare content blocks, andMessage/UserMessage/AssistantMessageare exported frommcp.server.mcpserver(#3320).SseServerTransportandMCPServer.sse_app()takemax_request_body_size, and the SSE message endpoint answers 405 to non-POST requests (#3336).Behaviour changes to be aware of
Error executing tool <name>(or the resource/prompt equivalent) rather than the exception text. RaiseToolError/ResourceErrorwhen the message is meant for the model; those still reach the client and are logged at INFO without a traceback.TextContent,EmbeddedResource,Image,Audio, or lists/unions of them no longer advertisesoutputSchemaor returnsstructuredContent; itscontentis unchanged. Passstructured_output=Trueto keep the previous shape.Fixes
NotRequiredkeys are omitted instead of serialized asnull, and registration no longer fails on Python 3.10 (#3224, #3227); recursive return types get an object-rootedoutputSchemathat pre-2026 clients accept (#3337).notifications/cancelledis acknowledged with 202 instead of rejected with 400 (#3324).list_tools()(#3223), and accept boolean sub-schemas in tool schemaproperties(#3353).mcp installreads and preserves a Claude Desktop config containing non-ASCII text on any Windows code page (#3296).What's Changed
New Contributors
Full Changelog: modelcontextprotocol/python-sdk@v2.0.0...v2.1.0
v2.0.1Compare Source
One off backport of the FastMCP import warning for
2.0.x, this is due to a lot of people running into this error and making issues on other repos about it. Ideally either pinmcp<2or upgrade to 2.What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v2.0.0...v2.0.1
v2.0.0Compare Source
MCP Python SDK v2 Stable Release
This is v2.0.0, the stable v2 release of the MCP Python SDK. It supports the 2026-07-28 revision of the Model Context Protocol and serves every earlier revision from the same server.
pip install mcpnow installs 2.x.Documentation Rewrite
The documentation has the full tutorial and API reference. Coming from v1? What's new in v2 is the tour of what changed and why, and the migration guide lists every breaking change with before-and-after code.
V1 Maintenance mode
v1.x is in maintenance mode and will only receive security fixes from now on The 1.x line lives on the
v1.xbranch, continues to receive critical bug fixes and security patches, and is documented at https://py.sdk.modelcontextprotocol.io/v1/. If your project is not ready to migrate, keep a<2upper bound on your requirement (for examplemcp>=1.28,<2).Highlights
One SDK, both protocol eras
v2 speaks the 2026-07-28 revision (stateless requests with no handshake,
server/discover,subscriptions/listen, multi-round-trip requests) and still serves every 2025-era client from the sameMCPServer, over Streamable HTTP and stdio, with nothing to configure.Client(target)negotiates the version automatically.FastMCPis nowMCPServer, and there is a first-classClientThe decorator API is unchanged; the low-level
Serveris rebuilt around a shared dispatcher engine, and oneClientobject replaces v1's transport-plus-ClientSession-plus-initialize()layering. It connects to a URL, a stdio subprocess, a custom transport, or straight to a server object in memory for tests.Multi-round-trip requests and resolver dependency injection
At 2026-07-28 the server can no longer call the client, so tools return the question instead. A
Resolve(fn)parameter is filled by your function invisibly to the model and can put a question to the user; one tool body serves both eras.Extension APIs, OpenTelemetry, and a standalone types package
Servers and clients compose protocol extensions through pluggable extension APIs (MCP Apps built in); OpenTelemetry tracing ships on by default; every protocol type is its own package,
mcp-types(imported asmcp_types), published in lock-step withmcp.Hardened stdio and auth
stdio servers keep handler subprocesses and stray prints off the wire, and stdout is diverted to stderr while serving. OAuth adds RFC 9207 issuer validation, the SEP-990 identity-assertion flow, and the client-credentials extension.
Coming from a v2 pre-release
Since the last release candidate: the per-version wire packages are private (
mcp_types._v*),mcp.typesis a permanent alias formcp_types, the auth registration request model is split from the registered-client record, cancelled requests are no longer answered, and log notifications are gated on the per-request log-level opt-in at 2026-07-28. Since the betas:Client(cache=False)is nowcache=NonewithCacheConfig()the default;Context.client_id,RFC7523OAuthClientProvider, andOAuthClientProvider(timeout=)are removed; the client-credentials providers takescope=;message_handlerreceives notifications and exceptions only;FileResource(is_binary=)becomesencoding;MCP_*env vars are gone withpydantic-settings; Streamable HTTP servers reject bodies over 4 MiB with HTTP 413. The migration guide covers all of it.Known gaps
The tasks extension (SEP-2663) is not part of this release. On the client, the DPoP proof binding (SEP-1932) and the workload-identity
jwt-bearergrant are not implemented; both are additive and can land in 2.x.Feedback
Something rough, confusing, or broken? Open an issue or find us in #python-sdk-dev on the MCP Contributors Discord.
Full Changelog: modelcontextprotocol/python-sdk@v2.0.0rc1...v2.0.0
v1.30.0Compare Source
Maintenance release of the 1.x line. 2.x is the current line; 1.x docs are at https://py.sdk.modelcontextprotocol.io/v1/.
A few defaults changed in this release. If you run a server or client on 1.x, skim these first:
Behaviour changes
HTTP client redirects are only followed within the endpoint's origin (#3448)
streamable_http_clientandsse_clientfollow a redirect only if it stays on the same scheme, host and port (or upgradeshttptohttpson the same host).httpx.HTTPStatusError. If that other URL is the server you meant, use it as the endpoint URL.follow_redirectssetting on anhttpx.AsyncClientyou pass in is no longer used for MCP requests, so you don't need it for the trailing-slash redirect any more.OAuthClientProviderapplies the same rule to its own requests.Idle Streamable HTTP sessions now expire (#3426)
FastMCP(..., session_idle_timeout=None, max_sessions=None).The OAuth client checks the authorization server's
issuer(#3431)issuerdoesn't match the server it was fetched for is now rejected withOAuthFlowError: Authorization server metadata issuer mismatch.Two new
DeprecationWarnings (#3431, #3451)ClientCredentialsOAuthProvider/PrivateKeyJWTOAuthProviderwithoutissuer=. Pass your authorization server's issuer URL.AuthSettingswithresource_server_urlset butvalidate_token_resourceunset. Set it toTrueorFalse.New
AuthSettings.validate_token_resource: only accept tokens yourTokenVerifierreports as issued for this server (#3451).issuer=onClientCredentialsOAuthProviderandPrivateKeyJWTOAuthProvider(#3431).session_idle_timeout=andmax_sessions=onFastMCP(#3426).What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.29.1...v1.30.0
v1.29.1Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.29.0...v1.29.1
v1.29.0Compare Source
What's Changed
Full Changelog: modelcontextprotocol/python-sdk@v1.28.1...v1.29.0
v1.28.1Compare Source
What's Changed
Full Changelog: <https://github.com/modelcontextprotocol/python-sd
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.