Skip to content

Bug fix: a missing type variable ReceiveResultT in the BaseSession class definition. #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

huangjia2019
Copy link

@huangjia2019 huangjia2019 commented Jun 26, 2025

Bug fix: a missing type variable ReceiveResultT in the BaseSession class definition.

Motivation and Context

Added ReceiveResultT as a generic type parameter to BaseSession.

This aligns BaseSession's generic signature with its actual method usage, particularly for:

send_request() which returns a ReceiveResultT

_send_response() which also sends a ReceiveResultT in some cases

Why
Without ReceiveResultT in the class signature, type checking tools (like Pyright or MyPy) may raise warnings or fail to infer correct types.

The class was already using ReceiveResultT internally, so this fix improves type completeness and consistency.

Impact
Improves type safety and developer experience for consumers of the MCP Python SDK

How Has This Been Tested?

No behavior change; purely type annotation fix

Breaking Changes

None

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

@huangjia2019 huangjia2019 changed the title Bug fix: This PR fixes a missing type variable ReceiveResultT in the BaseSession class definition. Bug fix: a missing type variable ReceiveResultT in the BaseSession class definition. Jun 26, 2025
@huangjia2019
Copy link
Author

Will someone review this PR?

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