- Notifications
You must be signed in to change notification settings - Fork1k
pass sse_read_timeout to MCP ClientSession read_timeout_seconds#2240
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
pydantic_ai_slim/pydantic_ai/mcp.py Outdated
@@ -59,6 +60,7 @@ class MCPServer(AbstractToolset[Any], ABC): | |||
log_level:mcp_types.LoggingLevel|None=None | |||
log_handler:LoggingFnT|None=None | |||
timeout:float=5 | |||
sse_read_timeout:float=5*60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can we call thisread_timeout
as it's not SSE specific anymore? We'd still want to keep thesse_read_timeout
argument on constructor to_MCPServerHTTP
subclasses for backward compatibility, but we can set the new property and print a deprecation warning. We'd likely need to define a custom__init__
and passinit=False
to@dataclass
.
Let me know if you'd like some more guidance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sounds good, thanks for reviewing.
I mappedsse_read_timeout
toread_timeout
and added a deprecation warning. I also updated the tests. Let me know if I misused the dataclass setup -- still learning the python way.
Uh oh!
There was an error while loading.Please reload this page.
fixes#2222