# `Codex.MCP.Config`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/mcp/config.ex#L1)

Helpers for managing MCP server configuration through app-server config APIs.

# `connection`

```elixir
@type connection() :: Codex.AppServer.connection()
```

# `server_config`

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

# `add_server`

```elixir
@spec add_server(connection(), String.t(), map() | keyword(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Adds or replaces an MCP server entry under `mcp_servers.<name>`.

The `attrs` map should include either a stdio launcher (`command`) or a
streamable HTTP URL (`url`).

# `list_servers`

```elixir
@spec list_servers(
  connection(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists configured MCP servers from the app-server config.

## Options

  * `:include_layers` - include layered config metadata (passed to `config/read`)
  * `:app_server` - override the module used for config calls (defaults to `Codex.AppServer`)

# `remove_server`

```elixir
@spec remove_server(connection(), String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Removes a configured MCP server entry.

---

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