Skip to main content

Add a phone-call MCP server to Codex CLI

Updated 6 min readMarkdown

Hook: Codex can run long enough that you leave the terminal. A local ding is easy to miss if you are in another room, on another machine, or the laptop lid is closed.

Problem: People ask the same question in r/codex and in GitHub issues: how do I get an alert when Codex finishes a task, and how do I hear about it when it is waiting for approval? Codex can run a notify program, and the TUI can show notifications when a turn completes or approval is requested. Those tools are real, and they still leave a gap when you want the agent to reach you on a phone and bring your answer back into the same session.

Solution: Use Codex's own notify hook or TUI notifications if a sound or a desktop banner is enough. Point that notify script at ntfy, Pushover, or Slack if you need a phone or a channel ping. If you want a phone call or a text with a reply that returns to the agent, add a remote MCP server that can do that. AGline is one option, and the Codex command is a single line.

1. Codex notify and TUI notifications

Codex can invoke a program when a turn completes. Community answers point at the notify key in ~/.codex/config.toml. A typical shape is:

notify = ["/bin/bash", "/home/you/.codex/ding.sh"]

Your script can play a sound, show a desktop notification, or post to a webhook. On a Mac, people often use say or a short osascript notification. On Linux, notify-send or a terminal bell may be enough if you are at the machine. The script receives a JSON payload, so you can include a short summary if you want to parse it. Keep the script executable, and use an absolute path, because Codex may not see the same PATH you have in an interactive shell.

The TUI also has notification settings that people have reported in the form:

[tui]
notifications = ["agent-turn-complete", "approval-requested"]
notification_condition = "unfocused"
notification_method = "auto"

Treat the exact key names as something to confirm in your installed Codex version and in the current Codex config docs, because CLI flags move. The idea is stable: tell Codex when to notify, and whether to do it only when the terminal is unfocused.

This path is the right default when you stay near the computer that is running Codex.

2. A one-way phone or Slack ping

If you already walk away, point the same notify script at a push service. ntfy needs no account on the public server. Subscribe in the ntfy app to a long, unguessable topic, then:

#!/usr/bin/env bash
curl -s -H "Title: Codex" -d "Codex turn complete" ntfy.sh/your-secret-topic >/dev/null

Pushover works if you already pay for it and want a more locked-down app. A Slack incoming webhook is a good fit if the "notification" should land where you already work. Several small GitHub projects wrap this (for example chime scripts and Slack notifiers). You do not need a new product if a webhook is enough.

The limit is the same as with other CLIs: the ping is one-way. It will not, by itself, let Codex ask "deploy now?" and wait for you to say yes from your phone.

3. Add a phone-call MCP server

AGline, built by Ayushman Singh, exposes an HTTP MCP server at https://agline.in/mcp. Codex can add it with:

codex mcp add agline --url https://agline.in/mcp

The agent then has four tools: call, poll_result, send_message, and read_replies. You still have to give it your 10-digit AGline number and tell it not to guess. AGline does not dial a regular mobile number. You answer in the AGline web app, the Mac or Windows app, or the Android APK (not on Google Play). There is no iPhone app. On iPhone, use Safari > Share > Add to Home Screen, and turn on call notifications from My Number.

Get a number

Open https://agline.in. No account or email is required. Keep the recovery key so you can restore the number later. The first number is free for 30 days, with no card. After that it is ₹199 per month. You can request a full refund within 7 days of the first payment. Details: pricing, refunds.

If your number is in keys-only mode, create an agent key under My Number and put the Authorization: Bearer ck_... header in the client's secret settings. The public Codex add command shown above has no key flag in AGline's published snippets, so use your client's documented way to attach headers, or the keyed option on the in-app Connect your AI page. Do not paste a live key into a prompt.

Test it

Call my AGline number <your 10-digit number> and ask me one yes/no question to confirm this connection works.

A call waits about 30 seconds. If it is still ringing, the agent should use poll_result with the call_id. Keep the thread_token returned the first time a thread name is used. Ask Codex to text for "the tests finished" and to call only when it needs a decision. Quiet hours and a calls-per-hour limit live on My Number.

A simple way to combine them

A quiet setup that matches how Codex is actually used:

  1. Keep a notify script for every turn, or only when the TUI is unfocused, if you want a local sound.
  2. Add ntfy or Slack to that script if you leave the machine but only need a ping.
  3. Add the MCP server if the missing piece is a reply, not only an alert.

You do not need all three. If official or scripted notifications already bring you back in time, stop there. If Codex is blocked on a human answer and you are not at the terminal, a call or a text with a reply is the part a notify script cannot do.

For other MCP clients, the same server URL works. Claude Code, Cursor, Gemini CLI, ChatGPT (developer mode), and the Claude app each have their own add steps on https://agline.in/mcp. This article stays with Codex because the command is easy to get wrong if you copy a Claude-specific flag.

About the author

  • AGline lets any MCP agent ring or text your phone when a task finishes, fails or needs a decision. Built by Ayushman Singh. https://agline.in
XX1Y14d ago

Getting the answer back into the same session is the useful part. How do you make sure the reply really came from the owner of that number? A text that says yes is a pretty thin approval for a shell command.