Overview
This recipe shows how to use Pydantic AI with Nexus MCP tools. To call Nexus, you need a Civicaccess_token
.
Install
Access Token Setup (Python)
Get the Civic access token in your Python backend:- FastAPI
- Flask
- Django
Full Python integration guide: /integration/python
Use Pydantic AI as an MCP client
You can customize how tools are called (names, arguments, etc.). See Pydantic AI MCP client docs: Tool call customization.
Example: FastAPI Endpoint
Example: Flask Route
Example: Django View
Optional: OpenAI Python Usage
Server-to-server token validation? Use /libraries/auth-verify to verify incoming Civic tokens when not using framework session helpers.