KosmoKrator

communication

WhatsApp Business MCP Integration for OpenAI Agents SDK

Connect WhatsApp Business to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

6 functions 4 read 2 write Bearer token auth

Connect WhatsApp Business to OpenAI Agents SDK

Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.

Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with --write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.

WhatsApp Business MCP Config for OpenAI Agents SDK

Use headless JSON commands for CI-style execution and MCP for agent tool discovery.

{
  "mcpServers": {
    "kosmokrator-whatsapp": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=whatsapp",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=whatsapp --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only WhatsApp Business instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

WhatsApp Business Tools Visible to OpenAI Agents

OpenAI Agents sees stable MCP tool names generated from the WhatsApp Business integration catalog.

MCP toolSource functionTypeDescription
integration__whatsapp__whatsapp_send_message whatsapp.whatsapp_send_message Write Send a text message to a WhatsApp recipient. Use this for replying within an existing 24-hour customer service window. For new conversations, use the send_template tool instead.
integration__whatsapp__whatsapp_get_message whatsapp.whatsapp_get_message Read Retrieve a specific WhatsApp message by its ID. Returns the message content, status (sent, delivered, read), and timestamps.
integration__whatsapp__whatsapp_list_templates whatsapp.whatsapp_list_templates Read List approved WhatsApp message templates. Templates are required to initiate new conversations outside the 24-hour service window.
integration__whatsapp__whatsapp_list_contacts whatsapp.whatsapp_list_contacts Read List WhatsApp contacts for the business phone number. Returns WhatsApp IDs and profile names.
integration__whatsapp__whatsapp_send_template whatsapp.whatsapp_send_template Write Send a template-based WhatsApp message. Use this to initiate new conversations outside the 24-hour window. The template must be pre-approved in the WhatsApp Business Manager.
integration__whatsapp__whatsapp_get_current_user whatsapp.whatsapp_get_current_user Read Get the authenticated WhatsApp Business user info — name, email, and business ID. Useful for verifying which account is connected.

Related WhatsApp Business Pages