Support custom httpx client creation (#752)

This commit is contained in:
Nick Cooper 2025-05-23 05:55:01 -07:00 • committed by GitHub
commit 10cf0f78a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,21 @@
"""Utilities for creating standardized httpx AsyncClient instances."""
from typing import Any
from typing import Any, Protocol
import httpx
__all__ = ["create_mcp_http_client"]
class McpHttpClientFactory(Protocol):
def __call__(
self,
headers: dict[str, str] | None = None,
timeout: httpx.Timeout | None = None,
auth: httpx.Auth | None = None,
) -> httpx.AsyncClient: ...
def create_mcp_http_client(
headers: dict[str, str] | None = None,
timeout: httpx.Timeout | None = None,