• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 29580692030

17 Jul 2026 12:34PM UTC coverage: 68.542% (+0.09%) from 68.454%
29580692030

push

github

web-flow
Add MCP 2026-07-28 revision classification and method vocabulary (#5834)

* Add MCP revision classifier for 2026-07-28

Foundation for serving the stateless MCP 2026-07-28 ("Modern") revision
alongside the current 2025-11-25 ("Legacy") revision on one endpoint
(part of #5755 / RFC THV-0081). No behavior change: ClassifyRevision is
a pure function called from nowhere yet — it is wired into proxy routing
by later slices.

Classification is validation, not key-sniffing. Any Modern signal (a
reserved io.modelcontextprotocol/* _meta key, or an exact 2026-07-28
MCP-Protocol-Version header) forces a valid-or-error outcome so a client
cannot dodge Modern enforcement by sending broken metadata: absent or
malformed protocolVersion, an unsupported version, a header/body
mismatch, or missing clientCapabilities each reject rather than downgrade
to the more permissive Legacy path. method == "initialize" is
unconditionally Legacy, guarding a spoofed Modern _meta on a Legacy call.

The draft-schema error codes (-32020/-32021/-32022) are defined as local
consts: the go-sdk keeps its equivalents unexported even at 2026-07-28,
so the upcoming 1.7 bump does not change this file.

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

* Add Modern MCP parser vocabulary

Teach the request parser the 2026-07-28 ("Modern") vocabulary so the
authz/audit/telemetry middleware chain can see it (part of #5755 / RFC
THV-0081). No behavior change: the new fields are only captured, never
consumed yet, and a Legacy request parses byte-identically.

Capture the Mcp-Method and Mcp-Name request headers, surface per-request
clientInfo and protocolVersion from _meta, register server/discover in
the resource-ID table, and add context getters for the new fields.
Mcp-Name is stored raw: its value may be sentinel-encoded (=?base64?..?=)
and the decode-then-compare against the plain body name/uri belongs at
the future validation site, not here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthr... (continued)

95 of 113 new or added lines in 3 files covered. (84.07%)

10 existing lines in 4 files now uncovered.

74584 of 108815 relevant lines covered (68.54%)

65.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.56
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc