Skip to content

[Client] Fix connecting to a server with an empty serverInfo.version - #579

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-empty-server-version
Open

chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-empty-server-version

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

The Python SDK sends "version": "" when the server has none configured - connect() failed with an InvalidArgumentException and left a spawned stdio server running.

  • Implementation::fromArray() accepts an empty version, the spec only types it as string - missing or non-string is still rejected
  • connect() closes the transport on any SDK exception during initialization and wraps it in a ConnectionException, without retrying since a malformed result is not transient

Fixes chr-hertel#70

🤖 Generated with Claude Code

Accept an empty `serverInfo.version`, and close the transport when initialization fails on a malformed result, wrapped in a `ConnectionException`.
@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 10, 2026
@chr-hertel chr-hertel added bug Something isn't working Client Issues & PRs related to the Client component Schema Issues & PRs related to the Schema component labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Client Issues & PRs related to the Client component Schema Issues & PRs related to the Schema component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Client] Connecting fails on an empty serverInfo.version

1 participant