Client libraries and ADK

To interact with Agent Registry programmatically, you can use Google Cloud client libraries or the Agent Development Kit (ADK).

Use the Google Cloud client libraries to manage Agent Registry resources using standard, idiomatic Google Cloud APIs. Use the ADK if you are building, evaluating, and deploying orchestration agents.

Client libraries

Google Cloud client libraries are the recommended way to call the Agent Registry API programmatically. Client libraries use the latest features of Agent Registry, provide an idiomatic experience for your supported programming language, and automatically handle authentication, retry logic, and pagination.

The Agent Registry API is supported in the following languages:

Google Cloud client libraries fully support VPC Service Controls, providing secure data perimeters for your API interactions.

Agent Development Kit

The Agent Development Kit (ADK) is an open-source Python framework for building, evaluating, and deploying AI agents.

The ADK provides abstractions for Agent Registry, automatically resolves connection details, and handles authentication to produce ADK components that are ready to use. By using the ADK, your orchestration agents can dynamically resolve endpoints, discover agent skills, and retrieve MCP tools managed within Agent Registry.

Install the ADK

Install or upgrade to the latest version of the ADK with the necessary A2A dependencies:

pip

pip install --upgrade "google-adk[a2a]"

uv

uv add "google-adk[a2a]"

You must upgrade to at least google-adk>=1.29.0.

Python API reference

Review the Python API reference documentation for the ADK:

Use the ADK with Agent Registry

You can use the AgentRegistry client provided in the ADK to perform lookups and manage your resources from your Python code.

To follow the example in this guide, you must set up environment variables:

export GOOGLE_CLOUD_PROJECT=PROJECT_ID
export GOOGLE_CLOUD_LOCATION=LOCATION

Replace the following:

  • PROJECT_ID: your project ID.
  • LOCATION: the registry region or location, such as us-central1.

The following example demonstrates how to initialize the client, discover agents, and dynamically instantiate an MCP toolset directly from the registry:

import os
from google.adk.integrations.agent_registry.agent_registry import AgentRegistry

# Initialize the client targeting the specified management scope
project_id = os.environ.get("GOOGLE_CLOUD_PROJECT")
location = os.environ.get("GOOGLE_CLOUD_LOCATION", "global")

registry = AgentRegistry(
    project_id=project_id,
    location=location
)

# Discover agents by a required skill, for example, translation
translator_agents = registry.list_agents(
    filter_str='skills.tags:"translation"'
)

# Connect to a remote A2A agent using its resource name in short or full format
# Short formats automatically imply the client's configured project and location
# Short format: "agents/AGENT_ID"
# Full format: f"projects/{project_id}/locations/{location}/agents/AGENT_ID"
agent_name = "agents/AGENT_ID"
summarizer_agent = registry.get_remote_a2a_agent(
    agent_name=agent_name
)

# Retrieve an MCP toolset using its resource name in short or full format
# Short formats automatically imply the client's configured project and location
# Short format: "mcpServers/SERVER_ID"
# Full format: f"projects/{project_id}/locations/{location}/mcpServers/SERVER_ID"
mcp_server_name = "mcpServers/SERVER_ID"
bq_toolset = registry.get_mcp_toolset(
    mcp_server_name=mcp_server_name
)

Replace the following:

  • AGENT_ID: your agent ID, for example, agentregistry-1234-abcd.
  • SERVER_ID: the MCP server ID, for example, agentregistry-5678-efgh.

For detailed task-based instructions on how to use the ADK to build dynamic agent workflows, see Integrate Agent Registry with ADK.