diff --git a/README.md b/README.md index 4bee981..4281b2a 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ Once installed, you can talk to Gemini in natural language: ## Prerequisites -- [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) version **560.0.0** or higher (minimum). -- `gcloud alpha` component version **2026.03.09** or higher (minimum). -- **Google ADK** version **1.26.0** or higher (minimum) for Python integration. +- [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) version **565.0.0** or higher (minimum). +- `gcloud alpha` component version **2026.04.10** or higher (minimum). +- **Google ADK** version **1.31.0** or higher (minimum) for Python integration. - Proper permissions to access Agent Registry in your Google Cloud project. ## Permissions diff --git a/agent-registry/SKILL.md b/agent-registry/SKILL.md index c3e6183..40dfaac 100644 --- a/agent-registry/SKILL.md +++ b/agent-registry/SKILL.md @@ -148,6 +148,39 @@ Used to configure Kubernetes deployments to be registered as an Agent or MCP Ser ./scripts/annotate_gke.py /path/to/folder_or_file.yaml --type AGENT ``` +### 5. Bindings +Used to connect a source agent to a target resource (another agent, MCP server, or endpoint) or an auth provider for delegated permissions. + +```bash +# Create a binding to connect a source agent to a target resource +gcloud alpha agent-registry bindings create BINDING_NAME \ + --location=us-central1 \ + --display-name="My Custom Binding" \ + --source-identifier="SOURCE_ID" \ + --target-identifier="TARGET_ID" + +# Create a binding for delegated permissions (using an auth provider) +gcloud alpha agent-registry bindings create BINDING_NAME \ + --location=us-central1 \ + --display-name="Auth Provider Binding" \ + --source-identifier="SOURCE_ID" \ + --auth-provider="projects/PROJECT_ID/locations/REGION/connectors/AUTH_PROVIDER_ID" + +# List Bindings +gcloud alpha agent-registry bindings list --location=us-central1 + +# View Binding Details +gcloud alpha agent-registry bindings describe BINDING_NAME --location=us-central1 + +# Update a Binding +gcloud alpha agent-registry bindings update BINDING_NAME \ + --display-name="New Display Name" \ + --location=us-central1 + +# Delete a Binding +gcloud alpha agent-registry bindings delete BINDING_NAME --location=us-central1 +``` + ## Agent Dashboard The Agent Dashboard provides a consolidated view of all agents in the current project, searching across both `global` and the regional location (default: `us-central1`). @@ -191,6 +224,7 @@ All commands support `--location` (required) and `--project` (optional). | `mcp-servers` | `list`, `describe`, `search` | | `endpoints` | `list`, `describe` | | `services` | `create`, `list`, `describe`, `update`, `delete` | +| `bindings` | `create`, `list`, `describe`, `update`, `delete` | | `operations` | `list`, `describe` | ### Service Creation Flags @@ -238,6 +272,10 @@ All commands support `--location` (required) and `--project` (optional). | "Search for agents by skill name model" | `gcloud alpha agent-registry agents search --location=us-central1 --search-string="skills.name:model"` | | "Search for agents with display name containing Assessor" | `gcloud alpha agent-registry agents search --location=us-central1 --search-string="displayName:Assessor*"` | | "Search for MCP servers containing the display name GitHub" | `gcloud alpha agent-registry mcp-servers search --location=us-central1 --search-string="displayName:GitHub*"` | +| "Create a binding between agent A and server B" | `gcloud alpha agent-registry bindings create my-binding --source-identifier="URN_A" --target-identifier="URN_B" --location=us-central1` | +| "List all bindings" | `gcloud alpha agent-registry bindings list --location=us-central1` | +| "Show details for binding X" | `gcloud alpha agent-registry bindings describe X --location=us-central1` | +| "Delete binding Y" | `gcloud alpha agent-registry bindings delete Y --location=us-central1` | --- diff --git a/agent-registry/references/adk-docs.md b/agent-registry/references/adk-docs.md index 8bf0e5e..d848888 100644 --- a/agent-registry/references/adk-docs.md +++ b/agent-registry/references/adk-docs.md @@ -31,6 +31,20 @@ The [Agent Registry](https://docs.cloud.google.com/agent-registry/overview) inte pip install google-adk ``` +### Optional Dependencies + +To use the full capabilities of the AgentRegistry integration, you may need to install additional extras depending on your use case: + +- **For A2A (Agent-to-Agent) Support**: If you plan to use `get_remote_a2a_agent` or interact with remote A2A-compliant agents, install the `a2a` extra: + ```bash + pip install "google-adk[a2a]" + ``` + +- **For Agent Identity (GCP Auth Provider)**: If you need to use the `GcpAuthProvider` (e.g., when `get_mcp_toolset` automatically resolves authentication via IAM bindings for registered MCP servers), install the `agent-identity` extra: + ```bash + pip install "google-adk[agent-identity]" + ``` + ## Use with Agent The primary way to use the Agent Registry integration within an ADK agent is to dynamically fetch remote agents or toolsets using the AgentRegistry client. @@ -83,7 +97,58 @@ main_agent = LlmAgent( ) ``` -## Available Tools +## Authentication for Google MCP Servers and Remote A2A Agents + +### Remote A2A Agents +If you are connecting to a Google A2A agent, you need to pass an `httpx.AsyncClient` configured with Google authentication headers to the `get_remote_a2a_agent` method. + +Example: +```python +import httpx +import google.auth +from google.auth.transport.requests import Request + +class GoogleAuth(httpx.Auth): + def __init__(self): + self.creds, _ = google.auth.default() + + def auth_flow(self, request): + if not self.creds.valid: + self.creds.refresh(Request()) + request.headers["Authorization"] = f"Bearer {self.creds.token}" + yield request + +httpx_client = httpx.AsyncClient(auth=GoogleAuth(), timeout=httpx.Timeout(60.0)) + +remote_agent = registry.get_remote_a2a_agent( + f"projects/{project_id}/locations/{location}/agents/YOUR_AGENT_ID", + httpx_client=httpx_client, +) +``` + +### Google MCP Servers +For Google MCP servers, authentication headers are automatically passed in. However, if automatic authentication is not working as expected, you can manually provide headers using the `header_provider` argument in the `AgentRegistry` constructor. + +Example: +```python +import google.auth +from google.auth.transport.requests import Request +from google.adk.integrations.agent_registry import AgentRegistry + +def google_auth_header_provider(context): + creds, _ = google.auth.default() + if not creds.valid: + creds.refresh(Request()) + return {"Authorization": f"Bearer {creds.token}"} + +registry = AgentRegistry( + project_id=project_id, + location=location, + header_provider=google_auth_header_provider +) +``` + +## API Reference The AgentRegistry class provides the following core methods: diff --git a/agent-registry/references/gcloud-command.md b/agent-registry/references/gcloud-command.md index e4a178a..7368f5f 100644 --- a/agent-registry/references/gcloud-command.md +++ b/agent-registry/references/gcloud-command.md @@ -25,6 +25,9 @@ GROUPS agents (ALPHA) Manage Agent resources. + bindings + (ALPHA) Manage Binding resources. + endpoints (ALPHA) Manage Endpoint resources. @@ -141,6 +144,42 @@ OPTIONAL FLAGS ``` +### bindings + +```text +NAME + gcloud alpha agent-registry bindings - manage Binding resources + +SYNOPSIS + gcloud alpha agent-registry bindings COMMAND [GCLOUD_WIDE_FLAG ...] + +DESCRIPTION + (ALPHA) Manage Binding resources. + +GCLOUD WIDE FLAGS + These flags are available to all commands: --help. + + Run $ gcloud help for details. + +COMMANDS + COMMAND is one of the following: + + create + (ALPHA) Create bindings. + + delete + (ALPHA) Delete bindings. + + describe + (ALPHA) Describe bindings. + + list + (ALPHA) List bindings. + + update + (ALPHA) Update bindings. +``` + ### endpoints ```text