Skip to content

fix: send Origin header for streamable HTTP#2731

Closed
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/streamable-http-origin-header
Closed

fix: send Origin header for streamable HTTP#2731
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/streamable-http-origin-header

Conversation

@he-yufeng

Copy link
Copy Markdown

Fixes #2727.

Summary

  • derive an Origin header from the streamable HTTP endpoint for client requests
  • keep a caller-provided Origin on custom httpx.AsyncClient headers
  • cover the default and custom-Origin paths in streamable HTTP client tests

To verify

  • uv run pytest tests/shared/test_streamable_http.py -q
  • 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
  • uv run pyright src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py
  • python -m py_compile src\mcp\client\streamable_http.py tests\shared\test_streamable_http.py

@he-yufeng

Copy link
Copy Markdown
Author

Closing this during backlog cleanup. The python-sdk queue has too many open PRs, and this older/no-human-signal item is lower priority than the remaining PRs that have recent validation, review discussion, or clearer current value. I can reopen or refresh it if maintainers want this specific change.

@he-yufeng he-yufeng closed this Jun 10, 2026
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.

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

1 participant