# `WardrikMCP.Servers`

Tracks a `WardrikMCP`'s servers and their tools.

It holds the servers it started with and those added at runtime. For servers with a
`credential_name`, it also holds the tools last listed.

Servers added at runtime are kept in the store. Each node re-reads the store on the
`:reconcile` interval. If a `:check` is given, it's called when a server is added and each time a
connection starts.

# `add`

```elixir
@spec add(atom(), String.t(), keyword()) :: :ok | {:error, String.t()}
```

Adds the server `name`. With a store, every node reaches it.

# `all`

```elixir
@spec all(atom()) :: %{required(String.t()) =&gt; WardrikMCP.Server.t()}
```

Returns every server, by name. Raises `ArgumentError` if `mcp` isn't started.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `listed`

```elixir
@spec listed(atom(), String.t(), [map()]) :: :ok
```

Stores the tools listed by a server reached with a credential.

# `reconcile`

```elixir
@spec reconcile(atom()) :: :ok
```

Re-reads the servers in the store now.

# `remove`

```elixir
@spec remove(atom(), String.t()) :: :ok | {:error, :not_found | String.t()}
```

Removes the server `name`. Only servers added at runtime can be removed.

# `start_link`

```elixir
@spec start_link(map()) :: GenServer.on_start()
```

Starts the server registry and the servers in `settings`.

# `tools`

```elixir
@spec tools(atom(), String.t()) :: [WardrikCore.Tool.t()]
```

Returns the tools of the server `name`.

---

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