Skip to content

chore: defer mcp SDK import to first MCP usage#2343

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
copybara/905291907
Open

chore: defer mcp SDK import to first MCP usage#2343
copybara-service[bot] wants to merge 1 commit intomainfrom
copybara/905291907

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service Bot commented Apr 25, 2026

chore: defer mcp SDK import to first MCP usage

import google.genai no longer eagerly imports mcp. The public
symbols McpClientSession, McpCallToolResult, and mcp_types
resolve lazily on first attribute access (PEP 562 __getattr__).

FUTURE_COPYBARA_INTEGRATE_REVIEW=#2345 from MukundaKatta:fix/retry-httpx-timeout 9b2d886

@copybara-service copybara-service Bot force-pushed the copybara/905291907 branch 4 times, most recently from e748afe to 21a1b14 Compare April 27, 2026 16:48
`import google.genai` no longer eagerly imports `mcp`. The public
symbols `McpClientSession`, `McpCallToolResult`, and `mcp_types`
resolve lazily on first attribute access (PEP 562 `__getattr__`).

FUTURE_COPYBARA_INTEGRATE_REVIEW=#2345 from MukundaKatta:fix/retry-httpx-timeout 9b2d886
PiperOrigin-RevId: 905291907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant