File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1616from typing import Any , TypeAlias
1717
1818import anyio
19- from pydantic import BaseModel
19+ import httpx
20+ from pydantic import BaseModel , ConfigDict
2021from typing_extensions import Self
2122
2223import mcp
3031class SseServerParameters (BaseModel ):
3132 """Parameters for intializing a sse_client."""
3233
34+ model_config = ConfigDict (arbitrary_types_allowed = True )
35+
3336 # The endpoint URL.
3437 url : str
3538
@@ -42,10 +45,15 @@ class SseServerParameters(BaseModel):
4245 # Timeout for SSE read operations.
4346 sse_read_timeout : float = 60 * 5
4447
48+ # Optional HTTPX authentication handler.
49+ auth : httpx .Auth | None = None
50+
4551
4652class StreamableHttpParameters (BaseModel ):
4753 """Parameters for intializing a streamablehttp_client."""
4854
55+ model_config = ConfigDict (arbitrary_types_allowed = True )
56+
4957 # The endpoint URL.
5058 url : str
5159
@@ -61,6 +69,9 @@ class StreamableHttpParameters(BaseModel):
6169 # Close the client session when the transport closes.
6270 terminate_on_close : bool = True
6371
72+ # Optional HTTPX authentication handler.
73+ auth : httpx .Auth | None = None
74+
6475
6576ServerParameters : TypeAlias = StdioServerParameters | SseServerParameters | StreamableHttpParameters
6677
You can’t perform that action at this time.
0 commit comments