WACrew

Guide

WhatsApp MCP in Codex: connect WhatsApp to the OpenAI Codex CLI

Connect WhatsApp to OpenAI Codex with an MCP server: the config.toml block, environment variables, a quick test and what Codex can do with your chats.

Updated 2 min read
On this page
  1. Before you start
  2. Add the server to config.toml
  3. Test it
  4. A workflow that fits Codex
  5. Sending stays under your control
  6. FAQ

OpenAI's Codex CLI speaks MCP, so it can read and answer WhatsApp through the same kind of server Claude Code uses. Most WhatsApp MCP READMEs only show Claude Desktop and Cursor JSON. Codex uses TOML, which is the step that trips people up. This guide uses WACrew's server, published on npm as wacrew-mcp.

Before you start

You need Node 20+ where Codex runs, and a WACrew collector holding your WhatsApp session. On a VPS:

git clone https://github.com/sumioshi/wacrew && cd wacrew
PANEL_USER=admin PANEL_PASS=change-me docker compose up -d

Open http://<server-ip>:3000/config, scan the QR code under WhatsApp, Linked devices, and put HTTPS in front of the panel (Caddy, a tunnel or your host's proxy) before exposing it.

Add the server to config.toml

Codex reads MCP servers from ~/.codex/config.toml. Add:

[mcp_servers.wacrew]
command = "npx"
args = ["-y", "wacrew-mcp"]
env = { WAC_CLOUD_URL = "https://your-panel.example.com", WAC_CLOUD_USER = "admin", WAC_CLOUD_PASS = "change-me" }

Restart Codex. Recent versions also have a codex mcp subcommand to add and list servers from the terminal; the result is the same block in config.toml.

Collector on the same machine? Replace the three variables with WAC_DATA_DIR = "/path/to/wacrew/data" and the MCP reads the files directly.

Test it

Ask Codex:

  • "List my WhatsApp chats and tell me which client has waited longest."
  • "Search WhatsApp for the last time anyone mentioned the staging URL."
  • "Read the PDF the client sent in the Acme group and list the change requests."

Codex picks listar_grupos, caixa_de_entrada, buscar and ler_documento from the tool descriptions. The tools reference lists all 36.

A workflow that fits Codex

Codex is usually open in a repository. That makes one loop especially useful: a client reports a bug on WhatsApp with a screen recording, Codex watches it with assistir_video, finds the cause in the code, fixes it, and drafts a reply for you to approve. When the fix ships, registrar_feature logs the delivery for that client in the WACrew dashboard.

Sending stays under your control

Every chat starts in Confirm mode: the agent must show you the message before it goes. After approval, delivery is ticketed and human-paced, and cancelar_envio stops it. Codex's own approval settings apply on top.

FAQ

Does Codex need the WACrew web panel? The panel is where the collector runs and where you scan the QR code. Codex only talks to the MCP server.

Can I use another WhatsApp MCP server with Codex? Yes, any stdio server works with the same TOML shape. Put its command in command and args, and its settings in env.

Is this the official WhatsApp API? No. WACrew links as an extra device through Baileys. Use it with people who already talk to you, never for bulk messages.