В MCP C# SDK 2.0 параметр HTTP-сервера HttpServerTransportOptions.Stateless по умолчанию установлен в true. Как сообщает Microsoft, новая версия SDK реализует редакцию спецификации Model Context Protocol от 2026-07-28, которая делает работу без состояния настройкой протокола по умолчанию.[1][2][3]
Вместе с этим спецификация вводит Multi Round-Trip Requests (MRTR): механизм позволяет интерактивным инструментам запрашивать дополнительные данные без долгоживущей сессии. Сервер возвращает результат с запросом ввода, а клиент после получения данных повторяет вызов инструмента.[4][5][6]
В первой версии SDK HTTP-транспорт по умолчанию использовал сессии с сохранением состояния. Редакция спецификации от 2026-07-28 убирает первоначальный обмен initialize/initialized и заголовок Mcp-Session-Id. Вместо настройки, привязанной к соединению, версия протокола и сведения о возможностях передаются с каждым запросом.[3][7]
По словам Microsoft, в режиме без состояния любой экземпляр сервера может обработать любой запрос. На уровне протокола при этом не нужны ни закрепление клиента за конкретным сервером, ни общие хранилища сессий. Разработчики могут выбрать режим с сохранением состояния, если им нужны незапрошенные сообщения от сервера клиенту или транспортное состояние на уровне сессии.[8][9]
Новая редакция стандартизирует HTTP-заголовки, в том числе Mcp-Method и Mcp-Name. Например, они могут сопровождать вызов tools/call вместе с телом JSON-RPC, чтобы балансировщик нагрузки или прокси мог обрабатывать MCP-трафик без глубокой проверки пакетов. Если заголовок не совпадает с телом запроса, сервер отклоняет запрос с ошибкой HeaderMismatch: источником истины остаётся тело.[10][11]
В MRTR инструмент возвращает InputRequiredResult с resultType, равным input_required, одним или несколькими запросами ввода и непрозрачным блоком requestState. Клиент собирает запрошенные данные и снова вызывает тот же tools/call, передавая inputResponses и полученный requestState.[5][6]
Такой обмен может повторяться в нескольких раундах: непрерывность сохраняется за счёт данных в запросах, а не сессии. На стороне сервера инструмент может выбросить InputRequiredException, указав необходимые входные данные и строку requestState. Для создания запросов ввода предусмотрены методы ForElicitation, ForSampling и ForRootsList.[12][13][14]
It makes the protocol stateless by default, standardizes the HTTP surface so ordinary HTTP infrastructure can route MCP traffic, and introduces Multi Round-Trip Requests so interactive tools no longer require a long-lived session.
The SDK moves in lockstep with the spec: the HTTP server transport now runs statelessly by default. Where v1 configured stateful sessions out of the box, in v2 HttpServerTransportOptions.Stateless defaults to true.
Multi Round-Trip Requests (MRTR) is the resolution, and it’s the headline feature of the 2026-07-28 revision (SEP-2322). Instead of the server reaching back to the client over a session, the server returns a result that says, in effect, “I need something from you first.“
Concretely, a tool returns an InputRequiredResult (a result whose resultType is "input_required") carrying one or more input requests and an opaque requestState blob.
The client satisfies those inputs (prompting the user, calling its LLM, listing roots) and re-issues the same tools/call with the collected inputResponses and the echoed requestState.
The 2026-07-28 revision replaces that connection-scoped setup with self-contained requests: the initialize / initialized handshake is gone (SEP-2575), as is the Mcp-Session-Id header (SEP-2567), and the protocol version and capabilities now travel with each request.
The practical effect is that any server instance can handle any request, so the sticky sessions and shared session stores that horizontal deployments needed are no longer required at the protocol layer.
Statelessness is the default, not a mandate. If you genuinely need unsolicited server-to-client messages or session-scoped transport state, you can still opt into stateful mode.
The 2026-07-28 revision standardizes a small set of HTTP headers that mirror the fields intermediaries actually care about (SEP-2243). A tools/call now travels with Mcp-Method: tools/call and Mcp-Name: get_order_status alongside the JSON-RPC body, so a load balancer, proxy, gateway, WAF, or observability tool can act on MCP traffic without deep packet inspection.
The body is always the source of truth; if a header and the body disagree, the server rejects the request rather than guessing, returning a HeaderMismatch error.
On the server, you throw an InputRequiredException from your tool, passing the inputs you need and a requestState string that will be echoed back to you on the retry.
You build the individual requests with the factory methods InputRequest.ForElicitation(...), InputRequest.ForSampling(...), and InputRequest.ForRootsList(...).