Skip to content

StreamableHTTPServerTransport should only check init status when sessionId existing #335

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 1 commit into
base: main
Choose a base branch
from

Conversation

qikaigao
Copy link

Motivation and Context

When using stateless mode, the backend will create a new transport for each request. For new transport, the initialized filed is always false. So we should only check the initialized filed if there is session existing

How Has This Been Tested?

Tested in local MCP Server. At backend, I create a new transport object and meet the issue. the PR fixed it.

Breaking Changes

No

Types of changes

  • [ X] 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

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

Additional context

…e is an sessionId

When using stateless mode, the backend will create a new transport for each request. For new transport, the initialized filed is always false. So we should only check the initialized filed if there is session existing
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