Skip to content

feat(mcp): Add StreamableHTTPServerTransport#4

Open
hggzm wants to merge 2 commits intomainfrom
feature/mcp-http-server
Open

feat(mcp): Add StreamableHTTPServerTransport#4
hggzm wants to merge 2 commits intomainfrom
feature/mcp-http-server

Conversation

@hggzm
Copy link
Copy Markdown
Owner

@hggzm hggzm commented Jan 23, 2026

Adds HTTP transport for MCP server. Issue 2470

hggzm and others added 2 commits January 22, 2026 05:52
Fixes microsoft/teams-sdk#2500
Fixes microsoft/teams-sdk#2503

- Add bounds check (len > 0) before accessing messages[0]
- Add optional chaining for messages[0]?.role access
- Add null guard and bounds check in collapse() loop
- Prevents 'Cannot read properties of null (reading role)' crash

Root cause: Array access without bounds checking when:
1. Messages array becomes empty during collapse
2. end index exceeds array bounds in collapse loop

Co-authored-by: claude-swarm-agent <swarm@local>
- Add StreamableHTTPServerTransport to support the new MCP spec transport
- Add McpStreamableHTTPTransportOptions type with path and stateful options
- Add McpTransportOptions union type for all transport configurations
- Implement onInitStreamableHTTP with POST/GET/DELETE handlers
- Session management with Map<string, StreamableHTTPServerTransport>
- Bump @modelcontextprotocol/sdk to ^1.25.0 for StreamableHTTP support
- Update connection.ts with ServerTransport union type

Closes #2470
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