Cover image
mcp_proxy_pydantic_agent
Public

mcp_proxy_pydantic_agent

Try Now
2025-03-16

将MCP服务器暴露于Pydantic代理的示例

3 years

Works with Finder

1

Github Watches

5

Github Forks

15

Github Stars

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)

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • XLwebDev.com
  • PR Professional: Guiding You to Get Media Placements and Publicity Quickly and Effectively

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    2 (1)
    Avatar
    user_wgYHnClB
    2025-04-15

    I have been using the MediaWiki MCP Server by shiquda and I am thoroughly impressed. The server is highly efficient, easy to set up, and optimizes media management effectively. It has significantly streamlined my workflow, making content management a breeze. Highly recommended for anyone looking to enhance their MediaWiki experience!