Skip to content

Conversation

@kxbnb
Copy link

@kxbnb kxbnb commented Jan 25, 2026

Summary

  • Adds _server_info attribute to ClientSession that stores InitializeResult.server_info after initialization
  • Adds get_server_info() method to access the stored server info (matches existing get_server_capabilities() pattern)

This lets clients access the connected server's name and version without capturing the initialize() return value.

Test plan

  • Added test_get_server_info test that verifies:
    • Returns None before initialization
    • Returns correct server info after initialization
  • All 12 client session tests pass

Fixes #1018

🤖 Generated with Claude Code

Adds `_server_info` attribute to ClientSession that is populated from
InitializeResult.server_info after initialize() completes. Also adds
a `get_server_info()` accessor method matching get_server_capabilities().

This lets clients access the server's name and version without needing
to capture the initialize() return value.

Fixes modelcontextprotocol#1018

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Update _client_info on the ClientSession upon initialization with serverInfo

1 participant