# `ExAthena.Mcp.Config`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/mcp/config.ex#L1)

Loads and validates MCP server configuration.

Reads from `Application.get_env(:ex_athena, :mcp_servers, %{})`. The raw
config mirrors OpenCode's JSONC shape — string or atom keys, `"local"` or
`:local` for type — so udin_code can map its JSONC directly.

## Example

    config :ex_athena, :mcp_servers, %{
      "fetch" => %{
        type: :local,
        command: ["uvx", "mcp-server-fetch"],
        environment: %{"FOO" => "bar"},
        enabled: true
      },
      "github" => %{
        type: :remote,
        url: "https://api.example.com/mcp",
        headers: %{"Authorization" => "Bearer …"},
        enabled: true
      }
    }

# `load`

```elixir
@spec load(map() | nil) ::
  {:ok, [ExAthena.Mcp.Config.Server.t()]} | {:error, ExAthena.Error.t()}
```

Load server configs from `raw` (defaults to `Application.get_env(:ex_athena, :mcp_servers, %{})`).

Returns `{:ok, [%Server{}]}` or `{:error, %ExAthena.Error{}}`.

# `to_client_opts`

```elixir
@spec to_client_opts(ExAthena.Mcp.Config.Server.t()) :: keyword()
```

Convert a `%Server{}` to keyword opts suitable for `ExAthena.Mcp.Client.start_link/1`.

---

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