← Back to Integrations
P
Pydantic AI (Python) Setup
Model Context Protocol Tutorial
Pydantic AI is a Python agent framework built by the team behind Pydantic, designed to make building production-grade AI applications straightforward and type-safe. It supports MCP servers via Streamable HTTP, making it ideal for Python developers who want programmatic, code-driven control over their WordPress site.
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP
wordpress_mcp = MCPServerStreamableHTTP(
url="https://yoursite.com/wp-json/easy-mcp-ai/v1/mcp",
headers={"Authorization": "Bearer YOUR_API_TOKEN"},
)
agent = Agent("openai:gpt-4o", toolsets=[wordpress_mcp])
Need your API Token?
Remember to generate your Bearer token in the WordPress admin panel under Easy MCP AI → API Tokens before completing this setup.
Download Plugin