# Codex

Codex connects to blink artifacts through its config file and reads the token from an environment variable, so the token never sits in the file.

## Add the server

Add this to `~/.codex/config.toml`:

```toml
[mcp_servers.blink-artifact]
url = "https://artifact.blinkbrosai.com/mcp"
bearer_token_env_var = "BLINK_ARTIFACT_TOKEN"
```

## Set the token

Create a token in the app under **Agent connection** and export it in the shell you start Codex from:

```bash
export BLINK_ARTIFACT_TOKEN=<TOKEN>
```

To keep it across sessions, add the line to your shell profile. Then start a new Codex session so it loads the tools.

## Listening for questions

Codex may not wake up when a background process prints, so the listener for the `codex` harness works in two parts: one command follows the stream in a background terminal and appends questions to an inbox file, and another command reads the unread questions at the start of each turn. Ask Codex to listen for questions; `get_listener` returns the exact commands. See [Listener & asks_wait](/docs/listener).

## The artifact link under the prompt

Codex does not support a custom status line yet, so it cannot show the `⧉ <title>` link that Claude Code, Copilot CLI and Antigravity show. The agent still prints the artifact's URL after each publish.

## Plugins

Codex also has plugins that can bundle an MCP server, but a plugin manifest declares connection settings, not secret credentials. Keeping the server in `config.toml` with `bearer_token_env_var` keeps your token out of any file you share.
