> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Connect Codex (OpenAI) to the Sevalla MCP server with OAuth or API key authentication.

Use this guide to connect Codex to the Sevalla MCP server at `https://mcp.sevalla.com/mcp`.

After setup, Codex can use Sevalla MCP tools such as `search` and `execute`.

## Quick setup (CLI + OAuth)

OAuth is the recommended authentication method.

1. Add the remote MCP server:

```bash theme={null}
codex mcp add sevalla --url https://mcp.sevalla.com/mcp
```

2. Authenticate with OAuth:

```bash theme={null}
codex mcp login sevalla
```

3. Verify configuration:

```bash theme={null}
codex mcp list
```

## Manual configuration (`config.toml`)

Codex uses TOML (not JSON) for MCP configuration.

You can configure MCP servers in:

* `~/.codex/config.toml` (user scope)
* `.codex/config.toml` (project scope, trusted projects only)

```toml theme={null}
[mcp_servers.sevalla]
url = "https://mcp.sevalla.com/mcp"
```

If you need API key auth instead of OAuth, pass an auth header from an environment variable:

```toml theme={null}
[mcp_servers.sevalla]
url = "https://mcp.sevalla.com/mcp"
env_http_headers = { Authorization = "SEVALLA_AUTH_HEADER" }
```

```bash theme={null}
export SEVALLA_AUTH_HEADER="Bearer <your-api-key>"
```

<Warning>
  Do not hardcode secrets in `config.toml`. Keep API keys in environment variables.
</Warning>

## Configuration scope

* User scope: `~/.codex/config.toml`, available in all projects.
* Project scope: `.codex/config.toml`, loaded only when the project is trusted.

Project settings override user settings for matching keys.

## Uninstall

Run the following:

```bash theme={null}
codex mcp remove sevalla
```

## Reference

* Sevalla MCP endpoint: `https://mcp.sevalla.com/mcp`
* Sevalla MCP repository: [github.com/sevalla-hosting/mcp](https://github.com/sevalla-hosting/mcp)
