# Codex

URL: https://codepanel.ai/docs/codex

Connect OpenAI Codex (CLI, IDE extension and app) to CodePanel with one config.toml entry, a sign-in and the review-loop skills.

The Codex CLI, IDE extension and desktop app share `~/.codex/config.toml`, so one entry connects all three.

> [!NOTE]
> Do the [Quickstart](/docs/quickstart) up to adding a provider key first. Codex cannot add provider keys or change spending limits.

## Setup

### 1. Add the MCP server

```toml tab="Sign in" title="~/.codex/config.toml"
[mcp_servers.codepanel]
url = "https://codepanel.ai/mcp"
```

```toml tab="Token" title="~/.codex/config.toml"
[mcp_servers.codepanel]
url = "https://codepanel.ai/mcp"
http_headers = { Authorization = "Bearer cpk_..." }
```

```toml tab="Token from env" title="~/.codex/config.toml"
[mcp_servers.codepanel]
url = "https://codepanel.ai/mcp"
bearer_token_env_var = "CODEPANEL_TOKEN"
```

Restart the desktop app after editing. An app started from the Dock or Start menu may not see shell variables such as `CODEPANEL_TOKEN`.

### 2. Sign in

Skip this step with a token.

```bash
codex mcp login codepanel
```

Approve on CodePanel's consent page, unticking any permissions you don't want to give. `codex mcp list`, or `/mcp` in Codex, shows the server.

### 3. Add the skills

```bash
npx skills add Code-Panel-AI/codepanel-tools
```

Choose Codex and both skills: `codepanel` (the review loop) and `codepanel-setup`. Codex reads skills from `.agents/skills` in the repository and `~/.agents/skills`. To install by hand, copy `plugins/codepanel/skills/` from the [codepanel-tools repository](https://github.com/Code-Panel-AI/codepanel-tools) into `.agents/skills/`.

### 4. Set up the repository

Ask Codex to use the `codepanel-setup` skill. It writes `.codepanel/rules.md` from your `AGENTS.md`, adds the review loop to it, and opens one pull request. Or paste the [Repository setup](/docs/agent-setup) prompt.

## Verify

Ask Codex: "Use the CodePanel whoami tool." It answers with your GitHub account and its permissions. Then: "Read CodePanel's review of owner/name#123." If either fails, see [Troubleshooting](/docs/coding-agents#troubleshooting).

## Share with your team

Commit the skills in `.agents/skills/` and the review loop in `AGENTS.md` (where the setup skill writes it). Each person adds the MCP entry to their own `config.toml` and signs in with their own GitHub account.
