Skip to content

docs: add missing docstrings to core client/server session API methods#2733

Open
sohammmmm10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
sohammmmm10:docs/add-missing-docstrings-core-api
Open

docs: add missing docstrings to core client/server session API methods#2733
sohammmmm10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
sohammmmm10:docs/add-missing-docstrings-core-api

Conversation

@sohammmmm10
Copy link
Copy Markdown

Add docstrings to undocumented public methods in the client and server session modules:

  • ClientSession.initialize(): document handshake flow, return type, and RuntimeError on unsupported protocol version
  • ServerSession.client_params: document property returning client's InitializeRequestParams
  • ServerSession.incoming_messages: document the ServerRequestResponder stream property
  • remove_request_params(): document URL query-stripping utility

These are the most user-facing public methods that currently lack docstrings, making IDE tooltips and help() output incomplete.

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Add docstrings to undocumented public methods in the client and server
session modules:

- ClientSession.initialize(): document handshake flow, return type, and
  RuntimeError on unsupported protocol version
- ServerSession.client_params: document property returning client's
  InitializeRequestParams
- ServerSession.incoming_messages: document the ServerRequestResponder
  stream property
- remove_request_params(): document URL query-stripping utility

These are the most user-facing public methods that currently lack
docstrings, making IDE tooltips and help() output incomplete.
@sohammmmm10
Copy link
Copy Markdown
Author

Note: The single failing check (CI / test — 3.12, windows-latest) is a
pre-existing coverage gap (99.96% vs 100% threshold) unrelated to this PR.
This PR adds docstrings only — zero logic changes. The required all-green
check passes, and all 26 other checks are green.

Happy to rebase if needed once this is reviewed.

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.

1 participant