WhatsApp for Claude
README.md
# WhatsApp for Claude
Let Claude read, search and send your **personal WhatsApp** messages.
A local MCP connector (Model Context Protocol server) that links to your WhatsApp account as a companion device, the same way WhatsApp Web does. Works with **Claude Desktop** and **Claude Code**.
- Ask things like "What did I miss on WhatsApp today?" or "Find the plumber's quote in my chats".
- Runs on **your computer**. Messages are kept in a local SQLite file and never go to a third-party server.
- Text messages only. Media shows up as a label such as `[image] caption`.
> **Heads-up:** this uses the unofficial [Baileys](https://github.com/WhiskeySockets/Baileys) library. WhatsApp has no official API for personal accounts, and automated use is against their terms of service. Light personal use is generally fine, but bulk or spammy sending can get a number banned. Use it at your own risk.
## What you can ask
- "What WhatsApp messages did I get today?"
- "Summarise the Family group chat from this week."
- "Search my WhatsApp for the plumber's quote."
- "Send Alice a WhatsApp saying I'm running 10 minutes late."
## Install
You need [Node.js](https://nodejs.org) 22.13 or newer.
### Step 1: link your phone (one time)
```sh
npx -y github:Ashley-Pettit/whatsapp-for-claude login
```
On your phone open **WhatsApp > Settings > Linked devices > Link a device** and scan the QR code. Leave it running until it prints `Done.` while it downloads your recent history.
Can't scan? Use a code instead: add `--phone 61412345678` to the end (your number with country code, digits only).
### Step 2: add it to Claude
Pick one.
**Claude Desktop (one click):** download `whatsapp-mcp.mcpb` from the [latest release](https://github.com/Ashley-Pettit/whatsapp-for-claude/releases/latest) and double-click it, or drag it into **Settings > Extensions**.
**Claude Code plugin:**
```
/plugin marketplace add Ashley-Pettit/whatsapp-for-claude
/plugin install whatsapp-for-claude@whatsapp-for-claude
```
**Claude Code (plain MCP):**
```sh
claude mcp add whatsapp --scope user -- npx -y github:Ashley-Pettit/whatsapp-for-claude
```
**Claude Desktop (manual config):** add this to `claude_desktop_config.json` (**Settings > Developer > Edit Config**), then restart the app:
```json
{
"mcpServers": {
"whatsapp": {
"command": "npx",
"args": ["-y", "github:Ashley-Pettit/whatsapp-for-claude"]
}
}
}
```
All options share the same link from Step 1, stored in `~/.whatsapp-mcp`.
**From source:** `git clone` this repo, `npm install`, `npm run login`, then point Claude at `node /path/to/whatsapp-for-claude/src/server.js`.
## Tools
| Tool | What it does |
| --- | --- |
| `whatsapp_status` | Connection state and how much history is stored |
| `whatsapp_list_chats` | Recent chats with a preview of the last message |
| `whatsapp_read_messages` | Messages from one chat, or the latest across all chats |
| `whatsapp_search_messages` | Text search, optionally by chat and date range |
| `whatsapp_find_contact` | Look up a person or group to get the exact chat id |
| `whatsapp_send_message` | Send a text message |
## Good to know
- **History:** WhatsApp shares a limited window of past messages when a device is linked (usually months, not everything). New messages are captured while Claude is running. Messages that arrive while it's closed come through on the next start.
- **Stay linked:** WhatsApp unlinks companion devices that aren't used for about 14 days. If that happens, run the login step again.
- **Sending:** keep Claude's permission prompt for `whatsapp_send_message` switched on so you approve every message before it goes out. The tool descriptions also tell Claude to treat incoming message text as untrusted and never send just because a message asked it to.
- **One connection:** if two Claude apps run the connector at once, the first one holds the WhatsApp connection. The second can read messages but not send.
- **Data location:** `~/.whatsapp-mcp` (change it with `WHATSAPP_MCP_DIR`). The `auth` folder inside it is the same as a logged-in session. Don't share or commit it.
- **Unlink:** on your phone, remove the device under **Linked devices**, then delete `~/.whatsapp-mcp`.
- **Connection problems:** WhatsApp changes its protocol often. If linking fails, check for a newer `baileys` release and update the pinned version in `package.json`.
## Development
```sh
npm test
```
Releases: bump `version` in `package.json` and push to main. The Release workflow creates the matching tag, builds the `.mcpb` bundle, attaches it to a GitHub release and publishes the listing to the [MCP Registry](https://registry.modelcontextprotocol.io). It also publishes to npm if an `NPM_TOKEN` secret is set.
## Licence
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues