Get the FREE Ultimate OpenClaw Setup Guide →

adk-python -client

Demo of ADK (Agent Development Kit) as an MCP (Model Context Protocol) client for flight search capabilities.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio arjunprabhulal-adk-python-mcp-client python -m adk_python_mcp_client

How to use

This MCP client demonstrates how the ADK (Agent Development Kit) acts as an MCP client to a flight search MCP server. It uses dynamic tool discovery to learn which capabilities the MCP server exposes (such as flight search, price checks, or multi-city routing) and then invokes those tools in a type-safe way through MCP function calls. The integration relies on ADK’s LLM-driven agent orchestration to select the appropriate tool, call it with structured inputs, and incorporate the results into the ongoing conversation with the user. Expect an asynchronous, event-driven flow where the agent maintains session context and efficiently shares data between the Gemini-based LLM and the external flight data services offered by the MCP server.

How to install

Prerequisites:

  • Python 3.8+ installed
  • Access to Google Gemini API (or equivalent GenAI service) with API key
  • SerpAPI key for live flight data

Step 1: Create and activate a virtual environment

python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate

Step 2: Install required packages

pip install google-adk            # ADK framework
pip install mcp-flight-search      # MCP server client package
pip install google-generativeai python-dotenv  # GenAI SDK and dotenv support

Step 3: Set environment variables

export GOOGLE_API_KEY="your-google-api-key"   # Gemini API key
export SERP_API_KEY="your-serpapi-key"         # SerpAPI key

Step 4: Run the MCP client (this repository)

# From project root
python -m adk_python_mcp_client

Additional notes

Tips and considerations:

  • Ensure your Google Gemini (GenAI) access is properly provisioned; the client uses the Gemini LLM through the Google Generative AI SDK.
  • The MCP server (e.g., mcp-flight-search) must be reachable from the client’s environment and must expose flight-related tools compatible with ADK tool invocation.
  • Use the dynamic tool discovery feature to gracefully handle breaking changes on the MCP server—if new tools appear or existing ones change, the client should adapt without code changes.
  • Manage session state with InMemorySessionService or swap in a persistent store for longer conversations.
  • Properly handle resource lifecycle: ensure clean shutdowns, exit stacks, and closing of MCP connections to avoid leaks.
  • If you encounter tool invocation errors, enable verbose logging in ADK to inspect tool schemas, input shapes, and return types from the MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers