Skip to content

fix: add sessionIdGenerator to StreamableHTTPServerTransport#31

Open
mzrascoff wants to merge 1 commit intoDMontgomery40:mainfrom
mzrascoff:main
Open

fix: add sessionIdGenerator to StreamableHTTPServerTransport#31
mzrascoff wants to merge 1 commit intoDMontgomery40:mainfrom
mzrascoff:main

Conversation

@mzrascoff
Copy link
Copy Markdown

Summary

  • The MCP SDK v1.17.5 requires sessionIdGenerator in the StreamableHTTPServerTransport constructor options
  • Passing {} omitted this required field, causing a 500 Internal Server Error on every initialize request
  • Added sessionIdGenerator: () => crypto.randomUUID() to enable stateful session management

Test plan

  • Restart the MCP HTTP server
  • Send an initialize request to POST /mcp with Bearer auth
  • Verify a successful JSON-RPC response with Mcp-Session-Id header

🤖 Generated with Claude Code

The MCP SDK v1.17.5 requires sessionIdGenerator in the constructor
options. Passing an empty object caused a 500 on initialize requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

1 participant