SkillAgentSearch skills...

MCP AI Agent

AI Agent built with Google ADK that leverages Google Maps MCP Server to answer real-world location questions with tool usage and traceable execution via Opik.

Install / Use

/learn @luuisotorres/MCP AI Agent

README

MCP AI Agent with Google ADK, Google Maps, and Opik

<p align="left"> <img src="https://img.shields.io/badge/Python-3.11-blue?logo=python&logoColor=white" alt="Python"> <img src="https://img.shields.io/badge/OpenAI-GPT--4o-ffbb00?logo=openai&logoColor=black" alt="OpenAI GPT-4o"> <img src="https://img.shields.io/badge/Google%20Maps-MCP%20Server-4285F4?logo=googlemaps&logoColor=white" alt="Google Maps MCP Server"> <img src="https://img.shields.io/badge/CometML-Opik-FF6F00?logo=comet&logoColor=white" alt="Opik / CometML"> <img src="https://img.shields.io/badge/ADK-Google%20Agent%20Development%20Kit-34A853?logo=google&logoColor=white" alt="Google ADK"> </p>

Video Demonstration

<div align="center"> <a href="https://www.youtube.com/watch?v=fh0lkWitz2E"> <img src="https://img.youtube.com/vi/fh0lkWitz2E/maxresdefault.jpg" alt="Watch the Demo" style="width:80%;"> </a> <br> <i>Click the image above to watch the demo on YouTube</i> </div> <br />

This project demonstrates the creation of an <b>AI Agent</b> using the <b>Google Agent Development Kit (ADK)</b>, <b>OpenAI's GPT-4o model</b>, the <b>Google Maps MCP Server</b>, and <b>Opik</b> for observability with <b>Comet.ml</b>.

The primary goal of this project is to deepen my understanding of <b>Agent Development principles</b>, the application of the Model Context Protocol in practice, and how to integrate its tools and services into an <b>AI Agent</b> for enhanced abilities beyond the training data.

This project is largely inspired by Santiago Valdarrama's tutorial on YouTube:

Table of Contents

Key Technologies

Google Agent Development Kit (ADK)

ADK logo

The Google Agent Development Kit (ADK) is a Python framework designed to simplify the development of <b>AI Agents</b> powered by LLMs. It provides access to <b>tools</b>, <b>memory</b>, <b>agent orchestration</b> and LLMs from providers like OpenAI, Anthropic, Cohere and many others through integration with the LiteLlm library. The ADK also includes a <b>web UI</b> for interacting with and debugging agents.

Opik & CometML

Opik is an open-source observability solution for LLM applications, built by Comet. It allows you to <b>trace</b>, <b>visualize</b>, and <b>debug</b> the interactions within your AI Agents, including <b>LLM calls</b>, <b>tool usage</b>, and other operations. In this project, Opik is configured to send traces to CometML, providing a rich UI to inspect agent behavior.

Model Context Protocol (MCP)

MCP

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs and connect them to different <b>data sources</b> and <b>tools</b>. It defines a schema for <b>tool descriptions</b>, <b>invocations</b>, and <b>responses</b>. This allows for interoperability between different LLM systems and tool providers.

Google Maps MCP Server

The Google Maps MCP Server is a Node.js application that exposes Google Maps Platform APIs as MCP tools. This allows an <b>ADK Agent</b> to easily leverage Google Maps features to deliver more relevant, context-aware responses.

  • How it runs: The ADK's MCPToolset can automatically start this server using npx if it's not already running, as configured in this project.
  • Main Tools Exposed:
    • maps_directions: Get driving, walking, or cycling directions.
    • maps_geocode: Convert addresses to geographic coordinates.
    • maps_reverse_geocode: Convert geographic coordinates to addresses.
    • maps_elevation: Get elevation for a given coordinate.
    • maps_search_places: Search for places (e.g., restaurants, landmarks).
    • maps_place_details: Get detailed information about a specific place.
    • maps_distance_matrix: Calculate travel time and distance between multiple origins and destinations.

Project Structure

.
├── assets
│   └── screenshots
│       ├── interface.png
│       ├── maps_direction_tool_input_output.png
│       ├── maps_direction_tool_opik.png
│       ├── maps_direction_tool.png
│       ├── maps_directions_tool_events.png
│       ├── maps_elevation_tool.png
│       ├── maps_place_details_event.png
│       ├── maps_reverse_geocode_event.png
│       ├── opik_overall_input_output.png
|       ├── adk.png
|       ├── mcp.png
│       └── opik_traces.png
├── examples
│   └── agent_conversation.yaml
├── LICENSE
├── mcp_agent
│   ├── __init__.py
│   └── agent.py
├── pyproject.toml
├── README.md
└── uv.lock

Project Setup and Installation

Prerequisites

  • Python 3.11
  • uv (Python package and virtual environment manager)
  • Node.js and npm / npx (required to run the Google Maps MCP Server, which the ADK will start via npx)
  • A Google Maps Platform API Key?
  • An OpenAI API Key.
  • CometML API Key, Project ID, and Workspace.

Installation Steps

  1. Clone the repository:

    git clone https://github.com/luuisotorres/mcp-ai-agent.git
    cd mcp-ai-agent
    
  2. Create and sync the virtual environment using UV:

    uv venv  # Create a virtual environment (e.g., .venv)
    uv sync  # Install dependencies from pyproject.toml
    source .venv/bin/activate # Or `.\.venv\Scripts\activate` on Windows
    
  3. Set up environment variables: Copy the example environment file and fill in your credentials:

    cp .env.example .env
    

    Then, edit .env with your actual API keys.

Environment Variables

GOOGLE_MAPS_PLATFORM_API_KEY="your-google-maps-api-key"
OPENAI_API_KEY="your-openai-api-key"
COMET_API_KEY="your-comet-api-key"
COMET_WORKSPACE="your-comet-workspace"
COMET_PROJECT_NAME="your-comet-project-name"

The .env file should contain:

  • GOOGLE_MAPS_PLATFORM_API_KEY: Your Google Maps Platform API key.
    • Purpose: Allows the Google Maps MCP Server to make requests to Google Maps APIs.
  • OPENAI_API_KEY: Your OpenAI API key.
    • Purpose: Allows the LiteLlm model to use OpenAI's GPT models.
  • COMET_API_KEY: Your CometML API Key.
    • Purpose: For Opik to send traces to your CometML project.
  • COMET_WORKSPACE: Your CometML workspace.
  • COMET_PROJECT_NAME: The CometML project name where traces will be stored.

Running the Agent

Once the setup is complete, run the ADK web UI:

uv run adk web

This command will:

  1. Start a FastAPI server.
  2. Provide a web interface at http://127.0.0.1:8000 to interact with your agent.
  3. The MCPToolset in agent.py is configured to start the Google Maps MCP server via npx automatically when the agent needs to use its tools.

Screenshots & Usage

ADK Web UI

Upon running uv run adk web and navigating to http://127.0.0.1:8000 (or the port shown in your terminal), you'll see the ADK Web UI. You can select your Agent, in this case mcp_agent, and start a conversation.

(Screenshot 1: The initial ADK Web UI screen with the chat input.) ADK Web UI Caption: The main interface of the ADK Web UI where you can type messages to your agent.

Agent Using Tools

The agent can understand requests for directions, place details, elevation, and more, using the <b>tools</b> from the <b>Google Maps MCP Server</b>.

Example: Getting Directions The agent responds to "How do I drive from São Paulo to Campinas?" with turn-by-turn directions.

(Screenshot 2: Agent using the maps_directions tool.) Agent Directions Caption: The agent successfully uses the maps_directions tool to provide driving directions in the chat interface.

Example: Getting Place Details The agent can fetch reviews and other information for landmarks.

(Screenshot 3: Agent using maps_place_details for Eiffel Tower reviews.) Place Details Event/UI Caption: Agent fetching and displaying reviews for the Eiffel Tower, showcasing the maps_place_details tool usage and output.

Example: Getting Elevation The agent can provide elevation for given coordinates.

(Screenshot 4: Agent using maps_elevation tool.) ![Elevation Tool UI](assets/screens

View on GitHub
GitHub Stars8
CategoryDevelopment
Updated22h ago
Forks2

Languages

Python

Security Score

90/100

Audited on Apr 10, 2026

No findings