# `MingaAgent.MCP.ServerRegistry`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/mcp/server_registry.ex#L1)

Source-owned registry for MCP server declarations.

This is declaration metadata, not the per-provider live client registry. Native providers read this registry to build their MCP config list and keep active sessions synchronized when extension MCP contributions are removed or reloaded.

# `entry`

```elixir
@type entry() :: %{
  source: source(),
  id: String.t(),
  config: MingaAgent.MCP.ServerConfig.t()
}
```

Registry entry for one MCP server declaration.

# `source`

```elixir
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
```

Source that contributed MCP server declarations.

# `state`

```elixir
@type state() :: [entry()]
```

# `configs`

```elixir
@spec configs() :: [MingaAgent.MCP.ServerConfig.t()]
```

Returns all registered MCP configs in deterministic registration order.

# `entries`

```elixir
@spec entries() :: [entry()]
```

Returns registry entries in deterministic registration order.

# `register_many`

```elixir
@spec register_many(source(), [{atom() | String.t(), keyword()}], keyword()) :: :ok
```

Registers a source-owned batch of MCP declarations. Same-source batches replace prior entries.

# `resolve_configs`

```elixir
@spec resolve_configs(
  [MingaAgent.MCP.ServerConfig.t()],
  keyword()
) :: [MingaAgent.MCP.ServerConfig.t()]
```

Resolves config-owned and registry-owned MCP configs with deterministic first-owner collision handling.

# `start_link`

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

Starts the MCP server declaration registry.

# `unregister_source`

```elixir
@spec unregister_source(source()) :: :ok
```

Removes all MCP server declarations owned by a source.

---

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