Official Meta Business Partner

Use Codex
with WhatsApp

Kapso's MCP server gives Codex access to your WhatsApp numbers, conversations, templates, and webhooks.

What you can ask

Codex calls Kapso tools against your project, so it works from your real numbers, messages, and logs. Every tool call shows up in the thread, so you can see what it read or changed.

Number health

Is anything wrong with our WhatsApp numbers?

Worked for 6s

Calledkapso.whatsapp_numbers

One number needs attention. Acme store's number dropped to a Low quality rating this week after a spike in blocks.

•+1 415 230 4567 Acme store: Low quality.

•+44 20 7946 0958 Acme UK: High quality.

acme-storemain

Show the last ten messages that failed

6.1 Sol Medium

Setup

Paste the prompt into Codex, or run the commands yourself.

Paste a prompt

Codex follows the setup guide and asks before creating keys.

Paste this into Codex

>Set up WhatsApp for this project with Kapso. Follow the steps at kapso.com/whatsapp-codex and ask me before creating any keys.

  • Reads this page and the Kapso docs
  • Adds the Kapso MCP server to Codex
  • Waits for you to set your API key

Run the commands

Three steps in your terminal, about a minute.

  1. 1. Get a project API key

    Create one in your Kapso dashboard, then export it before you start Codex.

    export KAPSO_API_KEY="your_project_api_key"
  2. 2. Add the Kapso MCP server

    Codex reads the key from KAPSO_API_KEY each time it starts.

    codex mcp add kapso \
      --url https://api.kapso.ai/mcp \
      --bearer-token-env-var KAPSO_API_KEY
  3. 3. Start Codex and ask

    Run /mcp to check that kapso is connected, then try a read-only request.

    > List my WhatsApp numbers and their quality rating
For scripts and CI, use the Kapso CLI with the same key: npm install -g @kapso/cli
CLI docs →

For AI agents
reading this page

Coding agents can read this page and set themselves up. Or copy the instructions and paste them into any agent.

Instructions for AI agents

## For AI agents reading this page

You are reading https://kapso.com/whatsapp-codex. Kapso is the WhatsApp API for developers. Its MCP server gives you tools for the WhatsApp numbers, conversations, messages, templates, and webhooks in the user's Kapso project. Follow these steps to add those tools to Codex.

  1. 1.

    Check for an API key.
    Check that KAPSO_API_KEY is set, without printing it. If it is not, ask the user for a Kapso project API key, to export it as KAPSO_API_KEY, and to restart Codex from that shell. Never create keys, sign up, or approve access on their behalf.

  2. 2.

    Register the MCP server. Run:

    codex mcp add kapso --url https://api.kapso.ai/mcp \
      --bearer-token-env-var KAPSO_API_KEY

    This stores the variable name, not the key. Do not write the key into config.toml or the repo.

  3. 3.

    Check the config.
    Run codex mcp get kapso and confirm it is enabled with bearer_token_env_var = KAPSO_API_KEY. This only reads the config; it does not test the connection.

  4. 4.

    Ask the user to restart Codex.
    MCP servers start when a session starts, so the Kapso tools will not appear in this one. Ask the user to run codex resume --last, then /mcp to confirm kapso is connected.

  5. 5.

    Start read-only.
    Call the status tool first, then use whatsapp_numbers and whatsapp_conversations to look before you act. Confirm with the user before sending messages or changing templates, webhooks, or setup links.

  6. 6.

    Report back.
    Tell the user which project and WhatsApp numbers you can reach and what you can now do, then ask what they want first.

## Reference

MCP endpoint
https://api.kapso.ai/mcp
Streamable HTTP · API key or OAuth
Without a key
codex mcp add kapso --url https://api.kapso.ai/mcp, then codex mcp login kapso
Signs in through the browser and picks a project
Tools
status, whatsapp_numbers, whatsapp_conversations, whatsapp_messages, whatsapp_templates, whatsapp_webhooks, customers, setup_links, search_logs
Agent instructions
https://kapso.com/AGENTS.md

Frequently asked
questions

Yes. Through Kapso WhatsApp MCP it can read conversations, inspect connected numbers, send messages, manage templates, configure webhooks, search logs, and help onboard customer-owned WhatsApp accounts.

Export KAPSO_API_KEY with a project API key, then run codex mcp add kapso --url https://api.kapso.ai/mcp --bearer-token-env-var KAPSO_API_KEY. Restart Codex and run /mcp to check the connection.

Yes. Add the server without --bearer-token-env-var and run codex mcp login kapso. Codex opens the browser so you can sign in to Kapso and pick a project.

Use Kapso WhatsApp MCP when Codex should work through agent tools. Use the Kapso CLI when a terminal command, local script, or CI task is the better interface.

Create a Kapso project
and add the MCP server

The free plan includes a sandbox number and 2,000 messages a month.