MCP ExplorerExplorer

Adk Mcp A2a Patterns

@ethirajon 10 months ago
1 MIT
FreeCommunity
AI Systems
Examples of ADK agents integrating with MCP servers

Overview

What is Adk Mcp A2a Patterns

adk-mcp-a2a-patterns is a repository that showcases integration patterns for AI agents built with the Google Agent Development Kit (ADK) to interact with backend services using the Model Context Protocol (MCP).

Use cases

Use cases include AI agents providing weather updates, interacting with databases for data retrieval, and integrating various backend services to enhance functionality.

How to use

To use adk-mcp-a2a-patterns, clone the repository, ensure you have Python 3.10 or higher and the required dependencies installed. You can then explore the example client applications and MCP server implementations provided in the repository.

Key features

Key features include a collection of client applications demonstrating how ADK agents can communicate with MCP servers, examples of various MCP server implementations, and the ability to perform tasks such as retrieving weather information and executing SQL queries.

Where to use

adk-mcp-a2a-patterns can be used in fields such as AI development, backend service integration, and applications requiring real-time data retrieval and processing.

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: A fast Python package installer and virtual environment manager. Ensure it’s installed and available in your PATH.

Getting Started

  1. Clone the Repository:

    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:

    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:

License

(MIT License, Apache 2.0.)

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers