fix(mcp): init request w/o client info does not panic#844
Merged
nader-ziada merged 1 commit intocontainers:mainfrom Feb 27, 2026
Merged
fix(mcp): init request w/o client info does not panic#844nader-ziada merged 1 commit intocontainers:mainfrom
nader-ziada merged 1 commit intocontainers:mainfrom
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Collaborator
Author
|
@chenrui333 does this fix the panic you were seeing? |
Member
|
Thx for fixing this so quickly 🙌
Most MCP Hosts -> Clients should take care of this automatically. Since v0.0.58 was just released, we'll definitely see other reports if this requires further attention. |
manusa
added a commit
to marcnuri-forks/kubernetes-mcp-server
that referenced
this pull request
Feb 28, 2026
Add a test that sends a raw initialize request without clientInfo to verify the server doesn't panic. The go-sdk client always sets clientInfo, so we bypass it with raw HTTP to reproduce the scenario from non-compliant clients. Ref: containers#842, containers#844 Signed-off-by: Marc Nuri <marc@marcnuri.com>
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.
Fixes #842
It looks like when init request were sent without client info our user agent middleware (added in #760 ) would panic trying to access the client info.
IMO this case is rare since the spec seems to mandate that client info is sent, but putting a nil check here is probably fine.
Not sure if we should return something other than "" in this case though