Context
Following discussion in #1177, @Kludex raised concerns about the current API approach for HTTP client handling.
Problem
The current pattern of accepting an HTTP client directly may not be the cleanest long-term approach. While many LLM providers do this, there are concerns about API sustainability.
Proposed Direction
Create an MCPClient/Client class that manages the lifecycle of the HTTP client internally, rather than accepting it as a parameter. This is similar to how Starlette's TestClient works.
Key points from @Kludex:
- The SDK should manage HTTP client lifecycle internally
- Could use composition (not necessarily inheritance)
- Reference implementation: Starlette's
TestClient pattern
- Allow passing configuration parameters rather than the client itself
cc @Kludex @maxisbey
Reference: #1177
Update: This is being addressed as part of #1728 (ergonomic test client). We're creating a unified Client class that handles both in-memory testing and HTTP production use cases.