A hands-on exploration of AI agent frameworks and Model Context Protocol (MCP) by building a weather assistant CLI application.
This project demonstrates:
- Building a custom MCP server - Create a simple Model Context Protocol server that exposes weather data tools
- Multi-framework agent implementations - See how different AI agent frameworks integrate with MCP
- Agent framework patterns - Modular architecture for comparing different agent frameworks
Currently implements:
- PydanticAI - Pydantic-native AI agent framework
- smolagents - Lightweight agent framework from HuggingFace
Planned additions:
- AG2 (AutoGen)
- Strands Agents
Interactive CLI weather assistant that can:
- Get current weather for any location
- Provide multi-day weather forecasts
- Search for locations worldwide
- Answer natural language queries about weather
- Custom MCP server using Open-Meteo API
uv syncCreate a .env file with your OpenAI API key:
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY# Using PydanticAI (default)
uv run python -m agents_testdrive
# Using smolagents
uv run python -m agents_testdrive --framework smol
# Or use the shorthand
uv run python -m agents_testdrive -f smolYou: What's the weather here?
You: How about tomorrow?
You: Will it rain tomorrow in Tokyo?
You: Show me the 5-day forecast for London
You: What's the temperature in New York?
agents-testdrive/
├── src/agents_testdrive/
│ ├── weather/
│ │ ├── models.py # Pydantic models for weather data
│ │ └── client.py # Open-Meteo API client
│ ├── agents/
│ │ ├── base.py # Abstract base agent interface
│ │ ├── pydantic_agent.py # PydanticAI implementation
│ │ └── smol_agent.py # smolagents implementation
│ ├── weather_mcp_server.py # Custom MCP server
│ ├── cli.py # Interactive CLI
│ ├── config.py # Configuration management
│ └── __main__.py # Entry point
├── tests/ # Test suite
└── pyproject.toml # Project configuration
- Python >=3.12
- OpenAI API key
- Internet connection (for weather data and LLM API)
/quitorCtrl-D- Exit the application/reset- Clear conversation history/help- Show help messageArrow Up/Down- Navigate command history
See LICENSE for details.