Content
# MCP ADK A2A Integration Patterns
This repository showcases a collection of integration patterns demonstrating how client applications, particularly AI agents built with the Google Agent Development Kit (ADK), can interact with backend services exposed via the Model Context Protocol (MCP).
## Core Concepts
* **Model Context Protocol (MCP):** A lightweight, session-based protocol designed for interoperability between different software components, often used for exposing tools and resources from backend services.
* **Google Agent Development Kit (ADK):** A framework for building AI agents that can leverage large language models and external tools.
* **Agent-to-Agent (A2A) / Agent-to-Service:** This repository focuses on patterns where an ADK agent (client) communicates with MCP servers to perform tasks, effectively allowing the agent to use external capabilities.
## Repository Structure
This repository is organized as follows:
* `clients/`: Contains example client applications.
* `google-adk-agent/`: An AI agent built with Google ADK that connects to multiple MCP servers to provide weather information and database interaction capabilities.
* `servers/`: Contains example MCP server implementations.
* `postgresql/`: An MCP server that exposes a PostgreSQL database, allowing clients to retrieve schema information and execute read-only SQL queries.
* `weather-api/`: An MCP server that provides current weather information by interfacing with the Open-Meteo API.
* `.env`: (At the root) May contain shared environment variables if applicable, though individual components often have their own `.env` files for specific configurations.
## Overall Prerequisites
* Python 3.10 or higher.
* [uv](https://github.com/astral-sh/uv): A fast Python package installer and virtual environment manager. Ensure it's installed and available in your PATH.
## Getting Started
1. **Clone the Repository:**
```bash
git clone https://github.com/your-username/mcp-adk-a2a-integration-patterns.git
cd mcp-adk-a2a-integration-patterns
```
2. **Virtual Environments:**
It is highly recommended to use virtual environments for each component or for the entire project. `uv` makes this easy:
```bash
uv venv # Creates a .venv in the current directory
source .venv/bin/activate # On Linux/macOS
# .\.venv\Scripts\activate # On Windows
```
You can create separate virtual environments within each component's directory or use a single one at the root, installing all dependencies there.
## Component-Specific Instructions
For detailed setup, configuration, and usage instructions for each component, please refer to their respective README files:
* **Google ADK Agent:** [clients/google-adk-agent/README.md](./clients/google-adk-agent/README.md)
* **PostgreSQL MCP Server:** [servers/postgresql/README.md](./servers/postgresql/README.md)
* **Weather API MCP Server:** [servers/weather-api/README.md](./servers/weather-api/README.md)
## License
(MIT License, Apache 2.0.)