fix(mcp): 2026-07-28 protocol conformance
What
Brings Sure's MCP 2026-07-28 (stateless) dialect in line with the spec. Split out of #3580 at @jjmata's suggestion, so the OAuth least-privilege change can ship without waiting on this.
Stacked on #3580: until that merges, this PR's diff also shows its commits. Only the last commit (fix(mcp): bring the 2026-07-28 dialect in line with the spec) is new here; the earlier ones restore the dialect code that #3580 no longer carries.
Changes (each backed by the spec text)
- Every request must carry
_meta["io.modelcontextprotocol/protocolVersion"]and["io.modelcontextprotocol/clientCapabilities"]; otherwise-32602,400(basic/index, per-request protocol fields). - A header/
_metaversion mismatch, or a missingMCP-Protocol-Versionheader, isHeaderMismatch-32020(was-32600). - An unsupported version is
-32022withdata.supportedanddata.requested(was-32600without data),400. - An unknown method in a modern request is
404with a-32601body; the legacy dialects still answer200. server/discoverreturnsttlMsandcacheScope, liketools/list.docs/hosting/mcp.mddocuments the above.
Testing
mcp_controller, oauth_metadata, oauth_registration, settings/mcp and test/models/assistant: 605 runs, 0 failures; i18n_test, rubocop and brakeman clean. Existing tests that pinned the old codes were updated, and new ones cover missing _meta, missing clientCapabilities, the 404, and a version only present in _meta.
Not covered: MCP Inspector / real-client end-to-end.
š¤ Generated with Claude Code