Content
# AI Agent Project with Google ADK, A2A Protocol and MCP Integration
This project represents an implementation of an AI agent with integration of Google ADK (Agent Development Kit), supporting A2A (Agent-to-Agent) protocol for interaction with other agents and extensible through MCP (Model Context Protocol) servers. The project includes a ready-made infrastructure for developing, testing, and deploying AI agents with monitoring and tracing.
Detailed documentation on the A2A protocol: [documentation](./documentation-a2a-russian.md) and [Postman collection](./postman-collection-a2a-spec.json)
## 🎯 Features
- **Google ADK Integration** - Utilization of an advanced SDK for agent development
- **MCP Tools Support** - Integration with Model Context Protocol for extensible tools
- **LiteLLM** - Support for various LLM models through a unified interface
- **Phoenix Monitoring** - Optional monitoring and tracing of execution
- **Docker Ready** - Full containerization with automatic setup
- **A2A Protocol** - Agent-to-Agent communication
- **Flexible Configuration** - Configuration through environment variables
## 📁 Project Structure
```
a2a-adk-mcp-example/
├── agent/ # Agent directory
│ ├── app/ # Main application code
│ │ ├── __main__.py # Entry point with Click CLI
│ │ ├── agent.py # Class AgentEvolution
│ │ └── agent_executor.py # Agent executor
│ ├── .env.example # Example configuration file
│ ├── pyproject.toml # Project configuration and dependencies
│ └── README.md # Agent documentation
├── mcp-weather/ # Weather MCP server
│ ├── server.py # Main server
│ ├── Dockerfile # Docker configuration
│ └── README.md # MCP server documentation
├── nginx/ # Nginx configuration
├── docker-compose.phoenix.yml # Configuration with Phoenix
├── docker-compose.yml # Main Docker Compose configuration
├── Makefile # Command automation
└── .gitignore # Ignored files
```
## 🛠 Installation and Quick Start
### Quick Start with Docker (recommended)
```bash
# Build images
make build
# Start main services
make up
# The agent will be available at http://localhost:10002
# The MCP server will be available at http://localhost:8001
```
### Using Makefile
```bash
# View all available commands
make help
# Start main services
make up
# Start with Phoenix monitoring
make phoenix
# Development mode
make dev
# View logs
make logs
# Stop all services
make down
```
## ⚙️ Configuration
### Creating an Environment File
```bash
# Create .env file from example
make env
# Or manually
cp agent/.env.example .env
```
### Main Environment Variables
In the `.env` file, you can configure the following parameters:
```bash
# Main agent settings
AGENT_NAME=jira_mcp_agent
AGENT_DESCRIPTION="Jira MCP agent for managing projects, tasks, sprints, and agile processes"
AGENT_VERSION=1.0.0
# Model configuration
LLM_MODEL="evolution_inference/model-for-agent-space-test"
LLM_API_BASE="https://your-model-api-base-url/v1"
# MCP Configuration
MCP_URL=http://mcp-weather:8001/sse
# Phoenix monitoring (optional)
PHOENIX_PROJECT_NAME="ip_agent_adk"
PHOENIX_ENDPOINT="http://phoenix:6006/v1/traces"
# Server settings
HOST="0.0.0.0"
PORT="10002"
# Monitoring
ENABLE_PHOENIX="false"
ENABLE_MONITORING="true"
```
## 🚀 Usage
### Running the Agent
```bash
# Start main services
make up
# The agent will be available at http://localhost:10002
```
### Development Mode
```bash
# Run in development mode with live reload
make dev
# Run with Phoenix monitoring for debugging
make dev-phoenix
```
### Checking Status
```bash
# Status of all services
make status
# Health check
make health
# View logs
make logs
```
## 🧩 Project Components
### Agent (agent/)
The main component of the project is the AI agent based on Google ADK with support for MCP tools. The agent implements the A2A Protocol for interaction with other agents.
#### API Endpoints
- `GET /` - Information about the agent (Agent Card)
- `POST /tasks` - Create a new task
- `GET /tasks/{task_id}` - Get the status of a task
- `GET /tasks/{task_id}/stream` - SSE stream of task execution
### Weather MCP Server (mcp-weather/)
The server provides tools for obtaining weather data through the MCP protocol. It uses the free Open-Meteo API.
#### Tools
- `get_today_weather(city: str)` - Gets the current weather for today for the specified city
- `get_weekly_forecast(city: str)` - Gets the weekly weather forecast for the specified city
#### Endpoints
- **SSE**: `http://localhost:8001/sse`
- **Messages**: `http://localhost:8001/messages/`
## 📊 Monitoring
### Phoenix Tracing
To enable Phoenix monitoring, set the environment variable:
```bash
ENABLE_PHOENIX=true
```
Run with Phoenix:
```bash
make phoenix
```
The Phoenix Dashboard will be available at http://localhost:6006
## 🐳 Docker Commands
```bash
# Main commands
make build # Build images
make up # Start services
make down # Stop services
make restart # Restart
make logs # View logs
# Phoenix monitoring
make phoenix # Start with monitoring
make phoenix-down # Stop Phoenix
# Utilities
make shell # Enter the agent container
make clean # Clean up Docker resources
```
## 📋 Requirements
- **Docker**: For containerization
- **Make**: For command automation
- **MCP Server**: For tools (optional)
## 📄 License
This project is licensed under the MIT License. See the `LICENSE` file for details (if available).
## 🔗 Useful Links
- [Google ADK Documentation](https://developers.google.com/adk)
- [Model Context Protocol](https://modelcontextprotocol.io/)
- [LiteLLM Documentation](https://docs.litellm.ai/)
- [Phoenix Tracing](https://phoenix.arize.com/)