Client libraries and ADK

To interact with Agent Registry programmatically, we recommend using the Agent Development Kit (ADK). The 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:

pip install --upgrade google-adk

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.