# Codex

Connect Codex to the hosted pdf-mcp server. You need Codex CLI installed and a [pdf-mcp account](https://app.pdf-mcp.io).

## Add the server

Run this command in your terminal:

```bash
codex mcp add pdf-mcp --url https://api.pdf-mcp.io/mcp
```

## Sign in

Start OAuth authentication from your terminal:

```bash
codex mcp login pdf-mcp
```

Sign in to pdf-mcp in the browser, select your workspace, and approve access. Start a new Codex session and use `/mcp` to check the connection. Codex's [official MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) describes configuration, OAuth, and client registration.

## Manual configuration

You can also add this entry to `~/.codex/config.toml`, keeping existing settings:

```toml
[mcp_servers.pdf-mcp]
url = "https://api.pdf-mcp.io/mcp"
```

Then run `codex mcp login pdf-mcp` to authorize it.

### API-key alternative

For a setup that uses an API key, store the key in your environment as `PDF_MCP_API_KEY` and reference it by name:

```toml
[mcp_servers.pdf-mcp]
url = "https://api.pdf-mcp.io/mcp"
bearer_token_env_var = "PDF_MCP_API_KEY"
```

The environment variable must be available to the process that launches Codex. Use either this configuration or the OAuth configuration above. See [Authentication](https://pdf-mcp.io/docs/authentication#api-keys) to create a key for the intended workspace.

## Try it

> Use pdf-mcp to create a one-page PDF summarizing this project. Store it and return the browser view link.

Generation uses the connected workspace's [credits](https://pdf-mcp.io/credits). If the server connects but a tool fails, see [MCP troubleshooting](https://pdf-mcp.io/docs/mcp-server#troubleshooting).
