> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.markup.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.markup.ai/_mcp/server.

# Codex with Markup AI MCP

> Connect the OpenAI Codex CLI to the hosted Markup AI MCP server at api.markup.ai/mcp/ and run content agents from Codex.

Coding

## Overview

Connect the OpenAI Codex CLI to the hosted Markup AI MCP server at `https://api.markup.ai/mcp/`. Add the remote server to your Codex config and authenticate with either an interactive login or an API key.

You'll need a Markup AI account to continue. Sign up at [https://console.markup.ai/signup](https://console.markup.ai/signup).

> **Note**
>
> Codex adds remote MCP servers through its `config.toml` file (`~/.codex/config.toml`), not a `codex mcp add` command. Edit the file directly—or open it from the Codex IDE extension via the gear menu → **MCP settings → Open config.toml**.

## Add the Markup AI MCP Server to Codex

#### Log in with OAuth

#### Add the server

Add the Markup AI server to `~/.codex/config.toml`:

```toml
[mcp_servers.markup-ai]
url = "https://api.markup.ai/mcp/"
```

#### Authenticate

Run the OAuth login for the server and follow the browser prompt to log in to your Markup AI account:

```bash
codex mcp login markup-ai
```

#### Use an API key

#### Get your API key

1. Visit [https://console.markup.ai/signup](https://console.markup.ai/signup) and create an account.
2. Copy your API key from the console.

> **Info**
>
> Store your key securely. Prefer environment variables or a secrets manager over committing keys to code.

#### Export your key

Set an environment variable that holds your API key:

```bash
export MARKUP_AI_API_KEY="YOUR_API_KEY"
```

#### Add the server with a bearer token

Point Codex at the environment variable in `~/.codex/config.toml`. Codex reads the variable and sends it as an `Authorization: Bearer` header:

```toml
[mcp_servers.markup-ai]
url = "https://api.markup.ai/mcp/"
bearer_token_env_var = "MARKUP_AI_API_KEY"
```

> **Note**
>
> Use either OAuth or an API-key token—not both. If you set `bearer_token_env_var` and the server rejects it, Codex reports a failure rather than falling back to OAuth.

## Test Your Setup

Start a Codex session and try:

* "Check this announcement for brand-voice drift: \[paste text]"
* "Flag any hard-to-read sentences in this doc and rewrite them: \[paste text]"
* "List the available Markup AI agents."

## Troubleshooting

* Confirm the server URL is `https://api.markup.ai/mcp/`.
* If using an API key, make sure the environment variable named in `bearer_token_env_var` is exported in the shell where Codex runs.
* Restart Codex after editing `config.toml` so it reloads MCP servers.
* If a remote (`url`) server or `codex mcp login` isn't picked up, update Codex to the latest version—older builds only spoke stdio and need the Rust MCP client enabled with `experimental_use_rmcp_client = true` at the top level of `config.toml`.
* `codex mcp add` configures stdio (command-based) servers only; add remote HTTP servers by editing `config.toml` as shown above.

## Links

* Official Codex MCP docs: [https://developers.openai.com/codex/mcp](https://developers.openai.com/codex/mcp)