-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
Importing the Temporal integration (pydantic_ai.durable_exec.temporal, e.g. to use PydanticAIPlugin) unconditionally imports pydantic_ai.mcp.MCPServer, which raises an ImportError unless the external mcp packages are installed. This makes the optional mcp dependencies effectively mandatory for anyone using Temporal, even when no MCP toolsets are used, undermining the purpose of the “slim” variant.
I might be misunderstanding the docs—Is this expected behavior? I’m not using any MCP toolsets; I only import PydanticAIPlugin, and the import fails unless mcp is added. Should mcp be required whenever importing the Temporal module, or only when an MCP toolset is actually used?
Example Code
Python, Pydantic AI & LLM client version
Python: 3.13.7
Pydantic AI (slim, with openai): 1.0.6
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working