# `Condukt.MCP.Registry`
[🔗](https://github.com/tuist/condukt/blob/1.4.1/lib/condukt/mcp/registry.ex#L1)

Lifecycle helper for connecting to a list of MCP servers as part of
starting a session or executing a workflow.

`start_all/2` opens one `Condukt.MCP.Client` per server and discovers
the tools each one exposes. The returned registry value carries the
client pids and prebuilt `Condukt.Tool.Inline` specs ready to merge
into an agent or workflow tool list.

`stop_all/1` closes every connection in the registry. Tool inline
specs returned by `tools/1` capture the client pid in their `:call`
closure, so once stopped they will fail with a transport error.

# `entries`

Returns the entries in the registry. Useful for telemetry or
introspection.

# `new`

Returns an empty registry.

# `start_all`

Starts a `Condukt.MCP.Client` for each server in `servers`.

Servers may be `%Condukt.MCP.Server{}` structs or plain maps that
`Condukt.MCP.Server.normalize/1` can normalize. On the first failure
every already-started client is stopped before returning the error.

Options are forwarded to `Condukt.MCP.Client.start_link/2` (and
ultimately to the transports). Use `:fetch_env`, `:token_request`,
`:sse_request`, and `:http_request` to inject test doubles.

# `stop_all`

Stops every connection in the registry. Safe to call when the
registry is already empty or when individual clients have already
exited.

# `tool_map`

Returns a `tool_id => inline_spec` map suitable for the workflow
tool registry's `:tools` extension option.

# `tools`

Returns every inline tool spec exposed by the registry, flattened
into a single list ready to be appended to an agent's `tools` list.

---

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