p2c2e
MCP Serverp2c2epublic

mcp_proxy_pydantic_agent

Example for exposing MCP servers to Pydantic Agents

Repository Info

17
Stars
4
Forks
17
Watchers
1
Issues
Python
Language
-
License

About This Server

Example for exposing MCP servers to Pydantic Agents

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Sample to show to integrate MCP (Model Context Protocol) servers with Pydantic.AI

Parts of this example uses content from : https://github.com/modelcontextprotocol/quickstart-resources.git - Esp. the weather 'server' code

Code uses two different LLMs just for demonstration. The Proxy Agent uses gpt-4o and the tool uses sonnet. So, export OPENAI_API_KEY as well as ANTHROPIC_API_KEY - OR - modify the code to suit your models

The pyproject.toml assumes you are using 'uv' package manager

Steps to run

  1. Clone this repo
  2. uv sync
  3. cd mcp-client
  4. uv run client.py (this requires openai and anthropic keys and uses anthropic libs directly)
  5. uv run client2.py (for pure pydantic and works with any fn calling LLM)

(Alternatively try client2.py - this uses only PydanticAI - no direct dep on Anthropic libs)

Now, try interacting with some questions like:

What is the time in NY when it is 7:30pm in Bangalore?

What is the Weather currently in Chicago?

(and quit when done)

Quick Start

1

Clone the repository

git clone https://github.com/p2c2e/mcp_proxy_pydantic_agent
2

Install dependencies

cd mcp_proxy_pydantic_agent
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerp2c2e
Repomcp_proxy_pydantic_agent
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation