WhatsApp Tools for OpenAI Codex CLI — Give Your Agent a Messaging Channel
OpenAI's Codex CLI speaks MCP. Add the Gavi WhatsApp MCP server in 2 minutes and let the agent send messages, templates, and broadcasts to real humans.
OpenAI's Codex CLI is a coding agent that lives in your terminal — it can read files, run commands, search docs, and call any MCP tool you give it. That last part is what's interesting: MCP turns Codex from a coding assistant into a general-purpose agent that can interact with the outside world.
One of the most useful tools you can give it: the ability to send WhatsApp messages to humans.
Why WhatsApp + Codex is a meaningful combination
Codex is great at doing work. WhatsApp is how 3 billion humans actually communicate. Connect them via MCP and you get an agent that can finish a job and tell the right person it's done — in the channel they'll actually see in under an hour.
Concrete things this unlocks:
- "Run the database migration. When it finishes, WhatsApp the result to the on-call engineer."
- "Read this CSV of trial expirations (every user opted in at signup) and send each one a renewal reminder template with their personalized link."
- "Write the weekly metrics report and send it as a PDF on WhatsApp to the founder."
- "Build the customer support automation: when a ticket comes in, classify it, draft a reply, and WhatsApp the user (only if they opted in to WhatsApp updates at signup)."
The agent figures out which MCP tools to call. You write the goal in English.
What is MCP?
MCP (Model Context Protocol) is an open standard — Anthropic introduced it, and OpenAI's Codex now speaks it natively. An MCP server exposes a list of tools that any MCP-compatible agent can call. The same @gaviwhatsapp/mcp server works in Codex, Cursor, Claude Code, Claude Desktop, OpenAI Agents SDK, and elsewhere — one config, every runtime.
Setup
1. Get an API key
Sign up at gaviventures.com.
2. Add the MCP server to Codex
In your Codex MCP config:
{
"mcpServers": {
"gaviwhatsapp": {
"command": "npx",
"args": ["@gaviwhatsapp/mcp", "--api-key", "gv_YOUR_KEY"]
}
}
}
Restart Codex. The agent now has WhatsApp tools loaded.
3. Try it
In Codex:
Send a WhatsApp to +919876543210 saying "Codex agent online — what should I work on?"
Codex's planner will pick the send_message MCP tool, fill in the arguments, and confirm delivery. You'll see the tool call inline.
Real workflows that benefit from this
Database operations + human notifications
Run the schema migration. If it succeeds, WhatsApp the rowcount to the team. If it fails, WhatsApp the error.
Codex chains the shell command + the MCP tool call into one plan.
CSV-driven outreach to opted-in leads
Read leads.csv. For each lead with
opt_in: yes, send the "demo_offer" template personalized with the company name. Skip rows where status is "lost" or "won", or whereopt_inis empty/no. Save a delivery report as report.csv.
The agent loops, calls send_template with per-row variables, handles rate limiting, and writes the report. No code.
Heads up — opt-in is required. Every recipient of a business-initiated WhatsApp must have given consent (at signup, on a website form, or by messaging you first). Cold-blasting templates to a CSV without opt-in tanks your quality rating and can get your number suspended. The
opt_in: yesfilter above isn't a suggestion — it's how you stay compliant.
End-to-end customer flows
Write a script that listens for new Stripe checkout events. For each successful payment, send the customer a WhatsApp confirmation using the "order_confirmed" template.
Codex writes the webhook handler, wires up Stripe, and uses the MCP tool to send the WhatsApp — all in one prompt.
Debug investigation
The user with email alice@example.com complained about a missing message. Look up her phone in the database, then call
list_messagesto show me the last 10 messages we sent her with delivery status.
Cross-tool reasoning: shell + DB query + WhatsApp MCP, all in one go.
Tools the agent gets
| Tool | What it does |
|---|---|
send_message | Free text (within the 24-hour conversation window) |
send_template | Meta-approved template (required for cold messages, OTPs, transactional) |
send_media | Image, video, document, audio |
send_broadcast | Template send to many recipients with per-row variables |
list_templates | Discover approved templates |
list_messages | Read message history and delivery status |
The bigger pattern: agents that do real work
Coding agents (Codex, Cursor, Claude Code) are increasingly replacing scripts. But scripts don't just compute — they also notify, escalate, and report. Without a messaging channel, an agent's work is invisible. With WhatsApp via MCP, the agent has a way to close the loop with humans on the channel they actually monitor.
Same protocol, same MCP server, also runs in:
- Cursor
- Claude Code
- Claude Desktop
- OpenAI Agents SDK and LangChain (via MCP adapters)
- Custom agents using Anthropic or OpenAI API directly
Pricing
$9.99/mo flat from Gavi. Meta's per-message charges go directly to your WhatsApp Business Account — no markup from us.
Try it: gaviventures.com · GitHub
Ready to try Gavi WhatsApp?
Send WhatsApp messages from your code, AI agent, or CRM in under 5 minutes.