# MCP protocol revision 2026-07-28

**Last updated:** 2026-11-27T14:16:11-03:00 (UTC-3)

MCP revision **2026-07-28** makes the protocol stateless: there is no `initialize` handshake and no session; every request carries its protocol version and client capabilities in `_meta`, Streamable HTTP mirrors the method, tool name and selected arguments into headers, and `server/discover` replaces `initialize` as the up-front probe. Behind one operator flag the gateway speaks it in all three of its MCP roles, beside **2025-11-25**:

- as a **server** on the [MCP ingress](/docs/features/mcp-ingress/) (`/v1/mcp/servers/{id}/mcp`) and [composition](/docs/features/mcp-composition/) (`/v1/mcp`): dual-era, serving stateless 2026-07-28 requests and 2025-11-25 sessions on the same endpoint;
- as a **client** of upstream MCP servers ([execution](/docs/features/mcp-execution/), health checks, the console **Test** of a managed server): 2025-11-25, 2026-07-28 or `auto`, per server;
- in **composition**, where each composed call goes to its own server with that server's revision.

| Flag | Default | What it turns on |
| --- | --- | --- |
| `mcp_protocol_2026_07_28` | `false` | The dual-era ingress and the upstream policy below; an operator control; requires `mcp_execution` |

With the flag off nothing changes: the ingress serves 2025-11-25 only and every upstream is spoken to with 2025-11-25, whatever the configuration says.

## Configuration

| Key | Default | Values | Meaning |
| --- | --- | --- | --- |
| `mcp_execution.protocol_version` | `2025-11-25` (required when MCP execution is configured) | `2025-11-25`, `2026-07-28`, `auto` | Revision spoken to upstream servers while the flag is on |
| `mcp_execution.servers[].protocol_version` | empty (inherit) | `2025-11-25`, `2026-07-28`, `auto` | Override for one boot server |
| `mcp_execution.ingress.protocol_versions` | both | a subset of `2025-11-25`, `2026-07-28`, distinct, nonempty | Revisions the ingress serves while the flag is on |

All three are boot configuration (restart to change). Console-managed servers use `mcp_execution.protocol_version`. The admin configuration (`GET /api/v1/admin/config`) returns the effective values read-only as `mcp_protocol` (`enabled`, `ingress_versions`, `upstream_default`, `upstream_servers`), and the console shows them on the **MCP registry** page (ingress panel and each server's health line).

```yaml
features:
  mcp_execution: true
  mcp_protocol_2026_07_28: true
mcp_execution:
  protocol_version: auto
  ingress:
    protocol_versions: ["2025-11-25", "2026-07-28"]
  servers:
    - id: tickets
      endpoint_url: https://tickets.example.com/mcp
      protocol_version: "2026-07-28"   # never fall back for this server
      tools: [{name: lookup, allowed_team_ids: [support]}]
```

## Negotiation toward upstream servers

| Policy | First request | Outcome |
| --- | --- | --- |
| `2025-11-25` | `initialize` | The 2025-11-25 session, as before |
| `2026-07-28` | `server/discover` at 2026-07-28 | Stateless when the server lists 2026-07-28; otherwise the operation fails with `mcp_upstream_protocol_version` (502) and nothing is downgraded |
| `auto` | `server/discover` at 2026-07-28 | Stateless when the server lists 2026-07-28. 2025-11-25 is used only when the server is legacy-era (its answer, JSON or SSE, is not a 2026-07-28 JSON-RPC error: a 4xx, or a JSON-RPC error such as `-32601`) or when a modern server lists 2025-11-25 and no 2026-07-28; a `-32022` that lists 2026-07-28 is refused as contradictory |

The downgrade is never silent:

- each `auto` fallback logs `mcp_protocol_fallback` with the reason (`legacy_server` or `server_advertised`) and counts `gateway_mcp_protocol_negotiations_total{side="upstream",version="2025-11-25",fallback="legacy_server"}`;
- the negotiated revision is in every REST answer (`upstream_protocol_version`, beside the unchanged `protocol_version: "2025-11-25"` profile of the answer), in the execution record, in the health result (`protocol_version`, `protocol_fallback`) and in the managed **Test** answer;
- a modern server that refuses the probe for another reason (`-32020` header mismatch, `-32021` missing capability) or a refused credential (401/403) is an error, never a fallback.

Pin a server to `2026-07-28` when it must never be spoken to with the older revision. A fallback is decided per operation: the gateway keeps no memory of an earlier negotiation, so an `auto` server that later answers as a legacy server is used with 2025-11-25 (and logged).

On a stateless session the gateway sends `MCP-Protocol-Version: 2026-07-28` and `Mcp-Method` on every POST, `Mcp-Name` on `tools/call`, the `_meta` protocol fields (`protocolVersion`, `clientInfo`, empty `clientCapabilities`, and `traceparent`), never `Mcp-Session-Id`, never `DELETE`, and never `notifications/cancelled` (closing the request is the cancellation).

## The ingress as a 2026-07-28 server

A POST is served statelessly when its `params._meta` names `io.modelcontextprotocol/protocolVersion`, or when it has no `Mcp-Session-Id` and no `MCP-Protocol-Version: 2025-11-25` and is not `initialize`. Everything else keeps the 2025-11-25 behavior described in [MCP ingress](/docs/features/mcp-ingress/).

| Check, in order | Failure |
| --- | --- |
| `_meta` has `io.modelcontextprotocol/protocolVersion` and an object `io.modelcontextprotocol/clientCapabilities` | 400, `-32602` |
| One `MCP-Protocol-Version` header equal to that version | 400, `-32020` (HeaderMismatch) |
| The version is 2026-07-28 and `protocol_versions` lists it | 400, `-32022` with `data.supported` and `data.requested` |
| One `Mcp-Method` header equal to the method | 400, `-32020` |
| `tools/call`: one `Mcp-Name` equal to `params.name` (Base64 sentinel decoded) | 400, `-32020` |
| `tools/call`: every `Mcp-Param-{Name}` the tool's `x-mcp-header` annotations require, equal to the argument (an integer as a canonical decimal, no sign, exponent or leading zero), and none for an absent argument | 400, `-32020`; nothing is sent upstream |

| Method | Answer |
| --- | --- |
| `server/discover` | `supportedVersions` (the served revisions, newest first), `capabilities.tools.listChanged: false`, `instructions`, `ttlMs: 0`, `cacheScope: "private"` |
| `tools/list` | The tools the key may run, exactly as the session listing, plus `resultType: "complete"`, `ttlMs: 0`, `cacheScope: "private"` (tools are filtered per key) |
| `tools/call` | The tool result with `resultType: "complete"`; never retried; `Idempotency-Key` honored as on REST |
| anything else (`ping`, `logging/setLevel`, `subscriptions/listen`, resources, prompts) | 404, `-32601` |

Every result carries `_meta["io.modelcontextprotocol/serverInfo"]`. The gateway's own error codes move out of the JSON-RPC reserved range for this revision: `-31001` (refused before sending) and `-31002` (server unavailable) replace `-32001` and `-32002`; `-32602`, `-32603` and `-32800` keep their meaning. A notification gets 202 and is ignored; a client response is refused (400).

No session row is created. Each request is authenticated (live key, scopes, plan rights), authorized and audited on its own; the [execution record](/docs/features/mcp-execution-audit/) has `protocol_version: "2026-07-28"` and no `session_id`. A composed listing's `nextCursor` is bound to the key instead of a session. Closing the connection cancels an in-flight call (recorded uncertain once sent), on any replica.

When the flag is on and `protocol_versions` lists only 2026-07-28, `initialize` and session messages answer 400 with `-32022` naming the served revision, so a 2025-11-25 client can tell its user why.

```http
POST /v1/mcp/servers/tickets/mcp HTTP/1.1
Authorization: Bearer <gateway key with mcp:read and mcp:execute>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: lookup

{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"lookup","arguments":{"city":"Lisbon"},
 "_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}
```

```json
{"jsonrpc":"2.0","id":7,"result":{"resultType":"complete","content":[{"type":"text","text":"..."}],
 "_meta":{"io.modelcontextprotocol/serverInfo":{"name":"ai-gateway","title":"m7gtw","version":"1"}}}}
```

## Change list of the revision

Each change of 2026-07-28 against 2025-11-25 and what the gateway does with it.

| Change | Status |
| --- | --- |
| Sessions and `Mcp-Session-Id` removed from Streamable HTTP | Implemented: no session on either side; a stray session header is ignored |
| `initialize`/`notifications/initialized` removed; version and capabilities per request in `_meta` | Implemented on both sides; dual-era keeps `initialize` for 2025-11-25 |
| `server/discover` (servers MUST implement) | Implemented: served by the ingress, sent by the client as its probe |
| `UnsupportedProtocolVersionError` (`-32022`, `data.supported`) | Implemented: returned by the ingress, read by the client to choose or refuse |
| HTTP GET stream and `resources/subscribe` replaced by `subscriptions/listen` | Not applicable: tools only, `listChanged: false`; the ingress answers `-32601` |
| `ping`, `logging/setLevel`, `notifications/roots/list_changed` removed; log level per request | Implemented as removal: `-32601` on the stateless path; the gateway never sends a log level, so no server log messages are requested |
| Tasks moved to the `io.modelcontextprotocol/tasks` extension | Not applicable: no tasks capability is advertised or used |
| Multi round-trip requests (`InputRequiredResult`) replace server-initiated requests | Not adopted: the gateway answers no elicitation, sampling or roots; an `input_required` result fails the call with `mcp_upstream_input_required` |
| Required `resultType` (absent means complete for older servers) | Implemented: added to every stateless ingress result; the client accepts `complete` or absent, refuses unknown values |
| SSE resumability and `Last-Event-ID` removed | Implemented: the gateway never resumes; the ingress answers JSON |
| `extensions` in capabilities | Not adopted: no extension is offered or requested (empty capabilities) |
| OpenTelemetry trace context in `_meta` | Implemented: the client sends `traceparent` in `_meta` as well as the header |
| Deterministic `tools/list` order | Implemented: the composed listing is sorted by name; a single server's listing keeps the server's order |
| `Mcp-Method`/`Mcp-Name` headers and `x-mcp-header` → `Mcp-Param-*` | Implemented on both sides, including the Base64 sentinel, rejection of invalid annotations (the tool is listed as unsupported for review) and the integer bound |
| `ttlMs`/`cacheScope` on cacheable results | Implemented on the ingress (`0`, `private`); the client accepts and ignores them (no listing is cached beyond one operation) |
| Resource-not-found code `-32002` → `-32602` | Not applicable (no resources); the ingress emits no `-32002` on the stateless path |
| RFC 9207 `iss` in authorization responses | Implemented for per-user OAuth, on both revisions: a present `iss` must equal the recorded issuer, and must be present when the server advertises `authorization_response_iss_parameter_supported` |
| `application_type` in dynamic client registration | Implemented: `web` |
| Client credentials keyed by issuer | Already implemented: dynamic clients are stored per server and issuer |
| Looser `inputSchema`/`outputSchema` (any JSON Schema 2020-12) and `$ref` rules | Not adopted: the gateway keeps its closed, validated schema profile; tools outside it are listed as unsupported, never called; no `$ref` is ever dereferenced |
| `notifications/elicitation/complete` and `elicitationId` removed | Not applicable: no elicitation |
| Error code partition (`-32020`…`-32022`, no new codes in `-32000`…`-32019`) | Implemented on the stateless path (gateway codes `-31001`, `-31002`) |
| Roots, Sampling, Logging, HTTP+SSE and dynamic registration deprecated | Not applicable or unchanged: none of the first four is used; dynamic registration remains the fallback when no client is pre-registered |

## Interoperability evidence

Local conformance tests run against fake servers and clients of both revisions (`internal/mcpclient/modern_test.go`, `internal/gateway/mcp_protocol_2026_test.go`). The official MCP Python SDK `mcp` 2.3.0, which negotiates 2026-07-28, is exercised by two opt-in tests outside the hermetic gate, with `GATEWAY_MCP_SDK_PYTHON_2026` naming a Python that has it: `TestMCPIngressOfficialSDK2026` (the SDK client in `auto` mode gets 2026-07-28 statelessly, mirrors the `x-mcp-header` parameter and calls through; in `legacy` mode it gets a 2025-11-25 session) and `TestMCPUpstreamOfficialSDK2026` (the gateway as a client of an SDK server, with `auto`, `2026-07-28` and `2025-11-25`).

## Upgrade

Migration 188 adds `protocol_version` and `upstream_protocol_version` (empty by default) to `gateway_mcp_executions`; older rows read as empty. An older binary rejects the flag name and the new values in YAML: remove them before rolling back. Turn the flag on only after every replica runs this release, or a stateless request reaching an older replica is refused as a session message without `Mcp-Session-Id`.
