Skip to content

mcpcompat: export MetaKeyServerInfo and refresh go-sdk comments - #452

Merged
jhrozek merged 2 commits into
mainfrom
mcpcompat-meta-comments
Nov 3, 2026
Merged

jhrozek merged 2 commits into
mainfrom
mcpcompat-meta-comments

Conversation

@jhrozek

@jhrozek jhrozek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Export mcp.MetaKeyServerInfo from mcpcompat/mcp as an alias of the go-sdk constant, with a test that the shim value equals the SDK value. This is additive, with no wire or negotiation change and no dependency upgrade.
  • Correct the mcpcompat/client/errorbody.go comment. go-sdk v1.8 already decodes JSON-RPC error bodies; capture is still needed for plain-text bodies, the numeric HTTP status, and WWW-Authenticate headers.
  • Remove stale "v1.7" qualifiers from test comments. Runtime behavior is unchanged.

Follow-ups (ToolHive)

Test plan

  • go build ./mcpcompat/...
  • go test -race -run TestMetaKeyServerInfo ./mcpcompat/mcp/

🤖 Generated with Claude Code

jhrozek and others added 2 commits November 3, 2026 11:38
Why:
ToolHive copies the standard server-info metadata key into its Modern
response builder because the compatibility package does not export it.
A shared export removes that duplicated protocol vocabulary without
requiring a direct SDK import in ToolHive.

How:
Export MetaKeyServerInfo as the existing go-sdk constant. Add an external
package test checking that the shim export equals the SDK value; this does
not independently pin the protocol literal.

Behavior and limits:
This is an additive API with no wire or negotiation change. It adds an SDK
import to the compatibility data-types package, but no dependency upgrade.
The key does not populate server information or construct Modern envelopes.

ToolHive follow-up:
After adopting a core release, remove modernServerInfoKey and use this
export for metadata maps. Keep the literal Go struct tag and add an
explicit wire-key/server-identity assertion to guard both representations.

Co-authored-by: Mecatl <[email protected]>
Why:
The error-capture explanation incorrectly says the SDK discards all
non-2xx response bodies. go-sdk v1.8 already decodes JSON-RPC errors.
Discovery comments should describe current behavior without implying
that v1.7 is still the pinned release.

How:
Explain why plain-text bodies, numeric status, and WWW-Authenticate still
require capture. Remove stale version qualifiers while preserving the
historical explanations of when discover-first behavior was introduced.

Behavior and limits:
Runtime behavior is unchanged. SDK v1.8 was already pinned before this
commit; this change neither enables error decoding nor makes the capture
and error-classification machinery redundant.

ToolHive follow-up:
Validate the companion protocol-status corrections with real client
integration tests: preserve RPC errors, distinguish method-not-found from
session termination, retain auth challenges, and allow subsequent requests.
Those runtime changes do not depend on this documentation commit.

Co-authored-by: Mecatl <[email protected]>
@jhrozek
jhrozek merged commit cf36792 into main Nov 3, 2026
6 checks passed
@jhrozek
jhrozek deleted the mcpcompat-meta-comments branch November 3, 2026 20:18
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.

2 participants