Repository navigation
mcpcompat: export MetaKeyServerInfo and refresh go-sdk comments - #452
Merged
Merged
Conversation
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]>
reyortiz3
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp.MetaKeyServerInfofrommcpcompat/mcpas 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.mcpcompat/client/errorbody.gocomment. go-sdk v1.8 already decodes JSON-RPC error bodies; capture is still needed for plain-text bodies, the numeric HTTP status, andWWW-Authenticateheaders.Follow-ups (ToolHive)
MetaKeyServerInfoafter the next core release and removemodernServerInfoKeyTest plan
go build ./mcpcompat/...go test -race -run TestMetaKeyServerInfo ./mcpcompat/mcp/🤖 Generated with Claude Code