pypi / mcp
mcp
What changed in mcp 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
250 breaking8 security13 deprecations80 new APIs and options1 performance26 behavior and defaults34 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmcp 2334 changes
Breaking changes 243
After a HeaderMismatch (-32020) rejection, call_tool re-lists the tools and retries once.
initialize omits experimental when none is configured; client code reading capabilities.experimental on a legacy connection should handle None.
The required version is now httpx2>=2.10.0, up from >=2.5.0; the new max_sse_event_size option depends on it.
Validation now looks up the registered tool schema by name instead of running tools/list for every tools/call; middleware filtering or rewriting tools/list no longer affects validation.
Empty _meta is omitted from outbound requests; on the receiving side ctx.meta is None rather than an empty mapping.
Ping and list requests without a cursor omit params; middleware sees ctx.params as None for a request without params.
Invalid header annotations now fail during tool registration with InvalidSignature, naming the tool and the problem.
On the legacy OAuth discovery path, metadata is rejected when its issuer differs from the server's origin.
MCP HTTP clients and OAuth providers follow redirects only within the endpoint's origin, with an HTTP-to-HTTPS upgrade on the same host allowed; other redirects fail.
Streamable HTTP servers now allow at most 10,000 sessions by default; set this parameter to
Noneto disable the limit.A 403 response without an
insufficient_scopechallenge is returned to the caller instead of being retried.OAuth discovery stops instead of falling back to legacy endpoints when protected resource metadata cannot be fetched because of a 5xx or 429 response.
Stateful legacy Streamable HTTP sessions now expire after 30 minutes of inactivity by default; set this parameter to
Noneto disable the timeout.Redirects are followed only within the endpoint's origin, or when upgrading HTTP to HTTPS on the same host; other redirects fail with httpx.HTTPStatusError.
Tool output-schema references are resolved only within the schema document.
Tools annotated to return content blocks no longer advertise outputSchema or return structuredContent; pass structured_output=True to keep the previous shape.
Unexpected tool, resource, or prompt handler exceptions are logged once at ERROR with a traceback; clients receive a generic error instead of the exception text. ToolError and ResourceError messages still reach clients and are logged at INFO without a traceback.
NotRequired keys in TypedDict tool results are omitted instead of serialized as null.
The 4 MiB request body limit now also applies to the SSE transport and OAuth endpoints.
The SSE message endpoint answers 405 to non-POST requests.
AnyFunction is removed; use Callable[..., Any] directly.
The minimum anyio version is raised to >=4.9 for Python <3.14 and >=4.10 for Python >=3.14.
OAuth discovery now rejects authorization-server metadata whose issuer does not exactly match the advertised authorization-server URL.
Path-less
issuer_urlandresource_server_urlstrings keep their empty path, changing the issuer URL served in metadata.BaseSession and its receive loop were removed; ClientSession now runs on JSONRPCDispatcher.
The callback now returns
AuthorizationCodeResultrather than a(code, state)tuple; forward the redirect'sissvalue so issuer validation can run.Cancelled requests generally receive no further response; the 2025-era streamable HTTP transport instead terminates the stream with a valid -32800 REQUEST_CANCELLED error.
Client(cache=False) changes to cache=None, with CacheConfig() as the default.
Client now defaults to mode='auto', which can cause servers to receive an unexpected server/discover request.
Client adds mode to control version negotiation; auto is the default and legacy reproduces v1's initialize-only handshake.
Exported TypeAdapter for validating ClientNotification union values.
Exported TypeAdapter for validating ClientRequest union values.
Exported TypeAdapter for validating ClientResult union values.
Using token_endpoint_auth_method="client_secret_post" now changes the token request body to include client_id.
A single Client replaces the transport-plus-ClientSession-plus-initialize() layering and can connect to URLs, stdio subprocesses, custom transports, or in-memory server objects.
Renamed the requested-scope keyword from
scopestoscopeto reflect that its value is a single space-separated string.Union message types are no longer RootModel subclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root or model_validate().
Union message types are no longer RootModel subclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root or model_validate().
A client-specific request context replaces the client-side use of the shared RequestContext.
The *Type aliases for client and server request, notification, and result unions are removed; use the bare union names.
Union message types are no longer RootModel subclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root or model_validate().
Inbound callbacks and notifications now run concurrently in separate tasks; deliveries start in arrival order but may interleave without a built-in concurrency bound.
The method was removed; use the server_capabilities, server_info, instructions, and protocol_version properties.
The cursor parameter was removed; pass params=PaginatedRequestParams(cursor=...) instead.
List methods now take a keyword-only PaginatedRequestParams value through params for pagination.
Notifications sent after connection closure are dropped with a debug log instead of raising a transport error.
The client send_notification method no longer accepts related_request_id.
Calling send_request before entering the context manager now immediately raises RuntimeError; after connection closure it raises MCPError with CONNECTION_CLOSED.
The client send_request method no longer accepts ServerMessageMetadata.
Sessions are no longer generic; send_request takes a concrete request model and a result model class or pydantic TypeAdapter.
Negotiated server capabilities are available as a property populated by initialize() or discover().
Exposes negotiated server identity metadata, which can be None when a 2026-era server omits it.
The uri parameter now accepts str; convert AnyUrl values to strings.
The deprecated args parameter was removed; pass arguments instead.
Content is removed from the protocol types; use ContentBlock.
The ServerSessionT type parameter was dropped; the remaining lifespan and request type parameters have defaults.
Context.client_id was removed; read custom request metadata from ctx.request_context.meta or obtain the authenticated OAuth client from the access token.
Elicitation now renders and validates schemas against PrimitiveSchemaDefinition at the call site; unsupported schema shapes raise TypeError, and accepted answers that mismatch the schema raise ValueError.
Context logging helpers take data: Any instead of message: str, and the convenience methods no longer accept extra.
Context logging methods take data: Any instead of message: str, remove extra, and Context.log accepts all eight RFC 5424 levels.
Progress reporting takes an absolute current value rather than a delta and is a no-op when the caller did not request progress.
Memory-stream helpers now yield context-propagating wrappers rather than plain anyio streams; send_nowait, receive_nowait, and statistics are unavailable.
The in-memory testing helper was removed; use mcp.client.Client, which accepts a Server or MCPServer and handles transport and session setup.
Replaces the ctx.fastmcp property with ctx.mcp_server.
Cursor is removed; use str directly.
ElicitationResult is now a TypeAliasType and supports generic annotations such as ElicitationResult[Confirm], but runtime isinstance checks against the alias raise TypeError.
Unknown fields are silently dropped rather than preserved; use _meta for custom data. ClientCapabilities and ServerCapabilities retain unknown top-level keys in model_extra.
FastMCP is renamed to MCPServer; update imports and references.
The server exception is renamed to MCPServerError.
Replaces is_binary with encoding: a string decodes and serves text, while None serves bytes. Defaults use a MIME charset, UTF-8 with BOM tolerance for textual MIME types, or bytes otherwise.
The is_binary argument was removed; passing it now raises ValidationError at construction.
The type alias was removed; wrappers that need the type can inline Callable[[], str | None].
The SDK no longer installs httpx; applications that use it must declare it as their own dependency or port calls to httpx2.
The streamable HTTP client factory parameter is gone with no replacement; call your factory yourself and pass its result as http_client.
The httpx-sse dependency is removed because httpx2 includes server-sent events support.
The SDK replaces httpx and httpx-sse with httpx2; client objects, auth providers, exception handling, and SSE usage must use httpx2 types and APIs.
The client-credentials providers now use httpx2.Auth as their base class, and the auth APIs and helper request/response objects are retyped to httpx2.
The message_handler parameter is now IncomingMessage, a union of ServerNotification and Exception; requests are handled by typed callbacks.
Protocol model fields use snake_case for Python attribute access; camelCase remains accepted as constructor kwargs.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Client-authentication failures at /token now return invalid_client instead of unauthorized_client; update code that matches the old error code.
Unclosed braces, duplicate variable names, unsupported syntax, and adjacent variables without a delimiter now raise InvalidUriTemplate when the decorator runs.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
The union is no longer a RootModel; use jsonrpc_message_adapter for validation and pass concrete message members directly.
Removed the model; use
SignedJWTParametersto build an assertion orstatic_assertion_provider(token)for a prebuilt JWT.Exported named scalar for the latest handshake protocol version.
Exported named scalar for the latest modern protocol version.
Now identifies the newest revision spoken in any era, not the version offered during initialization; use LATEST_HANDSHAKE_VERSION for negotiation.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
The deprecated logging capability is gone; log delivery is now opted into per request.
The automatic jsonschema validation previously performed by the call_tool decorator is gone; validate inputs yourself in the handler if needed.
Lowlevel handlers must construct full result types themselves; automatic wrapping of tool, resource, and list return values has been removed.
Automatic wrapping of bare list or dict handler returns is removed; these returns fail result validation.
Tool handler exceptions no longer become CallToolResult values with isError=true; clients receive a JSON-RPC error.
Streamable HTTP POST bodies now have a 4 MiB default limit and oversized requests receive HTTP 413 before parsing or session creation; configure a larger positive byte limit when needed.
The command pins the spawned environment's mcp requirement to the installed SDK version; source builds and unpublished versions remain unpinned.
MCP_* environment variables are gone with pydantic-settings.
The command pins the spawned environment's mcp requirement to the installed SDK version; source builds and unpublished versions remain unpinned.
The header-name constant moved; import MCP_PROTOCOL_VERSION_HEADER from mcp.shared.inbound instead.
The header-name constant moved to mcp.shared.inbound and is now named MCP_PROTOCOL_VERSION_HEADER.
mcp-types becomes a required dependency pinned exactly to the SDK version.
The optional WebSocket dependency extra no longer exists.
The extension no longer re-exports OAuthTokenError; import it from mcp.client.auth.
Experimental Tasks support and its client, server, and shared experimental modules and properties were removed; this SDK does not implement the reintroduced official Tasks extension yet.
The WebSocket client transport was removed; use the streamable HTTP transport instead.
The old FastMCP module path no longer imports; use mcp.server.mcpserver and its corresponding submodules.
The WebSocket server transport was removed; use streamable HTTP instead.
The mcp.shared.session module and its generic typing helpers were removed; sessions are no longer generic.
The mcp.shared.session module is gone, along with RequestResponder and its response and cancellation-tracking members.
The module is removed; import the version registry from mcp.types.version instead.
McpError is renamed to MCPError; update imports and references.
MCPError adds the e.code convenience property for reading the protocol error code.
Renames McpError, is exported from the top-level mcp package, and takes code, message, and optional data directly.
Raising MCPError in an @mcp.tool() handler now returns a top-level JSON-RPC error preserving code, message, and data; callers of Client.call_tool() and ClientSession.call_tool() now raise it.
Renames FastMCP and moves its imports and submodules from mcp.server.fastmcp to mcp.server.mcpserver.
Transport-specific settings moved from the constructor to run() and app factories; run() overloads validate accepted keywords by transport, and HTTP transports raise TypeError for unrecognized keywords.
The server remains generic over its lifespan result; FastMCP[MyState] becomes MCPServer[MyState].
A server constructed without a name now reports mcp-server as serverInfo.name instead of FastMCP.
Direct calls now return CallToolResult or InputRequiredResult instead of exposing internal conversion shapes; read content and structured_content from the result.
Ambient context lookup was removed; accept an injected ctx: Context parameter in tool, resource, or prompt handlers instead.
Direct calls may now return InputRequiredResult in addition to GetPromptResult; narrow the union when handling results.
Direct calls may now return InputRequiredResult in addition to resource contents; narrow the union when handling results.
Constructor positional parameters now include title and description before instructions and version after icons; pass all parameters other than name by keyword to avoid silently changing their meaning.
Transport-specific configuration moved from the constructor to run(), sse_app(), and streamable_http_app(); pass those options where the transport is started or its app is built.
MCPServer replaces FastMCP and serves both protocol eras over Streamable HTTP and stdio.
Delivered notifications are concrete member instances rather than RootModel wrappers; access message.params instead of message.root.params.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Pass by_alias=True when serializing models to produce camelCase wire-format keys; the default now emits snake_case keys.
Exported tuple of per-request-envelope protocol versions.
The parameter was removed from MCPServer methods and Settings; SSE sub-path mounting uses ASGI root_path instead.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Server-initiated requests without a channel now fail with NoBackChannelError instead of stalling.
The public handler dictionary is removed; register handlers through constructor on_* arguments or add_notification_handler, and look them up by method string.
The nested class is gone; notification _meta is a plain dict and extras use dictionary access.
Path-less URLs parsed from strings or JSON preserve their empty path instead of gaining a trailing slash, affecting issuer comparisons and redirect URI serialization.
No longer subclasses
OAuthClientMetadata; it tolerates server-substituted registration metadata, while record validation methods now belong to this type.Registered client credentials record their issuing authorization server; credentials bound to a different server are discarded and re-registered.
Now represents the strict registration request separately from the tolerant server record;
validate_scope()andvalidate_redirect_uri()are no longer available on it.Path-less redirect URIs passed as strings serialize without an added trailing slash and are sent verbatim; re-register persisted URIs if their stored form includes the slash.
Removed the unused
timeoutconstructor argument; apply authorization-wait bounds in the redirect or callback handler instead.Removed the stored
timeoutvalue because it was never read and did not bound runtime behavior.Exported named scalar for the oldest supported protocol version.
Generic handler exceptions are no longer converted to is_error tool results; they propagate as top-level JSON-RPC errors, so handlers must build error results themselves when desired.
opentelemetry-api >=1.28.0 becomes a required dependency because OpenTelemetry trace propagation ships enabled.
Renamed the requested-scope keyword from
scopestoscopeto reflect that its value is a single space-separated string.Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
The mcp.shared.progress module, including ProgressContext, Progress, and progress(), has been removed; use Context.report_progress() or session.report_progress().
Path-less URLs parsed from strings or JSON retain an empty path instead of gaining a trailing slash.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
The minimum pydantic version is raised to >=2.12 and the <3 cap is dropped.
On Windows, the minimum pywin32 version is raised to >=311.
Client and ClientSession resource methods now accept str for uri; convert AnyUrl values to strings.
Timeout parameters that previously accepted datetime.timedelta now take plain seconds as float, including client and server session request timeouts.
The SDK's registration endpoint returns all registered metadata, including
application_typeandclient_secret_expires_atwhen a secret is issued, and rejectsprivate_key_jwtregistrations.On 2026 log delivery,
related_request_idonsend_log_messageno longer selects the standalone stream; delivered messages ride the requesting stream.A raising request callback now returns code 0 and the exception text; ValidationError still maps to INVALID_PARAMS.
The module-level context variable was removed.
The public request_handlers and notification_handlers dictionaries are removed; register through constructor on_* arguments or add_* methods, and use method-string lookup methods to check registrations.
The public handler dictionary is removed; register handlers through constructor on_* arguments or add_request_handler, and look them up by method string.
On 2026-07-28 connections, servers send log messages only for requests that opt in through
_metawithio.modelcontextprotocol/logLevel, and only at or above the requested level.Client request timeouts now use the JSON-RPC code -32001 instead of HTTP status 408; compare against REQUEST_TIMEOUT.
The shared generic RequestContext was removed; use ClientRequestContext or ServerRequestContext instead.
Replaces the nested RequestParams.Meta Pydantic model with a top-level TypedDict; read progress_token through dictionary access.
RequestResponder and its response and cancellation-tracking members were removed; inbound cancellation is handled by JSONRPCDispatcher.
Elicit, Sample, and ListRoots resolver markers now enforce declared client capabilities on every protocol version; missing capabilities fail with -32021 MISSING_REQUIRED_CLIENT_CAPABILITY.
Resource classes now reject unrecognised keyword arguments with ValidationError; subclasses can opt into arbitrary extras with model_config = ConfigDict(extra="allow").
Reading a missing resource now returns JSON-RPC error code -32602 with the requested URI in error.data.
Template matching now supports RFC 6570, matches literals and structural delimiters exactly, allows empty simple-variable values, and applies decoded-value path-safety checks by default.
Template parameter values containing traversal components, null bytes, or absolute paths are rejected by default, including encoded forms; rejected strict templates do not fall through to later permissive templates.
Resource URIs now have type str rather than AnyUrl.
The resource URI field is now a plain str instead of AnyUrl, allowing relative paths and preserving the supplied string.
ResourceTemplate.create_resource() now raises ResourceError when the template function fails instead of ValueError.
Resource lookups now raise ResourceNotFoundError when no resource or template matches; it subclasses ResourceError and replaces ValueError for this case.
ResourceReference is removed from the protocol types; use ResourceTemplateReference.
Removed the deprecated provider; use the provider for the specific client-credentials or identity-assertion flow instead.
Message unions are plain unions rather than RootModel instances; use TypeAdapter validation where needed.
The client-credentials providers use scope= instead of scopes=.
Clients explicitly configured for secret-based authentication but lacking a stored secret are rejected before grant processing.
The v1-style session change-notification helpers push bare notifications that are dropped on 2026-07-28 connections; publish through the subscription bus instead.
Lowlevel decorator-based handlers are replaced with on_* constructor parameters.
All constructor parameters after name are keyword-only, so positional version and other arguments must be changed to keyword arguments.
Handler results are validated against the negotiated protocol schema before serialization; invalid results raise server-side and produce an INTERNAL_ERROR response for the client.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Lowlevel handlers are registered as constructor keyword arguments and receive a ServerRequestContext plus typed params, returning full result types instead of using decorator methods.
Exported TypeAdapter for validating ServerRequest union values.
Exported TypeAdapter for validating ServerResult union values.
The generic type parameter count drops from two to one; the RequestT parameter has been removed.
Private dispatch methods _handle_message, _handle_request, and _handle_notification are removed; use middleware to intercept requests.
The lowlevel Server now supports arbitrary request handlers through add_request_handler; decorator methods are gone, and MCPServer users can access it through the private _lowlevel_server.
Middleware can observe or intercept dispatch, with method and raw params available on the context; its signature and semantics are provisional.
The property was removed; request context is passed directly to handlers as the first argument.
raise_exceptions now governs handler exceptions only; transport errors are debug-logged and dropped rather than re-raised.
The stateless parameter was removed; stateless serving is determined by how the connection is constructed.
Servers without an explicit version now report an empty string instead of the installed mcp package version; pass version to identify your server.
Union message types are no longer RootModel subclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root or model_validate().
Union message types are no longer RootModel subclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root or model_validate().
A server-specific request context replaces the server-side use of the shared RequestContext and adds protocol_version, method, and raw params fields.
Union message types are no longer
RootModelsubclasses: construct member values directly and use the exported TypeAdapter for validation instead of .root ormodel_validate().ServerSession is no longer an async context manager.
Direct construction now takes request_outbound and connection instead of streams, init_options, and stateless.
The public inbound message stream was removed; register handlers or use Server.middleware to observe inbound traffic.
Notifications sent after the connection closes are dropped and debug-logged instead of raising closed-resource exceptions.
The schema keyword was renamed from requestedSchema to requested_schema.
The schema keyword was renamed from requestedSchema to requested_schema; keyword callers must update.
The method now takes the notification model itself; the types.ServerNotification wrapper is gone.
A fresh proxy is created for every inbound message, so proxy identity cannot be used as a stable per-connection key.
Settings is now a plain Pydantic model, so MCP_* environment variables and .env files are no longer read; read environment values yourself and pass them to the constructor.
Settings retains only constructor-owned fields; assigning removed transport fields such as port now raises ValueError, so pass transport values to run() or app factories.
Protocol fields change from camelCase to snake_case, so update field access such as inputSchema to input_schema.
The minimum sse-starlette version is raised to >=3.0.0.
A non-template resource URI paired with a handler that takes only Context now raises ValueError at decoration time.
On POSIX, children left behind by a server that exits gracefully are deliberately left alive; servers that exceed the grace period are still terminated with their process group.
The client now closes its pipe ends deterministically at shutdown, and failed writes to a running server surface as CONNECTION_CLOSED on the read side.
The transport moves protocol I/O to private descriptors and redirects fd 0 to the null device and fd 1 to stderr while serving, restoring both on exit.
A second concurrent call using the process's default streams now raises RuntimeError instead of contending for stdin.
Child processes that write large output to inherited stdout now send it to the client's stderr channel.
While serving, stdout is diverted to stderr.
The function now yields a 2-tuple, (read_stream, write_stream), instead of a 3-tuple that included the get_session_id callback.
The server lifespan now runs once when the session manager starts and shares its state across sessions and requests; move per-connection resource acquisition into handlers.
HTTP status failures now surface as per-request JSON-RPC errors raised as MCPError; the connection remains usable instead of failing pending requests through the transport context.
Streamable HTTP servers reject request bodies over 4 MiB with HTTP 413.
The streamablehttp_client alias is removed.
The deprecated function was removed; use streamable_http_client instead and configure headers, timeout, and auth on an httpx2.AsyncClient.
The deprecated function was removed; use streamable_http_client instead.
The timeout and sse_read_timeout fields now take float seconds instead of datetime.timedelta; an explicit timedelta fails model validation.
The headers, timeout, sse_read_timeout, and auth parameters were removed; configure them on an httpx2.AsyncClient instead.
The method that backed the removed session-ID callback was removed; event hooks can capture the session ID from response headers.
The transport attribute was removed; read the negotiated version from session.protocol_version or client.protocol_version.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Resource capabilities now report subscribe as true when an on_subscribe_resource handler is provided, which may change client behavior.
On 2026-07-28 connections, change notifications reach clients only through a
subscriptions/listenstream that requested them; bare standalone notifications are dropped.Synchronous tools, resources, prompts, and resolver functions now run on a worker thread; they can run concurrently, and asyncio.get_running_loop() raises inside them.
Synchronous tool, resource, prompt, and resolver functions now execute in worker threads, enabling concurrency but changing thread affinity and making asyncio.get_running_loop() fail inside them.
The TASK_REQUIRED, TASK_OPTIONAL, and TASK_FORBIDDEN constants were removed; task_support takes the plain required, optional, or forbidden literal.
TaskExecutionMode and TASK_* constants are removed; use string literals, with TaskStatus remaining as a literal-union type.
The function now requires the process to lead its own process group, spawned with start_new_session=True; the lookup and per-process fallback were removed.
The deprecated function was removed; process termination is handled internally by the stdio_client context manager.
The timeout_seconds argument was removed because Job Object termination is immediate and the value was never used.
DNS rebinding protection now auto-enables for loopback hosts when no transport_security is passed, including for app factories that default to 127.0.0.1; host allowlist matching can reject bare Host headers with 421.
The minimum typing-extensions version is raised to >=4.13.0.
Methods the receiver does not serve now receive JSON-RPC -32601 Method not found, with the method name in data, rather than -32602.
Protocol model fields use snake_case for Python attribute access; serialize with by_alias=True to retain camelCase wire keys.
Template matching now supports RFC 6570, matches literals and structural delimiters exactly, and lets simple {var} expressions match empty values.
Security 4
Controls whether to accept only tokens that the TokenVerifier reports as issued for this server.
New callback result object includes
code,state, andiss, enabling authorization-response issuer validation.OAuthAuthorizationServerProvider gained an overridable identity-assertion exchange method that rejects the grant by default.
OAuth adds RFC 9207 issuer validation.
Deprecations 8
When
resource_server_urlis set, leavingvalidate_token_resourceunset emits an MCPDeprecationWarning; set it toTrueorFalsebecause 3.0 defaults it toTrue.Constructing this provider without
issuer=emits an MCPDeprecationWarning; pass the authorization server's issuer URL because 3.0 will require it.Client.send_ping is deprecated and emits MCPDeprecationWarning when called; ping is removed in 2026-07-28.
Client-to-server progress notifications are deprecated and emit MCPDeprecationWarning; they continue working against servers negotiating 2025-11-25 or earlier.
Client resource-subscription methods are deprecated and emit MCPDeprecationWarning; on 2026-07-28 servers, use Client.listen() with resource_subscriptions instead.
Passing the on_progress constructor parameter is deprecated and emits MCPDeprecationWarning at construction time.
Sampling, roots, and logging user-facing methods are deprecated with type-checker and runtime warnings; they continue working for sessions negotiating 2025-11-25 and earlier.
Deprecated; use HANDSHAKE_PROTOCOL_VERSIONS when referring specifically to initialize-handshake versions.
New APIs and options 50
Adds an option to streamable_http_client and StreamableHttpParameters for setting the maximum SSE event size; pass None or raise it for larger tool results.
Setting subscriptions=False stops serving subscriptions/listen and advertises listChanged and subscribe as false.
Adds a way for a low-level server to supply a tool's schema for header validation without running its tools/list handler.
ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider accept an issuer URL, which is required in 3.0.
AssistantMessage is exported from mcp.server.mcpserver.
Prompt messages now accept Audio content.
Client accepts StdioServerParameters directly, so callers can pass stdio server parameters without constructing them separately.
Prompt messages now accept Image content.
MCPServer.sse_app() takes max_request_body_size to set the request body limit for the SSE app.
Message is exported from mcp.server.mcpserver.
SseServerTransport takes max_request_body_size to set the request body limit for the SSE transport.
UserMessage is exported from mcp.server.mcpserver.
OAuth adds the client-credentials extension.
Exported TypeAdapter for validating ClientNotification union values.
Exported TypeAdapter for validating ClientResult union values.
Use Client.listen() to receive resource subscription events on 2026-07-28 connections; it accepts a resource_subscriptions filter.
A new keyword-only dispatcher argument accepts a pre-built dispatcher, such as DirectDispatcher for in-process embedding.
The raw discover result is retained on the session after discover().
The raw initialize handshake result is retained on the session after initialize().
Server instructions are available as a property populated by initialize() or discover().
The negotiated protocol version is available as a property populated by initialize() or discover().
Negotiated server identity is available as a property populated by initialize() or discover().
Context.log() now accepts all eight RFC 5424 log levels via LoggingLevel.
ctx.report_progress works across dispatchers, sending a notification when a token is present and otherwise routing updates through the dispatcher's progress channel.
Servers and clients can compose protocol extensions through pluggable extension APIs, with MCP Apps built in.
The helper gained an optional client_grant_types parameter.
Exported tuple naming the protocol versions accepted during the initialize handshake.
Identity-assertion support can be enabled through AuthSettings or create_auth_routes.
InitializationOptions gained optional title and description fields.
Exported TypeAdapter for validating JSONRPCMessage values, including raw JSON.
Clientaccepts alog_levelargument that opts modern requests into log delivery;Noneis the default, and individual requests can override it throughmeta=.Protocol wire types are available as a standalone distribution for projects that need schema serialization without the full SDK.
Protocol wire types move to the standalone mcp-types distribution, while mcp.types remains a permanent alias when depending on the SDK.
Constructs an MCPError from an existing ErrorData value.
call_tool(), read_resource(), and get_prompt() accept an optional Context; direct calls without one construct a context with no active request.
Context is exported from mcp.server.mcpserver for annotating injected ctx parameters.
The constructor adds keyword-only resources, extensions, resource_security, request_state_security, cache_hints, subscriptions, and middleware parameters.
Added
application_typeto Dynamic Client Registration metadata, defaulting tonative; browser-based clients on non-local hosts should set it toweb.An optional callback was added to override the RFC 8707 resource check.
A Resolve parameter is filled by the function invisibly to the model and can put a question to the user, supporting multi-round-trip requests.
ResourceSecurity(exempt_params=...) exempts selected template parameters from the default path-safety checks.
OAuth adds the SEP-990 identity-assertion flow.
The 2026-07-28 protocol revision adds stateless requests with no handshake and server discovery.
Exported TypeAdapter for validating ServerNotification union values.
Exported TypeAdapter for validating ServerResult union values.
get_capabilities arguments are now optional, and the method gained an optional extensions argument.
The dispatcher-agnostic report_progress method is preferred over the raw token-taking notification method; it handles the no-op case when the caller did not request progress.
A new OAuth utility helper was added.
A new discovery and registration helper was added.
A new OAuth utility helper was added.
Performance 1
On Windows, stdio_client resolves the executable off the event loop.
Behavior and default changes 18
Client OpenTelemetry spans now record JSON-RPC error responses; in auto mode, a server without server/discover produces one ERROR span for the probe.
ctx: Context[AppState] now works on prompts and resource templates, not only on tools.
Request timeouts pause while redirect_handler and callback_handler wait for an interactive OAuth login; add a limit inside callback_handler if needed.
References resolve only within the tool's output schema; an unresolvable reference raises a RuntimeError identifying the invalid tool schema.
Prompt functions may return bare content blocks.
Pre-2026 sessions now accept boolean sub-schemas in tool schema properties.
Path-less
issuer_urlandresource_server_urlstrings preserve their empty path, so advertised issuer metadata retains the supplied form.Client negotiates the protocol version automatically.
Inbound server requests, notifications, and results are validated against the negotiated protocol schema before parsing into mcp.types models.
A captured session proxy remains usable after its handler returns for sends on the connection's standalone stream.
The required id field now accepts None, allowing validation of JSON-RPC error responses with a null id.
Cancelling an awaited request or timing out now sends a cancellation notification so the server can interrupt its handler.
When supported by server metadata and refresh tokens are enabled, the client adds
offline_accessto its requested scope and sendsprompt=consent.Trace propagation is enabled by default: servers install tracing middleware and clients open a span per outbound request; configured global providers record spans and outbound _meta receives traceparent.
request_id is now optional because notification handlers receive the context with request_id set to None.
The uri parameter now accepts str or AnyUrl.
The client now closes its pipe ends deterministically at shutdown, and failed writes to a running server surface as CONNECTION_CLOSED on the read side.
On an
insufficient_scopechallenge, re-authorization requests the union of previously requested scopes and newly challenged scopes.
Fixes and other changes 10
A progress_callback that raises no longer fails the call on an in-process Client(server).
Pre-2026 sessions ignore cache-hint fields from later revisions instead of failing list_tools().
mcp install reads and preserves Claude Desktop config containing non-ASCII text on any Windows code page.
On the 2026-07-28 HTTP entry, a POSTed notification such as notifications/cancelled is acknowledged with 202 instead of rejected with 400.
Recursive tool return types now get an object-rooted outputSchema accepted by pre-2026 clients.
Registration of TypedDict tool results no longer fails on Python 3.10.
Imports of mcp.server.fastmcp point to the migration guide, helping developers encountering the import error.
The SDK supports the 2026-07-28 protocol revision and serves earlier revisions from the same server.
Packages depending on mcp should keep a <2 upper bound until they have migrated to v2.
Resource capabilities now report subscribe: true when an on_subscribe_resource handler is registered.
mcp 178 changes
Breaking changes 7
Authorization server metadata is rejected when its issuer does not match the server it was fetched for; client registrations are remembered per issuer.
OAuth provider requests follow the same-origin redirect rule as MCP HTTP clients.
The request body limit now applies to the SSE and OAuth endpoints.
Recursive tool return types now receive an output schema rooted in an object.
Requests with unknown session IDs now return HTTP 404 instead of HTTP 400.
Adds streamable_http_client, which accepts an httpx.AsyncClient instead of httpx_client_factory.
The SDK requires Python 3.10 or later.
Security 4
MCP Python SDK: WebSocket server transport does not support Host/Origin validation
Experimental tasks are scoped to the session that created them.
Transport sessions are bound to the authenticated principal.
Implements URL mode elicitation for secure out-of-band interactions.
Deprecations 5
Setting resource_server_url without validate_token_resource emits a DeprecationWarning; set it to True or False.
Using the provider without issuer= emits a DeprecationWarning; pass the authorization server's issuer URL.
Emits a DeprecationWarning when called ahead of removal in v2; tasks were removed from the MCP specification and are expected to return as a separate extension.
The ClientSession keyword argument emits a DeprecationWarning when used ahead of removal in v2; tasks are expected to return as a separate MCP extension.
Emits a DeprecationWarning when called ahead of removal in v2; use the streamable HTTP transport instead.
New APIs and options 30
Accepts issuer= to specify the authorization server's issuer URL.
The WebSocket server transport now supports TransportSecuritySettings.
AccessToken now includes a claims field, allowing developers to access token claims.
AccessToken now includes a subject field, allowing developers to access the token subject.
Resource metadata is supported, allowing developers to provide metadata on resources.
ResourceTemplate metadata is supported, allowing developers to provide metadata on resource templates.
Adds client-side support for SEP-1577 sampling with tools.
Adds support for the client_credentials flow with JWT and Basic auth.
Adds client_secret_basic authentication support.
Adds backwards-compatible create_message overloads for SEP-1577.
Adds an on_session_created callback option.
Implements Sampling With Tools.
Adds SSE polling support.
Implements Tasks.
Adds URL-based client ID (CIMD) support.
Passes through and exposes additional parameters, giving developers more control when calling tools through ClientSessionGroup.
Passes through and exposes additional parameters, giving developers more control when connecting to a server through ClientSessionGroup.
Adds client_id_metadata_document_supported to OAuthMetadata.
Adds get_server_capabilities() to ClientSession.
Adds support for RFC 7523 JWT flows.
Exposes RequestParams._meta in ClientSession.call_tool.
Adds tool metadata support to the FastMCP.tool decorator.
The client supports OAuth scope selection and step-up authorization.
FastMCP supports annotations on resources.
Client and server capabilities support async/await.
The SDK adds a client API with automatic protocol negotiation, request timeouts, progress tracking, and typed exceptions.
The SDK implements the MCP protocol, including prompts, resources, tools, progress tracking, notifications, and logging.
The SDK adds decorator-based request handlers, capability negotiation, request context management, experimental capabilities, and automatic routing.
The SDK supports Server-Sent Events transport.
The SDK supports standard input/output transport for clients and servers.
Behavior and default changes 8
The FastMCP Settings model is completed at import time, affecting when its settings are available.
StreamableHTTP now buffers per-request streams and stores the priming event before dispatch.
StreamableHTTP sessions now have an idle timeout.
Implements tool name validation.
Implements SEP-985 OAuth Protected Resource Metadata discovery fallback.
JSON-only responses no longer require a particular Accept header.
Can be returned directly to support the _meta field for OpenAI Apps.
The first stable release provides a Python SDK with a complete implementation of the MCP specification.
Fixes and other changes 24
Routes Context.report_progress() to the originating request stream, so progress is sent on the stream associated with that request.
Rejects tool names with a trailing newline during validation.
Python 3.14 is now supported.
Null optional fields are omitted from task result payloads.
Empty-string optional URL fields are coerced to None.
Catches PydanticUserError when generating output schemas, fixing compatibility with Pydantic 2.13.
Handles ClosedResourceError when the transport closes during a request.
The OAuth client now validates resources according to RFC 8707.
The stdio server now handles non-UTF-8 bytes on stdin.
Adds the missing TasksCallCapability to the v1.x SDK.
Users who need to stay on v1.x should pin to mcp>=1.25,<2.
Fixes an issue with Url Elicitation.
Fixes matching of IDs in JSON-RPC error responses.
Resource validation now allows MIME type parameters in accordance with RFC 2045.
close_sse_stream is skipped for old protocol versions.
The StreamableHTTP message router now handles ClosedResourceError.
Priming events are skipped for old protocol versions.
Improves elicitation enum schemas and standards compliance.
Empty SSE data is skipped to avoid parsing errors.
Fixes OAuth scope handling on 401 responses.
Fixes OAuth discovery fallback and URL ordering.
The low-level server handles messages of type Exception.
List methods without a cursor send params as an empty object.
The server session initialization state is set immediately after responding.