Skip to content

Override client transport fetch #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
domnit opened this issue May 9, 2025 · 0 comments
Open

Override client transport fetch #476

domnit opened this issue May 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@domnit
Copy link

domnit commented May 9, 2025

Is your feature request related to a problem? Please describe.

I am writing MCP client code that needs to control networking (e.g. proxying/traffic filtering). Although the MCP client transports options offer some flexibility (RequestInit for Streamable HTTP and SSE transports, fetch override in EventSourceInit for SSE transport), I really need to just control all uses of fetch within these transports.

Describe the solution you'd like

Add a fetch option to both StreamableHTTPClientTransportOptions and SSEClientTransportOptions. All fetch calls within these transports use the provided fetch implementation, falling back to native fetch.

Describe alternatives you've considered

I can work around this issue either by providing custom transport implementations, or by locally patching the SDK to allow overriding fetch.

Additional context

I'm happy to provide a PR, please let me know if the contribution would be welcome.

@domnit domnit added the enhancement New feature or request label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant