Skip to content

Temporal integration in pydantic-ai-slim unconditionally requires mcp #2907

@jeroenvandermerwe

Description

@jeroenvandermerwe

Initial Checks

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 working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions