mcpField
M
Mcp_proxy_pydantic_agent

Mcp_proxy_pydantic_agent

Local
github.com/p2c2eAI & Agents18Updated 84w ago

About Mcp_proxy_pydantic_agent

Mcp_proxy_pydantic_agent is an example project showing how to integrate MCP servers with Pydantic.AI agents. It includes two client scripts demonstrating different LLM and library setups.

Key features

  1. 01Integrate MCP servers with Pydantic.AI
  2. 02Two client script examples
  3. 03Demonstrate alternative LLM setups

Use cases

  1. 01Explore MCP server integration with Pydantic.AI
  2. 02Compare the provided client script approaches

MCP support

The example connects Pydantic.AI agents to MCP servers and demonstrates asking questions that use server-provided capabilities.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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)

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.