Skip to content

fix: request identity encoding for streamable HTTP#2650

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/streamable-http-identity-encoding
Open

fix: request identity encoding for streamable HTTP#2650
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/streamable-http-identity-encoding

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • send Accept-Encoding: identity on streamable HTTP client requests
  • keep the MCP Accept and Content-Type request headers overriding client defaults
  • add coverage that the actual server-visible request headers use identity encoding

Fixes #2649.

To verify

  • uv run pytest tests/shared/test_streamable_http.py::test_streamable_http_client_mcp_headers_override_defaults tests/shared/test_streamable_http.py::test_streamable_http_client_preserves_custom_with_mcp_headers -q --basetemp .tmp/pytest
  • uv run pytest tests/shared/test_streamable_http.py::test_streamable_http_client_json_response -q --basetemp .tmp/pytest-json
  • uv run ruff check src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py
  • uv run python -m py_compile src/mcp/client/streamable_http.py tests/shared/test_streamable_http.py
  • git diff --check

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 parses zstd-compressed JSON response bytes as JSON

1 participant