Skip to content

WIP feat: serve 2026-07-28 requests (T8) - #274

Draft
sideeffffect wants to merge 6 commits into
softwaremill:2026-07-28-protocol-supportfrom
sideeffffect:feat/t8-serve-requests
Draft

sideeffffect wants to merge 6 commits into
softwaremill:2026-07-28-protocol-supportfrom
sideeffffect:feat/t8-serve-requests

Conversation

@sideeffffect

@sideeffffect sideeffffect commented Sep 23, 2026

Copy link
Copy Markdown

WIP. Stacked on #276 (T5) → #275 (T7) → #273 (T6) → #271 (T3). Until those merge this PR's diff also shows their changes — review the T8 delta only: sideeffffect/chimp@feat/t5-mrtr-types...feat/t8-serve-requests

T8 — #246: serve 2026-07-28 requests

Core (server/discover, -32022, modern-result envelope) landed in #260. This PR adds the modern request validation and HTTP error statuses:

  • -32602 when a modern request omits _meta.protocolVersion or _meta.clientCapabilities
  • -32020 header/_meta version mismatch
  • validation errors → HTTP 400; removed (initialize, ping, logging/setLevel, resources/{,un}subscribe) and unknown modern methods → -32601 HTTP 404
  • streaming HTTP transport returns validation errors as plain errors with their own status (not a 200 SSE stream)
  • SEP-2243 Mcp-Method / Mcp-Name header validation (HTTP only)
  • notifications/message gated by the request's _meta.logLevel
  • expose request facts (version, client capabilities/info, log level) to handlers via server context
  • -32021 MissingRequiredClientCapability check + fixtures test_missing_capability / test_logging_tool
  • subscription serving (subscriptions/listen, acknowledged notification, notification filter) using the T6 types from WIP feat: subscription types (T6) #273

Server conformance 2026-07-28: 100 → 111 checks passing, no regressions; http-header-validation primary variant 9/9. server-stateless also needs the T5 MRTR types (#276) and the subscription serving above; http-custom-header-server-validation needs the x-mcp-header tool feature.

Stack (bottom → top, all on 2026-07-28-protocol-support)

#271 (T3) → #273 (T6) → #275 (T7) → #276 (T5) → #274 (T8, this PR)

🤖 Generated with Claude Code

sideeffffect and others added 3 commits September 22, 2026 17:47
…ue T8 (softwaremill#246)

T3 (softwaremill#241): run client and server conformance at both 2025-11-25 and
2026-07-28 in CI (4 steps). Rename conformance-baseline.yml to
conformance-baseline-2025-11-25.yml and add a client section to
conformance-baseline-2026-07-28.yml (37 server, 37 client scenarios still
failing, all needing later tickets). Both conformance tasks select the
per-spec-version baseline from --requirements / --spec-version. Update both
conformance READMEs with the two-revision and single-scenario commands.

T8 (softwaremill#246): the modern-result envelope, server/discover and -32022 validation
landed in softwaremill#260 (already on this base). Remaining server rules (-32602 missing
_meta, -32020 header/_meta mismatch, HTTP 400/404 plain-JSON, notifications
gating, server-context request facts, the test_missing_capability /
test_logging_tool fixtures) are the WIP continuation tracked by this PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the 2026-07-28 subscription datatypes and their schema conformance tests:
SubscriptionFilter, SubscriptionsListenParams/Request, SubscriptionsListenResult,
SubscriptionsAcknowledgedParams and the acknowledged-notification wrapper. Add the
reserved _meta key io.modelcontextprotocol/subscriptionId. Types only — serving is T8.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
)

Add the 2026-07-28 shared metadata:
- new Icon and Annotations types
- icons on Implementation, ToolDefinition, Resource, ResourceTemplate, Prompt, ResourceLink
- annotations and _meta on content blocks (Text/Image/Audio/ResourceContent) and Resource/ResourceTemplate
- Implementation.websiteUrl/description, PromptReference.title, ResourceLink.title/size
- server DSL builders (icons/annotations) on the resource, resource-template and prompt builders
- schema conformance tests for the new fields against the 2026-07-28 schema

All additive (optional, default None) so the 2025-11-25 wire is unchanged. Tool-builder
`.icons(...)` deferred (threads through the multi-step Tool[I,O] chain); ToolDefinition
still carries icons at the protocol level.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sideeffffect and others added 3 commits September 23, 2026 20:03
…ange

The mdoc client examples/quickstart matched ToolContent.Text with two
patterns; T7 added annotations and _meta. Switch to a type pattern so
the snippets survive further field additions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the 2026-07-28 multi-round-trip request types:

- InputRequest / InputResponse enums (sampling, roots, elicitation),
  discriminated by method / structural fields.
- InputRequiredResult carrying pending InputRequests plus requestState
  and the modern result envelope (resultType defaults to incomplete).
- ResultType gains the `incomplete` case.
- ElicitParams becomes an enum with Form and Url variants (mode
  distinguishes them; optional on Form for 2025-11-25 back-compat).
- CallToolParams / GetPromptParams / ReadResourceParams carry
  inputResponses and requestState so clients can resume a paused call.

Schema conformance tests for the new modern defs; client-conformance
elicitation handler updated for the ElicitParams enum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mill#246)

Enforce the 2026-07-28 request rules in McpHandler and surface them with the
right HTTP status:
- missing _meta.protocolVersion / _meta.clientCapabilities -> -32602, HTTP 400
- MCP-Protocol-Version header vs _meta mismatch -> -32020 HeaderMismatch, 400
- unsupported declared version -> -32022, 400
- removed (initialize, ping, logging/setLevel, resources/{,un}subscribe) and
  unknown methods in the modern era -> -32601, HTTP 404
- SEP-2243 standard request headers: Mcp-Method must equal the body method and,
  for tools/call, Mcp-Name must equal params.name (HTTP only, via the Host header)

McpResponse gains a JsonError(status, json) case; the streaming HTTP transport
now validates the request before opening a stream and returns modern validation
errors as plain errors with their own status instead of a 200 SSE stream.
Add JSONRPCErrorCodes HeaderMismatch (-32020) and MissingRequiredClientCapability
(-32021). Server conformance 2026-07-28: 100 -> 111 checks passing, no regressions.

Still open on softwaremill#246: notifications/message logLevel gating, request facts via
server context, and the -32021 capability check with the test_missing_capability /
test_logging_tool fixtures.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant