Back to Workshops
Workshop
Free
Building AI Agents with MCP, PydanticAI and OpenAI
September 1, 2025
Alexey Grigorev
ai-agents
llm-engineering
agent-systems
tooling-architecture
mcp
rag
We build a course FAQ assistant from the bottom up. First we expose a
plain Python search(query) function to the OpenAI Responses API. Then
we turn the same idea into a reusable agent loop, compare toyaikit,
OpenAI Agents SDK, and PydanticAI, and finally move the FAQ tools behind
an MCP server that can be used from a notebook, PydanticAI, Cursor, and
VS Code.
Links
The main resources:
- AI Bootcamp: From RAG to Agents
- Prerequisite workshop: Building a Coding Agent
- Data Engineering Zoomcamp FAQ source document
- Parsed FAQ JSON
- FAQ parsing notebook
The system you will build
The final setup looks like this:
flowchart LR
NOTEBOOK["Jupyter notebook"]
OPENAI["OpenAI Responses API"]
FRAMEWORKS["Agents SDK<br/>PydanticAI"]
MCPCLIENT["MCP clients<br/>toyaikit, PydanticAI, Cursor"]
MCPSERVER["FastMCP server<br/>SSE or stdio"]
TOOLS["FAQ tools<br/>search, add_entry"]
INDEX["minsearch index<br/>FAQ JSON"]
NOTEBOOK -->|function calling| OPENAI
NOTEBOOK --> FRAMEWORKS
FRAMEWORKS -->|tool calls| TOOLS
NOTEBOOK -->|MCP client| MCPCLIENT
MCPCLIENT -->|MCP protocol| MCPSERVER
MCPSERVER --> TOOLS
TOOLS --> INDEX
The FAQ data comes from the Data Engineering Zoomcamp FAQ. The first
half of the workshop keeps the tools inside the notebook so you can see
the agent loop directly. The second half moves the same tools into
mcp_faq/, which makes them reusable by any MCP client.
Tutorial pages
- Overview and setup
- Part 1: Load the FAQ documents
- Part 2: Start with a plain model call
- Part 3: Make the instructions stronger
- Part 4: Replace the loop with ToyAIKit
- Part 5: Infer tool schemas from Python functions
- Part 6: Install the framework
- Part 7: Create the same agent with PydanticAI
- Part 8: Move the FAQ tools into a project
- Part 9: Connect from Python over stdio
- Part 10: Use the FAQ server from Cursor
- Q&A
- Appendix: file list