Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ server:
- input-required-result-capability-check
# SEP-2549 (caching): no ttlMs/cacheScope support.
- caching
# SEP-2243 (HTTP header standardization): -32001 HeaderMismatch handling and
# SEP-2243 (HTTP header standardization): -32020 HeaderMismatch handling and
# case-insensitive/whitespace-trimmed header validation not implemented.
- http-header-validation
- http-custom-header-server-validation
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/conformance/expected-failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ server:
# SEP-2549 (caching): no ttlMs/cacheScope support; scenario also hits the
# stateful-mode "Missing session ID" error.
- caching
# SEP-2243 (HTTP header standardization): -32001 HeaderMismatch handling and
# SEP-2243 (HTTP header standardization): -32020 HeaderMismatch handling and
# case-insensitive/whitespace-trimmed header validation not implemented.
- http-header-validation
- http-custom-header-server-validation
Expand Down
167 changes: 97 additions & 70 deletions schema/2026-07-28.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions schema/PINNED.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"protocol_version": "2026-07-28",
"source_path_in_spec_repo": "schema/draft/schema.json",
"spec_commit": "6d441518de8a9d5adbab0b10a76a667a63f90665",
"sha256": "bce2e7c9622bb0b449475ba6d8d80228c71190a09250e75dabd502b280ecf3cb"
"spec_commit": "2852f30e26ca5fb779565741ec042094cb110abd",
"sha256": "ed1ad4ba94aaeb2068b78969ef901b1150f7b2f06cf86472b3032abee1380b6a"
}
]
4 changes: 3 additions & 1 deletion scripts/gen_surface_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
# reuses class names across versions for unrelated schemas (e.g. `Data`).
OPEN_CLASSES: dict[str, frozenset[str]] = {
"2025-11-25": frozenset({"Meta", "InputSchema", "OutputSchema", "Result", "GetTaskPayloadResult", "Data"}),
"2026-07-28": frozenset({"MetaObject", "RequestMetaObject", "InputSchema", "OutputSchema", "Result"}),
"2026-07-28": frozenset(
{"MetaObject", "NotificationMetaObject", "RequestMetaObject", "InputSchema", "OutputSchema", "Result"}
),
}

# Hand-written union aliases the wire-method maps reference by value; the schema
Expand Down
2 changes: 2 additions & 0 deletions src/mcp/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
# Re-export JSONRPC types
from mcp.types.jsonrpc import (
CONNECTION_CLOSED,
HEADER_MISMATCH,
INTERNAL_ERROR,
INVALID_PARAMS,
INVALID_REQUEST,
Expand Down Expand Up @@ -423,6 +424,7 @@
"server_result_adapter",
# JSON-RPC types
"CONNECTION_CLOSED",
"HEADER_MISMATCH",
"INTERNAL_ERROR",
"INVALID_PARAMS",
"INVALID_REQUEST",
Expand Down
4 changes: 2 additions & 2 deletions src/mcp/types/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class ClientCapabilities(MCPModel):


class UnsupportedProtocolVersionErrorData(MCPModel):
"""Error data for the -32004 unsupported-protocol-version error (2026-07-28)."""
"""Error data for the -32022 unsupported-protocol-version error (2026-07-28)."""

supported: list[str]
"""Protocol versions the server supports; the client should pick one and retry."""
Expand All @@ -406,7 +406,7 @@ class UnsupportedProtocolVersionErrorData(MCPModel):


class MissingRequiredClientCapabilityErrorData(MCPModel):
"""Error data for the -32003 missing-required-client-capability error (2026-07-28)."""
"""Error data for the -32021 missing-required-client-capability error (2026-07-28)."""

required_capabilities: ClientCapabilities
"""The capabilities the server requires from the client to process this request."""
Expand Down
23 changes: 15 additions & 8 deletions src/mcp/types/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,26 @@ class JSONRPCResponse(BaseModel):
result: dict[str, Any]


# MCP-specific error codes in the range [-32000, -32099]
URL_ELICITATION_REQUIRED = -32042
"""A URL-mode elicitation is required before the request can be processed (protocol 2025-11-25 only)."""
# MCP error codes occupy the JSON-RPC server-error range -32000..-32099.
# Per the 2026-07-28 spec's allocation policy:
# -32000..-32019 implementation-defined
# -32020..-32099 reserved for spec-defined codes, allocated sequentially from -32020
# -32002, -32042 reserved-never-reused (retired by earlier protocol versions)

HEADER_MISMATCH = -32020
"""HTTP headers do not match the request body, or required headers are missing/malformed (protocol 2026-07-28)."""

MISSING_REQUIRED_CLIENT_CAPABILITY = -32003
MISSING_REQUIRED_CLIENT_CAPABILITY = -32021
"""The server requires a client capability the request did not declare (protocol 2026-07-28)."""

UNSUPPORTED_PROTOCOL_VERSION = -32004
UNSUPPORTED_PROTOCOL_VERSION = -32022
"""The request's protocol version is not supported by the server (protocol 2026-07-28)."""

# SDK error codes: SDK-internal allocations in the JSON-RPC server-error range
# [-32000, -32099]; not defined by the MCP schema. New values must avoid codes
# the spec has allocated above.
URL_ELICITATION_REQUIRED = -32042
"""A URL-mode elicitation is required before the request can be processed (protocol 2025-11-25 only)."""

# SDK error codes: SDK-internal allocations in the implementation-defined band
# -32000..-32019; not defined by the MCP schema.
CONNECTION_CLOSED = -32000
"""SDK-only: the connection closed before a response arrived; never emitted on the wire."""

Expand Down
6 changes: 2 additions & 4 deletions src/mcp/types/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@
("notifications/initialized", "2025-11-25"): v2025.InitializedNotification,
("notifications/progress", "2025-11-25"): v2025.ProgressNotification,
("notifications/roots/list_changed", "2025-11-25"): v2025.RootsListChangedNotification,
# 2026-07-28 (initialized and roots/list_changed removed)
# 2026-07-28 (initialized, progress and roots/list_changed removed)
("notifications/cancelled", "2026-07-28"): v2026.CancelledNotification,
("notifications/progress", "2026-07-28"): v2026.ProgressNotification,
}
)

Expand Down Expand Up @@ -212,9 +211,8 @@
("notifications/resources/list_changed", "2025-11-25"): v2025.ResourceListChangedNotification,
("notifications/resources/updated", "2025-11-25"): v2025.ResourceUpdatedNotification,
("notifications/tools/list_changed", "2025-11-25"): v2025.ToolListChangedNotification,
# 2026-07-28 (adds subscriptions/acknowledged)
# 2026-07-28 (adds subscriptions/acknowledged; elicitation/complete removed)
("notifications/cancelled", "2026-07-28"): v2026.CancelledNotification,
("notifications/elicitation/complete", "2026-07-28"): v2026.ElicitationCompleteNotification,
("notifications/message", "2026-07-28"): v2026.LoggingMessageNotification,
("notifications/progress", "2026-07-28"): v2026.ProgressNotification,
("notifications/prompts/list_changed", "2026-07-28"): v2026.PromptListChangedNotification,
Expand Down
Loading
Loading