- Model Context Protocol (MCP) Agent Frameworks Demo
Model Context Protocol (MCP) Agent Frameworks Demo
Model Context Protocol (MCP) Agent Frameworks Demo
This repository demonstrates the usage of Model Context Protocol (MCP) servers with several frameworks:
- Google Agent Development Toolkit (ADK)
- LangGraph Agents
- OpenAI Agents
- Pydantic-AI Agents
Included MCP Server is based on MCP Python SDK Quickstart
- Modified to include a datetime tool and run as a server invoked by Agents
Tracing is done through Pydantic Logfire.

Quickstart
cp .env.example .env
- Add
GEMINI_API_KEYand/orOPENAI_API_KEY- Individual scripts can be adjusted to use models from any provider supported by the specific framework
- By default only basic_mcp_use/oai-agent_mcp.py requires
OPENAI_API_KEY - All other scripts require
GEMINI_API_KEY(Free tier key can be created at https://aistudio.google.com/apikey)
- By default only basic_mcp_use/oai-agent_mcp.py requires
- Individual scripts can be adjusted to use models from any provider supported by the specific framework
- [Optional] Add
LOGFIRE_TOKENto visualise evaluations in Logfire web ui
Run an Agent framework script e.g.:
-
uv run basic_mcp_use/pydantic_mcp.py- RequiresGEMINI_API_KEYby default -
uv run basic_mcp_use/oai-agent_mcp.py- RequiresOPENAI_API_KEYby default
Check console or Logfire for output
Project Overview
This project aims to teach:
- How to use MCP with multiple LLM Agent frameworks
- Single MCP server usage and Multi-MCP server usage
- How to see traces LLM Agents with Logfire
- How to evaluate LLMs with PydanticAI evals

Repository Structure
-
agents_mcp_usage/basic_mcp/basic_mcp_use/ - Contains basic examples of single MCP usage:
adk_mcp.py- Example of using MCP with Google's Agent Development Kit (ADK)langgraph_mcp.py- Example of using MCP with LangGraphoai-agent_mcp.py- Example of using MCP with OpenAI Agentspydantic_mcp.py- Example of using MCP with Pydantic-AI
-
agents_mcp_usage/basic_mcp/eval_basic_mcp_use/ - Contains evaluation examples for single MCP usage:
evals_adk_mcp.py- Evaluation of MCP with Google's ADKevals_langchain_mcp.py- Evaluation of MCP with LangGraphevals_pydantic_mcp.py- Evaluation of MCP with Pydantic-AI
-
agents_mcp_usage/multi_mcp/ - Contains advanced examples of multi-MCP usage:
multi_mcp_use/pydantic_mcp.py- Example of using multiple MCP servers with Pydantic-AIeval_multi_mcp/evals_pydantic_mcp.py- Example of evaluating the use of multiple MCP servers with Pydantic-AImermaid_diagrams.py- Generates Mermaid diagrams for visualizing MCP architecture
-
Demo Python MCP Server
run_server.py- Simple MCP server that runs locally, implemented in Python
What is MCP?
The Model Context Protocol allows applications to provide context for LLMs in a standardised way, separating the concerns of providing context from the actual LLM interaction.
Learn more: https://modelcontextprotocol.io/introduction
Why MCP
By defining clear specifications for components like resources (data exposure), prompts (reusable templates), tools (actions), and sampling (completions), MCP simplifies the development process and fosters consistency.
A key advantage highlighted is flexibility; MCP allows developers to more easily switch between different LLM providers without needing to completely overhaul their tool and data integrations. It provides a structured approach, potentially reducing the complexity often associated with custom tool implementations for different models. While frameworks like Google Agent Development Kit, LangGraph, OpenAI Agents, or libraries like PydanticAI facilitate agent building, MCP focuses specifically on standardising the interface between the agent's reasoning (the LLM) and its capabilities (tools and data), aiming to create a more interoperable ecosystem.
Setup Instructions
- Clone this repository
- Install required packages:
make install - Set up your environment variables in a
.envfile:LOGFIRE_TOKEN=your_logfire_token GEMINI_API_KEY=your_gemini_api_key OPENAI_API_KEY=your_openai_api_key - Run any of the sample scripts to see a simple MCP server being used via an Agent framework
- Google Agent Development Kit (ADK)
- LangGraph Agents
- OpenAI Agents
- Pydantic-AI Agents
About Logfire
Logfire is an observability platform from the team behind Pydantic that makes monitoring AI applications straightforward. Features include:
- Simple yet powerful dashboard
- Python-centric insights, including rich display of Python objects
- SQL-based querying of your application data
- OpenTelemetry support for leveraging existing tooling
- Pydantic integration for analytics on validations
Logfire gives you visibility into how your code is running, which is especially valuable for LLM applications where understanding model behavior is critical.