Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion docs/integrations/agent-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,36 @@ For Google MCP servers, authentication headers are automatically passed in.
Headers set this way are applied to every request the toolset sends to the
MCP server. They do not affect calls to the Agent Registry API itself.

## Agent Identity API keys for MCP servers

If a registered MCP server has a Google Cloud Agent Identity API key binding,
you can format the credential for the header the server expects. The following
Python example uses the `registry` and `mcp_server_name` from
[Use with Agent](#use-with-agent). It sends the API key as
`Authorization: Bearer <token>`.

```python
my_mcp_toolset = registry.get_mcp_toolset(
mcp_server_name=mcp_server_name,
header_name="Authorization",
token_prefix="Bearer",
)
```

Set `header_name` without `token_prefix` to send the raw token in that header.
With a custom header, ADK sends the resolved token only in that header. The
same formatting applies if you set these options on an OAuth binding.
If you omit both options, ADK uses the provider's default header format.

For a credential header other than `Authorization`, register the final MCP
server URL, since ADK only follows redirects with the same scheme, hostname,
and port.

Use these options with automatic auth scheme resolution from the server's
binding. The same header formatting applies when Agent Registry resolves the
binding again after deployment. An explicit `auth_scheme` is incompatible with
these options.

## API Reference

=== "Python"
Expand All @@ -346,7 +376,10 @@ For Google MCP servers, authentication headers are automatically passed in.
- `get_mcp_server(self, name)`: Retrieves detailed metadata of a specific MCP
Server.
- `get_mcp_toolset(self, mcp_server_name)`: Constructs an ADK McpToolset
instance from a registered MCP Server.
instance from a registered MCP Server. To override the header for a
registry-resolved API key, pass `header_name` and, optionally,
`token_prefix`. A prefix requires an explicit header name. See
[Agent Identity API keys for MCP servers](#agent-identity-api-keys-for-mcp-servers).
- `list_agents(self, filter_str, page_size, page_token)`: Fetches a list of
registered A2A Agents.
- `get_agent_info(self, name)`: Retrieves detailed metadata of a specific A2A
Expand Down