Codex Setup
Set up push notifications and permission approvals for OpenAI Codex CLI
Pushary connects to Codex via MCP and a notify handler. The MCP server gives Codex access to push notification tools. The notify handler captures Codex's native events and routes approval requests through your phone.
Quick setup
Get your API key
Sign up at pushary.com/sign-up and copy your API key. The key looks like pk_abc123.sk_xyz789.
Run the setup wizard
npx @pushary/agent-hooks setupSelect "Codex" (option 2) or "All" (option 5). The wizard will:
- Install
@pushary/agent-hooksglobally - Add the Pushary MCP server via
codex mcp add - Add the notify handler to
~/.codex/config.tomlfor native event capture - Save your API key to your shell profile
Enable notifications on your phone
Open pushary.com on your phone's browser and allow notifications. On iPhone, you may need to Add to Home Screen first.
Manual setup
If you prefer not to use the wizard:
MCP server
codex mcp add pushary --url https://pushary.com/api/mcp/mcp --bearer-token-env-var PUSHARY_API_KEYSet your API key in your shell profile (~/.zshrc or ~/.bashrc):
export PUSHARY_API_KEY="pk_abc123.sk_xyz789"Notify handler (permission approvals)
Install the hooks package globally:
npm install -g @pushary/agent-hooksAdd the notify handler to ~/.codex/config.toml:
notify = ["/path/to/pushary-codex"]Replace /path/to/pushary-codex with the output of which pushary-codex.
What gets captured
| Event | What happens |
|---|---|
agent-turn-complete | Codex finished a task. Pushary records the activity and shows it on your dashboard. |
approval-requested | Codex needs permission. You get a push notification with Yes/No buttons. Codex waits for your response. |
MCP tools
Once connected, Codex can use these tools:
| Tool | Description |
|---|---|
send_notification | Send a push with optional rich context |
ask_user | Ask a question: yes/no, multiple choice, or free text |
wait_for_answer | Poll for your response |
cancel_question | Cancel a pending question |
Permission gating
Codex approval requests are routed through push notifications. When Codex needs permission for a dangerous operation:
- The
pushary-codexhandler receives theapproval-requestedevent - You get a push notification: "Allow: [command]?"
- You tap Yes or No on your phone
- The response is written back to Codex's stdin
- Codex proceeds or stops
If you don't respond within 2 minutes, the request is auto-denied.