P

mcp_proxy_pydantic_agent

...
Created 1/2/2025byp2c2e

Language:

Python

Stars:

14

Forks:

5

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 mc-client
  4. uv run client.py

(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)

Last updated: 3/16/2025

Publisher info

p2c2e's avatar

Sudharsan

11
followers
1
following
85
repos

More MCP servers built with Python

composer-trade-mcp

Create, backtest, and execute trades directly in one chat box. The Composer MCP Server gives LLMs the power to backtest investment ideas and execute automated trading strategies. Trade across stocks, ETFs, and crypto directly in Claude.

By https://github.com/ronnyli
slidespeak-mcp

An MCP to generate presentations with AI. Create and edit PowerPoint presentations with AI.

By https://github.com/SlideSpeak
PaddleOCR

The PaddleOCR MCP server brings enterprise-grade OCR and document parsing capabilities to AI applications. Built on PaddleOCR — a proven solution with 50,000+ GitHub stars, deeply integrated by leading projects like MinerU, RAGFlow, and OmniParser— with targeted optimizations based on the MCP concept.

By PaddlePaddle