flow api
Integration

Give Grok a WhatsApp number

xAI's API supports remote MCP tools, so Grok can use any MCP server you point it at. Every Flow API number comes with one: add its link and Grok gets 12 WhatsApp tools to read new messages, reply, send files, locations and polls, and check numbers.

Simplest: AI auto-reply

Want Grok to answer every customer automatically? Open your number → AI auto-reply in the console, choose Grok, paste your xAI key and instructions, and turn it on. Each incoming WhatsApp message wakes Grok and it replies from your number.

Add WhatsApp to a Grok request

Put your Flow API MCP link in the tools array of an xAI Responses API call. Grok discovers the WhatsApp tools and calls them itself.

curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.3",
    "input": "Reply to everyone who asked about pricing today",
    "tools": [{ "type": "mcp", "server_label": "whatsapp", "server_url": "https://flowapi.pro/mcp/{idInstance}/{apiTokenInstance}" }]
  }'

With the xAI Python SDK

from xai_sdk import Client
from xai_sdk.chat import user
from xai_sdk.tools import mcp

chat = Client().chat.create(
    model="grok-4.3",
    tools=[mcp(server_url="https://flowapi.pro/mcp/{idInstance}/{apiTokenInstance}", server_label="whatsapp")],
)
chat.append(user("Summarise today's WhatsApp messages"))
print(chat.sample().content)

No code: n8n

  1. 1In n8n add an AI Agent node with the xAI Grok Chat Model.
  2. 2Add an MCP Client Tool with the endpoint https://flowapi.pro/mcp/{idInstance}/{apiTokenInstance} (HTTP Streamable).
  3. 3Trigger the agent from the Flow API Trigger, so every incoming WhatsApp message gets a Grok reply.

Good practice

  • Limit Grok to the tools it needs with allowed_tools, for example only get_new_messages and send_message.
  • The MCP link contains your API token. Keep it in a server-side secret, never in front-end code.
  • Only let the bot message people who wrote to you first or asked to be contacted.

Questions

Which Grok models support MCP tools?

Remote MCP tools work with the Grok models on the xAI API through the native SDK, the OpenAI-compatible Responses API and the Voice Agent API. Use the newest model available on your account.

Can a Grok voice agent use WhatsApp too?

Yes. xAI lists remote MCP tools for its Voice Agent API as well, so a voice agent can send a WhatsApp follow-up after a call.

Sources: xAI docs: Remote MCP Tools. Checked October 2026.

Try it on your own number

7 days free, no credit card. Then $10 per number per month.

Start free trial

Related