# Connect Cursor to WhatsApp Business

Source: https://postgale.com/guides/cursor/whatsapp

Yes, Cursor can answer customers and send messages on WhatsApp Business through Postgale. Add https://postgale.com/mcp to Cursor’s mcp.json and sign in to Postgale when Cursor asks (or use an API key header), connect your WhatsApp Business account in Postgale once, and Cursor can customer conversations, templates, media and the 24-hour window. A person can be required to approve every post, reply and message before it goes out.

## Can Cursor answer customers and send messages on WhatsApp Business?

Postgale is the secure layer for AI agents on social media. MCP (Model Context Protocol) is the open standard that lets AI assistants such as Claude and Cursor use outside tools. An MCP server is what they connect to. Cursor does not reach WhatsApp on its own; with Postgale connected it gets tools for the WhatsApp accounts you connected and nothing else.

| Task | What Postgale does |
| --- | --- |
| Read | List conversations (latest first, with unread count and the open messaging window) and their messages, including inbound attachments. |
| Reply | Text, image, video, audio, document, interactive messages and reactions inside the 24-hour window; mark as read. |
| Templates | Send approved templates with parameters outside the window; list templates and their status. |
| Media | Upload media to WhatsApp and read the type, size and hash of inbound media. |
| Events | message.received, message.status, message.delivered, message.read and message.reaction on your webhook, signed. |

## What do you need?

- A WhatsApp Business Account and a phone number for it, set up through Meta’s Embedded Signup from the Postgale dashboard, or an existing number connected with its token.
- A Postgale workspace, and a sign-in or an API key for the agent.
- Message templates approved by Meta if the agent must write first or outside the 24-hour window.
- Cursor, set up as below (Cursor’s agent with MCP).

## Step 1: connect your WhatsApp Business account

1. Create a Postgale workspace and open Dashboard → Accounts.
2. Choose Connect WhatsApp Business and sign in with the account you own, on Meta’s own Embedded Signup page. Postgale stores the tokens encrypted and refreshes them.

## Step 2: connect Cursor to Postgale

1. Create a Postgale workspace and connect the social accounts the agent may use under Dashboard → Accounts.
2. In Cursor, open Settings → MCP and add a server, or edit `.cursor/mcp.json` in the project (or `~/.cursor/mcp.json` for every project). The URL alone is enough:

.cursor/mcp.json:
```json
{
  "mcpServers": {
    "postgale": {
      "url": "https://postgale.com/mcp"
    }
  }
}
```

1. Cursor shows a sign-in prompt for the server. A Postgale page opens in the browser: sign in, pick the workspace the app may use and approve. The consent page names the app and where it returns to; approve only requests you started yourself.
2. Cursor lists the Postgale tools under the server once it connects; enable them for the agent.
3. In the agent chat, ask: “Which social accounts are connected in Postgale?” to check the connection.

## Can I use an API key instead?

Yes, for shared or automated setups where nobody should sign in personally. In Postgale, open Dashboard → API keys, create a key and copy it (it starts with `sk_` and is shown once). Connect the social accounts the agent may use under Dashboard → Accounts. Then add a headers block:

.cursor/mcp.json (API key):
```json
{
  "mcpServers": {
    "postgale": {
      "url": "https://postgale.com/mcp",
      "headers": {
        "Authorization": "Bearer sk_…"
      }
    }
  }
}
```

> Keep the key out of version control: use the global file, or an environment variable if your Cursor version supports `${env:…}` in mcp.json.

## What can I ask Cursor to do on WhatsApp?

Check the connection first: “Which WhatsApp accounts are connected in Postgale?” Then, in plain language:

> Ask your agent: “Answer the new WhatsApp questions about opening hours. Hold every reply for my approval.”

> Ask your agent: “Send the “order ready” template to the customer in this conversation.”

> Ask your agent: “Summarise today’s WhatsApp conversations and list the ones still waiting for an answer.”

POST /api/v1/whatsapp/accounts/{accountId}/messages:
```json
{
  "to": "+14155550132",
  "type": "text",
  "text": "Yes, M restocks Tuesday. Want me to hold one?"
}
```

## Which WhatsApp rules does Postgale enforce?

- Free-form replies are allowed for 24 hours after the customer’s last message. Outside that window only approved templates can be sent; Postgale refuses anything else and explains why.
- WhatsApp has no human-agent extension of the window (Instagram and Messenger do); Postgale does not pretend otherwise.
- A number must be registered before it can send; a test number can only message its allowed recipients. Postgale returns the specific error code for each case.
- The business token from Embedded Signup is stored encrypted and never shown to the agent.

## How do I keep a person in the loop?

- Approval: tick “Hold posts from this app for approval” when you sign in, or in the Postgale dashboard require approval for the API key the agent uses (or for the whole workspace, or one account). Posts then wait as pending approval; comment replies and moderation, direct messages, WhatsApp sends and edits to live posts wait in the same queue. A person approves, edits or rejects each one in Dashboard → Approvals; the agent’s own key or sign-in cannot approve.
- Tool annotations: every Postgale tool declares whether it only reads, writes, or publishes live, deletes or spends. Clients that honour annotations ask before destructive tools run.
- Audit log: every write the agent makes is recorded with the key or the connected app, the action and the time.
- Revoking: each sign-in appears under Dashboard → Connected apps and each key under Dashboard → API keys; either can be revoked at any time.

## What can’t an agent do on WhatsApp through Postgale?

- Send free-form messages outside the 24-hour window. Meta requires an approved template.
- Avoid Meta’s per-conversation charges. Meta bills the WhatsApp Business Account directly for template messages.
- Post to a feed. WhatsApp is messaging only.

## Questions

### Can Cursor answer customers and send messages on WhatsApp Business?

Yes, Cursor can answer customers and send messages on WhatsApp Business through Postgale. Add https://postgale.com/mcp to Cursor’s mcp.json and sign in to Postgale when Cursor asks (or use an API key header), connect your WhatsApp Business account in Postgale once, and Cursor can customer conversations, templates, media and the 24-hour window. A person can be required to approve every post, reply and message before it goes out.

### Does Cursor see my WhatsApp password or tokens?

No. The account owner signs in on the platform’s own page once, and Postgale stores the resulting tokens encrypted. Cursor only holds a Postgale API key or sign-in, which you can revoke at any time.

### Can I approve what Cursor sends to WhatsApp before it goes live?

Yes. Turn on approval for the API key it uses, the account or the whole workspace. Posts, replies and messages then wait in the Postgale dashboard until a person approves, edits or rejects them; Cursor’s own access cannot approve.

## Related

- [Cursor guide](https://postgale.com/guides/cursor)
- [WhatsApp Business for AI agents](https://postgale.com/integrations/whatsapp)
- [Cursor and Instagram](https://postgale.com/guides/cursor/instagram)
- [Cursor and Facebook](https://postgale.com/guides/cursor/facebook)
