Skip to content

[codex] Add default Origin for streamable HTTP client#2759

Draft
tarunag10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarunag10:codex/python-sdk-streamable-origin
Draft

[codex] Add default Origin for streamable HTTP client#2759
tarunag10 wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarunag10:codex/python-sdk-streamable-origin

Conversation

@tarunag10
Copy link
Copy Markdown

Summary

  • derive a default Origin from the streamable HTTP target URL
  • send that origin on streamable HTTP requests when the caller has not configured one
  • preserve caller-provided Origin headers and avoid mutating provided httpx.AsyncClient headers

Validation

  • uv run pytest tests/shared/test_streamable_http.py -k "default_origin or preserves_custom_origin"
  • uv run pytest tests/shared/test_streamable_http.py
  • uv run ruff check src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py
  • uv run ruff format --check src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py

Addresses #2727.

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