---
title: "Connect WhatsApp to Grok: Setup Guide — WhatsMCP Blog"
description: "Connect WhatsApp to Grok with WhatsMCP: a custom connector on grok.com, or the xAI API's remote MCP tool. Setup, code samples, prompts and FAQ."
url: "https://whatsmcp.com/blog/connect-whatsmcp-to-grok"
---

Grok can now use outside tools through the Model Context Protocol — in the Grok app through custom connectors, and in the xAI API through a remote MCP tool. Point either one at WhatsMCP and Grok can read your WhatsApp chats, reply, manage groups and check calls on your own number, or work an official WhatsApp Business API inbox.

This guide covers both ways to connect WhatsApp to **Grok**: the **grok.com** connector for everyday use, and the **xAI API** for developers building their own agents. It also explains what Grok can do once connected, prompts to try, and answers to common questions.

![Diagram: Grok connects over MCP to api.whatsmcp.com/mcp, which reaches your WhatsApp number as a linked device](https://content.whatsmcp.com/uploads/whatsapp_grok_mcp_architecture_69b5328fa8.webp)

## What you need

- **A WhatsMCP workspace.** [Sign up free](https://console.whatsmcp.com/register?utm_source=blog&utm_medium=article&utm_campaign=connect-whatsmcp-to-grok&utm_content=before-you-start) — no card.
- **A WhatsApp number linked to it.**
  - *Personal number:* at **Add a number** (setup opens it; later it's **Fleet → Add Number**) choose **Personal WhatsApp → Link a device via QR**, then scan the code from **WhatsApp → Settings → Linked devices → Link a device** on your phone. Your workspace's first Personal number takes the free line automatically; any other stays suspended until you choose a plan for it. New Personal numbers run through WhatsMCP's Default Random VPN unless you set your own WireGuard or SOCKS5 egress.
  - *Official Business number:* at **Add a number** choose **WhatsApp Business → Connect with Facebook** and follow Meta's dialog, then choose a Business plan for the number — it stays suspended until it has one, and your workspace's first Business plan starts with a 7-day free trial. The full walkthrough is in [Connect WhatsApp Business API to Claude](/blog/connect-whatsapp-business-api-to-claude); it applies to Grok unchanged.
- **The endpoint:** `https://api.whatsmcp.com/mcp`. It's public on the internet, which Grok requires: its connectors reject localhost and private URLs.

![The WhatsMCP console Pair device page: a QR code above a progress indicator reading code, scanned, syncing, ready](https://content.whatsmcp.com/uploads/console_pair_device_fecfe5a9da.webp)

## Option 1 — Connect WhatsApp in the Grok app

![Two ways to connect Grok to WhatsMCP: a custom connector on grok.com, and the xAI API's remote MCP tool with an x-api-key header](https://content.whatsmcp.com/uploads/connect_grok_to_whatsmcp_options_75924b9708.webp)

For an individual account:

1. Go to **grok.com/connectors**.
2. Choose **New Connector → Custom**.
3. Enter the URL `https://api.whatsmcp.com/mcp`.
4. Complete the sign-in when Grok asks. WhatsMCP's sign-in is OAuth: you're sent to the WhatsMCP console to approve the connection, and no key is pasted anywhere.

On **Grok Business and Enterprise** plans, a team admin adds the connector first — **+ Add Connector → Other**, with the same URL — and team members can then connect and use it.

Once it's connected, ask Grok about your WhatsApp in plain language. You can revoke Grok's access at any time from **Console → Connections** in WhatsMCP.

## Option 2 — Use WhatsApp tools from the xAI API

If you're building your own agent on Grok, the xAI API can call WhatsMCP as a **remote MCP tool**. xAI's servers make the MCP calls for you, so your code only sends a prompt and gets an answer back. Authenticate with a WhatsMCP API key from **Console → API keys** — keys look like `wamcp_live_…` and are shown once.

With the Responses API:

```bash
curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.7",
    "input": "List my WhatsApp accounts and summarise the last 10 messages.",
    "tools": [{
      "type": "mcp",
      "server_url": "https://api.whatsmcp.com/mcp",
      "server_label": "whatsmcp",
      "headers": { "x-api-key": "'"$WHATSMCP_API_KEY"'" }
    }]
  }'
```

With the Python `xai_sdk`:

```python
import os
from xai_sdk import Client
from xai_sdk.tools import mcp

client = Client(api_key=os.environ["XAI_API_KEY"])
chat = client.chat.create(
    model="grok-4.7",
    tools=[mcp(
        server_url="https://api.whatsmcp.com/mcp",
        server_label="whatsmcp",
        extra_headers={"x-api-key": os.environ["WHATSMCP_API_KEY"]},
    )],
)
```

A few tips:

- **Limit the tools.** Pass `allowed_tools` (Responses API) or `allowed_tool_names` (SDK) to expose only what your agent needs — for a read-only digest, just `wa_list_accounts`, `wa_list_messages` and `wa_get_chat`.
- **Keep keys out of code.** Read both keys from the environment, as above, and mint a separate WhatsMCP key per environment so you can revoke one without the others.
- **Why `x-api-key`?** WhatsMCP accepts a key either as `Authorization: Bearer …` or as `x-api-key`. The header form is unambiguous when a platform manages the `Authorization` header itself.

## What Grok can do on WhatsApp

WhatsMCP has **45 tools** in all. A Personal number can use 42 of them — messaging, message operations, contacts and profiles, groups and channels, group administration, blocklists, calls and AI voice agents, webhooks and pairing. A Business number uses 15, covering messaging, templates and webhooks under Meta's 24-hour window. Your plan decides which tools Grok sees; a tool outside it is simply absent.

![The 45 WhatsMCP tools grouped by category: accounts and plan, messaging, message operations, contacts, groups and channels, group admin, blocklist, calls and AI voice, webhooks](https://content.whatsmcp.com/uploads/whatsmcp_45_whatsapp_tools_1b6d4ee6a5.webp)

## Prompts to try

**1. Daily digest.**

> "Summarise my WhatsApp from the last 24 hours, grouped by person, and flag anything that needs an answer today."

Grok calls `wa_list_accounts`, `wa_list_messages` and `wa_get_chat`. Nothing is sent.

**2. Quick reply.**

> "Tell Sam the meeting moved to 4pm and ask if that still works."

`wa_list_contacts` finds Sam; `wa_send_message` sends. Ask Grok to show you the draft first if you prefer.

**3. Group logistics.**

> "Create a group 'Friday Dinner' with Ana, Ben and Chloe and post the restaurant address."

`wa_create_group`, then `wa_send_message`.

**4. Number lookup.**

> "Who is +44 7700 900123 on WhatsApp?"

`wa_get_profile` returns the public name, about text and, for a business, its category and hours.

**5. Business follow-up** (Business numbers).

> "For yesterday's customers who never replied, send our order_update template with their name."

`wa_list_templates`, then `wa_send_message` with the template and its variables.

## Good habits

- **Start read-only**, then allow sends once you like the drafts.
- **Personal numbers:** use a number you can spare and keep traffic personal. A linked device falls outside WhatsApp's terms of service, and WhatsApp may restrict a number it sees as misused. For customer messaging, use an official Business number.
- **Review access** at **Console → Connections** (OAuth clients) and **Console → API keys**.

## FAQ

### Does Grok support MCP servers?

Yes. The Grok app supports custom MCP connectors, and the xAI API supports remote MCP servers as a tool type. Both work with WhatsMCP's public endpoint.

### Do I need an API key?

Not for the Grok app — sign in when prompted. For the xAI API, yes: use a WhatsMCP key in the `x-api-key` header.

### Which Grok plans can add custom connectors?

Business and Enterprise teams can, once an admin adds the connector. For individual accounts, check the connectors page on grok.com — availability can depend on your plan.

### Can I use an official WhatsApp Business number with Grok?

Yes. The same endpoint serves Business numbers; Meta's 24-hour window and template rules apply, and WhatsMCP enforces them.

### Does the same setup work in Claude, ChatGPT or Cursor?

Yes — one endpoint for every client. See the guides for [Claude](/blog/connect-whatsmcp-to-claude), [ChatGPT](/blog/connect-whatsmcp-to-chatgpt) and [Cursor](/blog/connect-whatsmcp-to-cursor).

## Get started

[Create your free WhatsMCP workspace](https://console.whatsmcp.com/register?utm_source=blog&utm_medium=article&utm_campaign=connect-whatsmcp-to-grok&utm_content=get-started), link a number, and add one URL to Grok. The complete tool reference is at [whatsmcp.com/docs/mcp](/docs/mcp).
