Example notebookThis example can be found as a notebook in the examples repository.
Prerequisites
- You’ll need to have Python installed on your system.
- You’ll need to have
pipinstalled on your system. - You’ll need an Anthropic API key, or API key from another LLM provider
Setup credentials
Next, you’ll need to provide your Anthropic API key:Response
Using another LLM providerIf you don’t have an Anthropic API key, and want to use another LLM provider,
you can find the instructions for setting up your credentials in the PydanticAI docs
Initialize MCP server and PydanticAI agent
Now configure the ClickHouse MCP server to point at the ClickHouse SQL playground:Ask the agent a question
Finally, you can ask the agent a question:Response