# `ExMCP.ACP.Registry`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/acp/registry.ex#L1)

Helpers for the public ACP agent registry.

The registry is distributed as JSON and lists ACP-compatible agents plus
their distribution metadata. These helpers keep ExMCP clients from having to
hard-code the CDN URL or common lookup details.

# `agent`

```elixir
@type agent() :: map()
```

# `registry`

```elixir
@type registry() :: map()
```

# `agents`

```elixir
@spec agents(registry()) :: [agent()]
```

Returns all agent entries in a decoded registry map.

# `default_url`

```elixir
@spec default_url() :: String.t()
```

Returns the public ACP registry URL.

# `distribution`

```elixir
@spec distribution(agent(), String.t() | atom()) :: map() | nil
```

Returns a distribution entry such as `"npx"` or `"binary"`.

# `fetch`

```elixir
@spec fetch(keyword()) :: {:ok, registry()} | {:error, any()}
```

Fetches and decodes the ACP registry.

Options:

- `:url` - registry URL, defaults to the public latest registry.
- `:timeout` - request timeout in milliseconds, defaults to 15 seconds.
- `:headers` - additional HTTP request headers.
- `:http_client` - test hook taking `(url, headers, timeout)` and returning
  `{:ok, body}` or `{:error, reason}`.

# `find_agents`

```elixir
@spec find_agents(registry(), String.t()) :: [agent()]
```

Searches agent id, name, and description fields case-insensitively.

# `get_agent`

```elixir
@spec get_agent(registry(), String.t()) :: agent() | nil
```

Finds an agent by exact id or name, falling back to case-insensitive lookup.

# `npx_command`

```elixir
@spec npx_command(agent()) ::
  {:ok, [String.t()]} | {:error, :npx_distribution_not_found}
```

Builds an `npx` command from an agent registry entry.

Returns `{:error, :npx_distribution_not_found}` when the agent does not have
an `npx` distribution.

# `parse`

```elixir
@spec parse(iodata()) :: {:ok, registry()} | {:error, Jason.DecodeError.t()}
```

Decodes registry JSON.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
