Skip to content

Add default Origin header for streamable HTTP client#2752

Closed
tarunag10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarunag10:codex/add-streamable-http-origin
Closed

Add default Origin header for streamable HTTP client#2752
tarunag10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarunag10:codex/add-streamable-http-origin

Conversation

@tarunag10

Copy link
Copy Markdown

Summary

  • derive a default Origin header from the streamable HTTP endpoint URL
  • include that header on client transport requests when the caller has not supplied an Origin on the provided HTTP client
  • add focused regression coverage for default-Origin header handling

Fixes #2727.

Validation

  • uv run pytest tests/shared/test_streamable_http.py -k origin -q
  • uv run ruff format --check src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py
  • uv run ruff check src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py

@Kludex

Kludex commented Jun 25, 2026

Copy link
Copy Markdown
Member

You've opened a duplicated pull request, please search opened PRs before creating new ones. Duplicated from #2729.

@Kludex Kludex closed this Jun 25, 2026
@modelcontextprotocol modelcontextprotocol locked as resolved and limited conversation to collaborators Jun 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

streamable_http client does not send Origin header → rejected with 403 by spec-compliant servers (e.g. go-sdk CrossOriginProtection)

2 participants