+- **`init_timeout` on `MCPServerConfig` for slow-starting MCP servers** ([#167](https://github.com/vstorm-co/pydantic-deepagents/issues/167), [#171](https://github.com/vstorm-co/pydantic-deepagents/pull/171)) (`pydantic_deep/mcp/config.py`, `pydantic_deep/mcp/registry.py`). pydantic-ai caps the initial connect + `initialize` handshake at 5s, so a server that does real work on startup (e.g. opens a database connection, ~8s) failed with `"Failed to initialize server session"` — and re-wrapping with a longer timeout isn't possible, since `MCPToolset` rejects `init_timeout` alongside a pre-built client. The new optional field (validated positive; `None` keeps the 5s default) is forwarded by `build_mcp_server` to every `MCPToolset` construction (stdio, OAuth, http/sse), only when set, and round-trips through `to_dict`/`from_dict` so the CLI persists it in `mcp.json`. The `/mcp` Test action's probe window now scales with it — `max(10s, init_timeout + 5s)`, OAuth keeps 180s — so a slow server that connects fine at runtime no longer fails its connection test (`apps/cli/modals/mcp_view.py`).
0 commit comments