Skip to content

docs(integrations): add Pydantic AI FastMCP toolset guide#4070

Merged
jlowin merged 2 commits into
PrefectHQ:mainfrom
MukundaKatta:docs/issue-2246-pydantic-ai-toolset
May 4, 2026
Merged

docs(integrations): add Pydantic AI FastMCP toolset guide#4070
jlowin merged 2 commits into
PrefectHQ:mainfrom
MukundaKatta:docs/issue-2246-pydantic-ai-toolset

Conversation

@MukundaKatta
Copy link
Copy Markdown
Contributor

Why

Closes #2246. Pydantic AI ships a FastMCPToolset (in pydantic_ai.toolsets.fastmcp) that lets a Pydantic AI agent call tools from any FastMCP (or other MCP) server, but the FastMCP docs do not cover the integration. New users searching the FastMCP docs for Pydantic AI find nothing and have to dig through the Pydantic AI repo to wire it up.

What

  • New page at docs/integrations/pydantic-ai.mdx under the existing AI SDKs group, matching the style of the Anthropic, OpenAI, and Gemini integration pages.
  • Walks through pointing FastMCPToolset at a FastMCP server with examples for in-memory, Streamable HTTP, STDIO, and mcpServers JSON config transports.
  • Covers auth pass-through by building a Client / StreamableHttpTransport with a bearer header, and links to the FastMCP OAuth helper plus server-side Token Verification.
  • Links out to the upstream Pydantic AI FastMCPToolset docs so readers can find the full API.
  • Adds the new page to docs/docs.json so it shows up in the AI SDKs nav alongside Anthropic / Gemini / OpenAI.

Tested

  • Verified FastMCPToolset import path and accepted constructor arg types against the Pydantic AI source (pydantic_ai_slim/pydantic_ai/toolsets/fastmcp.py) and Pydantic AI's docs/mcp/fastmcp-client.md.
  • Verified the new entry slots into docs/docs.json under the existing AI SDKs group without breaking JSON structure.
  • Confirmed all internal doc links (/clients/client, /clients/transports, /clients/auth, /clients/auth/oauth, /integrations/mcp-json-configuration, /servers/auth/token-verification) resolve to existing pages in the repo.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@marvin-context-protocol marvin-context-protocol Bot added the documentation Updates to docs, examples, or guides. Primary change is documentation-related. label Apr 26, 2026
Copy link
Copy Markdown
Member

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Solid integration guide. I'll merge as-is and follow up with a tiny PR to fix two broken doc-link anchors and hoist an import — minor enough to not block on a re-push.

@jlowin jlowin merged commit f5dea2a into PrefectHQ:main May 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates to docs, examples, or guides. Primary change is documentation-related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Docs for Pydantic AI FastMCP Toolset

2 participants