Repository navigation
Description
Prove that the packaged service follows the agreed MCP and OAuth contracts by testing HTTP requests and responses directly. This catches mistakes that a shared client and server library could hide. It is required for the launch in #2408.
Cover valid first requests, tool listing and calls, rejected protocol versions, malformed requests, and authorization failures. Also prove that an unauthenticated client can retrieve the metadata needed to begin OAuth sign-in. The MCP endpoint's GET restriction must leave metadata GET available.
This ticket is done when the checks pass against the packaged artifact and can be reused against the public deployment in #2634. The default smoke path should require no database writes. Implementation belongs to #2625 and #2642. Full client sign-in is tested in #2633.
Status on October 23, 2026
PR #2644 merged with the first raw HTTP test. PR #2659 grows McpProtocolTest to 33 protocol tests that check the 2026-07-28 wire contract over raw HTTP. With the framework set back to 2.0.3, 17 of them fail, so they depend on the upgrade in the same PR. Its unit suite passed 3,648 tests locally, and CI is still running the DSE and HCD suites. PRs #2648 and #2649 add HTTP coverage for logging and tool hints in the MCP stack, and draft PR #2657 covers Origin checks for #2630. The OAuth admission tests still depend on #2642.
Implementation requirements and source references
Tracking issue: #2408. Depends on #2624, #2625 and #2642.
Tracking correspondence: L2 packaged verification, H1/H6 protected-resource failures. Implementation owners are #2625 and #2642. Shared requirement IDs remain stable across the delivery plan and #2408.
Outcome
Test raw HTTP so a shared mistake in the framework client and server cannot hide a protocol failure. Scope is the existing tool surface under MCP 2026-07-28 minimum and OAuth-only authentication. Optional features stay unadvertised unless implemented.
Required matrix
- Valid server/discover, tools/list and tools/call as the first RPC, without initialize or a session. Discovery advertises exactly the allowed revisions and implemented capabilities. Check all pagination pages and deterministic tool order.
- Required
_metakeysio.modelcontextprotocol/protocolVersionandio.modelcontextprotocol/clientCapabilities. Omitted clientInfo works, malformed clientInfo fails. Verify optional/null tool arguments and serverInfo on results. - Required MCP-Protocol-Version and Mcp-Method, plus Mcp-Name for tools/call. Check header names case-insensitively, values with the specified comparison/encoding. Missing/malformed required headers or header/body mismatches produce HTTP 400 and -32020.
- Older revisions and unknown future revisions produce HTTP 400 and -32022 with requested/supported revisions. Unknown RPC methods with otherwise valid modern requests produce HTTP 404 and -32601. Do not use obsolete draft codes -32001/-32003/-32004 for the new standardized errors.
- Malformed JSON, absent body metadata, invalid arguments and unknown tools follow their distinct transport/schema/tools error contracts. Isolate one failure per test to avoid asserting an invented precedence between auth and parsing failures.
- All completed result objects have resultType complete, including tool errors with isError. JSON-RPC error envelopes are not result objects. Complete discovery and list results include ttlMs >= 0 and cacheScope. Verify private caching, page consistency and no cross-authorization leakage.
- GET/DELETE on the MCP RPC endpoint return the selected policy 405. Metadata GET remains available without credentials. No usable old HTTP+SSE/session route. Valid modern requests carrying obsolete Mcp-Session-Id or Last-Event-ID are processed without session creation or replay, as the detailed spec recommends. No SSE event IDs or resumability.
- A correctly formed initialize request is unsupported. An old initialize request with absent/old metadata may fail earlier at header/version validation. No legacy fallback is allowed.
- Missing/invalid/expired OAuth tokens produce 401. Insufficient scope or permission produces 403. Test wrong issuer, audience and tenant, an ID token, AstraCS bearer value and old Token/token/X-Cassandra-Token headers. Discovery metadata must still bootstrap authorization. Verify the protected-resource contract implemented in MCP: Add OAuth authentication and discovery #2642.
- MCP-disabled behavior exposes no protected catalog or execution. Feature-flag precedence remains explicit.
- Assert no advertised optional extension or removed methods, no unsolicited protocol log messages, and no server-initiated requests. If a capability is enabled later, add its positive and negative conformance cases.
Done when
Raw status, headers and JSON assertions pass against the packaged artifact and can be replayed through the edge in #2634. Tests reference the normative transport, discovery, caching and authorization sections. Include a fractional schema fixture and schema-reference/resource-bound checks where the implementation processes those constructs.
Reuse suitable work from #2591 and #2343. #2633 proves independent SDK/host interoperability. No database writes are required for the default smoke path.
Changelog traceability
- M1 Remove protocol sessions, lines 12 — Required.
- M2 Remove initialization, lines 14 — Required.
- M3 Implement server discovery, lines 16 — Required.
- M4 Use POST subscriptions for change events, lines 18 — Conditional.
- M5 Remove obsolete utility methods, lines 20 — Required.
- M6 Move tasks to an extension, lines 22 — No new feature.
- M7 Use multi round trip requests, lines 24 — Conditional.
- M8 Tag every successful RPC result, lines 26 — Required.
- M9 Remove stream redelivery, lines 28 — Required.
- m1 Advertise optional extensions, lines 32 — Required audit.
- m3 Return tools in stable order, lines 34 — Recommended.
- m4 Validate standard HTTP headers, lines 35 — Required.
- m5 Include cache hints, lines 36 — Required.
- m6 Correct resource not found errors, lines 37 — Conditional.
- m10 Support the current schema model, lines 49–52 — Required audit.
- m11 Remove old elicitation completion, lines 53–60 — No new feature.
- m12 Use final protocol error codes, lines 61–67 — Required.
- D2 Retire the old HTTP plus SSE transport, lines 82–85 — Required.
- S1 Preserve fractional schema numbers, lines 103 — Required regression.
Normative detail: Streamable HTTP, authorization, caching.
Resource discovery checks
Assert the metadata response, resource identity, issuer list and challenge URL implemented in #2642 against the packaged artifact. Test unauthenticated metadata GET separately from the MCP RPC endpoint's GET/DELETE 405 behavior. Export these cases for the deployed verification in #2634.
Use RFC 9728 and the MCP discovery requirements for the assertions. #2633 owns client fallback sequences and rejection of mismatched metadata.
Activity
[-]Add raw HTTP contract tests for MCP 2026-07-28[/-][+]MCP: Add raw HTTP contract tests for 2026-07-28[/+][-]MCP: Add raw HTTP contract tests for 2026-07-28[/-][+]MCP: Verify the upgraded HTTP protocol[/+][-]MCP: Verify the upgraded HTTP protocol[/-][+]MCP: Verify packaged HTTP protocol and auth conformance[/+][-]MCP: Verify packaged HTTP protocol and auth conformance[/-][+]MCP: Test protocol and OAuth behavior over HTTP[/+]