Skip to content

Conversation

DebajitKumarPhukan
Copy link

@DebajitKumarPhukan DebajitKumarPhukan commented Aug 24, 2025

Objective:

Add support for http/https proxy in SSE and Streamable HTTP Client..

Motivation and Context

This is a good to have feature for scenarios where direct reachability to MCP servers is not possible and thus, requires a proxy.

How Has This Been Tested ?

Yes, over a real proxy server to test SSE and Streamable HTTP Client end to end.

Breaking Changes

Proxy is optional and the user may set it or leave it to default which is None.

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
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Related issue number

Closes #1302

@DebajitKumarPhukan
Copy link
Author

@felixweinberger Did you get any chance to look at it ?.

@DebajitKumarPhukan
Copy link
Author

@ihrpr Can you have a look at it please ?.

Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DebajitKumarPhukan thanks for this contribution!

Could you please elaborate on the motivation for this PR? What are you trying to achieve and is there a concrete use case that you weren't able to address another way?

In general this type of redirect behavior seems like something that should like be handled by applications rather than at the SDK level.

@felixweinberger felixweinberger added needs motivation When a PR is submitted without clear intent or motivation for the changes. needs more eyes Needs alignment among maintainers whether this is something we want to add labels Sep 23, 2025
@DebajitKumarPhukan
Copy link
Author

@felixweinberger Thanks for looking into my PR. In major production scenarios with sse or streamable_http communication, the MCP client(s) will always be behind some firewall and the MCP servers (if not internal) would be hosted on some domain. Overriding HTTP_PROXY and HTTPS_PROXY on the application side is not a good practice and can lead to unforeseen consequences.

This PR will provide a feature in MCP client to specify proxy configurations which will help the MCP client(s) behind a firewall to be able to securely reach to MCP servers hosted in a remote domain.

@felixweinberger felixweinberger added the needs maintainer action Potentially serious issue - needs proactive fix and maintainer attention label Sep 30, 2025
@felixweinberger felixweinberger self-assigned this Sep 30, 2025
Copy link
Author

@DebajitKumarPhukan DebajitKumarPhukan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the PR when you get sometime.

@felixweinberger felixweinberger removed their assignment Oct 10, 2025
@felixweinberger
Copy link
Contributor

Please review the PR when you get sometime.

Hi again @DebajitKumarPhukan thanks for following up - we reviewed this internally along with other approaches and we have another approach that replaces the factory with a direct ability to pass the client here: #1177

That should also allow the proxy setup requirements that you need here, so I'm going to close this PR. Please take a look at #1177 in case it's insufficient for whatever reason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs maintainer action Potentially serious issue - needs proactive fix and maintainer attention needs more eyes Needs alignment among maintainers whether this is something we want to add needs motivation When a PR is submitted without clear intent or motivation for the changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support For "Proxy" in SSE and Streamable HTTP Client

2 participants