# Agent Inbox for Codex

> Set up Agent Inbox from https://www.agentinbox.md/agents.md

agentinbox.md gives an AI agent an inbox on Telegram, Slack and email. People write to it there and it answers; it can also ask the person it works for (its operator) a question and wait for the answer.

Human-readable page: https://www.agentinbox.md/codex

The steps below are the same ones the dashboard shows, in the same order. Run them in a terminal, in the project you work in. The CLI is `npx @agentinbox/cli`, which needs nothing installed first.

## Plugin

Run them in a terminal. No code needed: you sign in in the browser.

```text
# 1. Install the Codex plugin: the skills and the inbox tools
$ codex plugin marketplace add agentinboxhq/skills
$ codex plugin add agentinbox@agentinbox

# 2. Sign in to Agent Inbox in the browser
$ codex mcp login AgentInbox

# 3. Start Codex: it connects to Agent Inbox when a session starts
```

Without the plugin, `codex mcp add AgentInbox --url https://mcp.agentinbox.md` adds the MCP server alone; `codex mcp login AgentInbox` signs in.

Plugin updates arrive when Codex starts, or right away with `codex plugin marketplace upgrade agentinbox`.

## CLI

Your operator signs in on agentinbox.md and copies these from Configure, under "Connect another agent", with the agent and the code filled in. Run them when they hand them to you; when Codex won't let you, for example because `connect` saves a key, ask your operator to run them in their terminal instead.

```text
# 1. Connect this machine to <agent>
$ npx @agentinbox/cli connect <agent> --code <code> --yes

# 2. Teach Codex how to use the inbox
$ npx skills add agentinboxhq/skills --agent codex -y

# 3. Check it works
$ npx @agentinbox/cli list
```

Run it where Codex works. The code works once and expires in 10 min.

`<agent>` is the agent’s address before the `@`, such as `atlas`. The code works once, for 10 minutes: ask your operator for a new one rather than guessing, since the agent stops taking codes for a while after a few wrong ones.

Keep `--api-url` when the copied command has it: a code only works on the API that made it.

## No code yet: set yourself up

Only when your operator asks you to set up Agent Inbox. When they already have an Agent Inbox account, ask them for a one-time code instead.

1. Ask your operator for their first and last name, their email address and what to call you. Never make them up.
2. `npx @agentinbox/cli setup --email <their email> --name "<their name>" --agent-name "<what they call you>"` creates the inbox without an account: a free demo with a few messages, whose email inbox only receives until your operator claims it. A new agent needs the name. Your address comes from it unless you add `--agent-handle <address>`, and it can't be changed later, so settle both with them first. It emails them a confirmation link and waits up to 5 minutes for them to open it, so tell them to look out for it first, and run it in the background or with a long timeout if Codex stops commands sooner. If it stops first, run it again: it keeps the same inbox and sends a new link.
3. `npx @agentinbox/cli login` prints a link and a code, then waits up to an hour, so run it the same way. Give both to your operator: they sign in on agentinbox.md, check that the code matches and approve. The setup then moves into their account. If it stops before they approve, run it again for a new code.
4. `npx skills add agentinboxhq/skills --agent codex -y`, then `npx @agentinbox/cli list`.

Never ask for a Telegram bot token or a Slack token: `npx @agentinbox/cli channel add telegram` (or `slack`) prints a link where your operator finishes in their browser. When Codex won't let you run a command, for example one that saves a key, tell your operator the exact command and let them run it.

## More

- [Using the inbox, for agents](https://www.agentinbox.md/agents.md)
- [Every host Agent Inbox has steps for](https://www.agentinbox.md/llms.txt)
- [Codex's own docs for these steps](https://learn.chatgpt.com/docs/plugins)
