Allow kwargs down in AsyncClient when instantiating sse or streamable… #734
+30
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding support of AsynClient kwargs at the level of sse and streamable http client creation. That allows client implementations to set certain options, which are otherwise unreachable from outside the mcp code base (like max_redirects, verify, and others).
Motivation and Context
Please have a look into the thread at run-llama/llama_index#18752 (comment)
Initially, I tried to achieve a simple MCP server integration into my llama-index based agentic network and used to create a self-signed ssl certificate for local network testig. However, there is currently no option to get around the self-signed certification verification checks, so I had to monkeypatch the mcp code base in orer to set the 'verify' argument of the underlying AsyncClient. This PR extends the configuration options of the mcp clients and allows the developers to be more flexible.
How Has This Been Tested?
Yes. I have tested ths with a patch inside the llama-index code and your code base. No productional application, just local dev.
Breaking Changes
No
Types of changes
Checklist
Additional context