Skip to content

Conversation

@renxiawang
Copy link
Contributor

Adding support for custom request headers for SSE transport

Motivation and Context

Close #68

How Has This Been Tested?

This change simply injects a HttpRequest.Builder to HttpClientSseClientTransport. Existing HttpClientSseClientTransportTests passed. I considered adding a test to mock the http client and verify a request is sent with custom headers within the unit, but it seems testing too much of the internal logic of the unit, not the input/output behavior. Let me know what you think.

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines (where is the style guideline?)
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@tzolov
Copy link
Contributor

tzolov commented Apr 2, 2025

Thank you @renxiawang ! will review it shortly

@tzolov tzolov self-assigned this Apr 2, 2025
@tzolov tzolov added this to the 0.9.0 milestone Apr 6, 2025
@tzolov tzolov added enhancement New feature or request area/client labels Apr 6, 2025
tzolov pushed a commit that referenced this pull request Apr 6, 2025
Enhances FlowSseClient and HttpClientSseClientTransport to accept a custom HttpRequest.Builder,
allowing for greater flexibility when configuring HTTP requests.
This enables clients to customize headers, timeouts, and other request properties across
all SSE connections and message sending operations.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov
Copy link
Contributor

tzolov commented Apr 6, 2025

Thanks @renxiawang
Rebased, reformatted and merged at eb8e374

@tzolov tzolov closed this Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Custom Headers via MCP Client

3 participants