loading…
Search for a command to run...
loading…
Gives Claude Desktop read-only access to your WhatsApp chats and message history via a local MCP server.
Gives Claude Desktop read-only access to your WhatsApp chats and message history via a local MCP server.
A Model Context Protocol (MCP) server that gives Claude Desktop read-only access to your WhatsApp chats and message history.
Built on Baileys (WhatsApp Web protocol) — no phone number, no business API, no cloud service. Everything runs locally on your machine.
⚠️ Disclaimer This is an unofficial integration. WhatsApp may terminate accounts that use unauthorized clients. Use a secondary/test number, not your primary one. Author is not responsible for bans.
| Tool | Description |
|---|---|
whatsapp_status |
Connection status + DB stats |
whatsapp_list_chats |
List chats (sorted by last message), optional keyword search |
whatsapp_read_messages |
Read messages from a specific chat JID |
node --versiongit clone https://github.com/danialadzhar/mcp-whatsapp.git
cd mcp-whatsapp
npm install
If
better-sqlite3fails to build, ensure you have Xcode Command Line Tools (macOS):xcode-select --install
⚠️ Important — do this BEFORE configuring Claude Desktop. The QR code can only be displayed in the terminal via
setup.js. The MCP server (launched by Claude Desktop) cannot show the QR because its stdout is reserved for the MCP protocol. If you skip this step and go straight to Claude Desktop config, your bot will be stuck atconnectingforever with no way to pair.
node setup.js
A QR code will appear in the terminal.
Terminal will print:
[HISTORY] chats=35 msgs=500 isLatest=false | batch #1 | DB: 35 chats, 500 messages
[HISTORY] chats=0 msgs=1200 isLatest=false | batch #2 | DB: 35 chats, 1700 messages
...
Depending on your account size, this takes 5-30 minutes. The script auto-detects completion when no new batch has arrived for 30 seconds.
When you see HISTORY SYNC COMPLETE and SAFE TO EXIT, press Ctrl+C.
⚠️ Not compatible with Claude Desktop Cowork / Scheduled Tasks. When Cowork or Scheduled Tasks features are enabled, Claude Desktop spawns multiple MCP server instances for background agents. WhatsApp only allows one active linked-device connection at a time, so the duplicate instances fight for the session and cause a
status=440, reconnect=trueloop. Disable both in your config (see step 2 below) or this integration will not work reliably.
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Open the file and merge this into the mcpServers section (create the key if it doesn't exist):
{
"mcpServers": {
"whatsapp": {
"command": "/absolute/path/to/node",
"args": [
"/absolute/path/to/mcp-whatsapp/mcp-server.js"
]
}
}
}
Replace with your actual paths:
which node (macOS/Linux) or where node (Windows)Example (macOS, Homebrew node) with Cowork/Scheduled Tasks disabled:
{
"mcpServers": {
"whatsapp": {
"command": "/opt/homebrew/bin/node",
"args": [
"/Users/yourname/projects/mcp-whatsapp/mcp-server.js"
]
}
},
"preferences": {
"coworkScheduledTasksEnabled": false,
"ccdScheduledTasksEnabled": false
}
}
If you already have a "preferences" block in your config, just add the two *ScheduledTasksEnabled keys into it — don't duplicate the block.
Fully quit with Cmd+Q (not just close window), then reopen.
In any Claude Desktop chat, ask:
what is my whatsapp status
Claude will call the whatsapp_status tool. Approve the permission prompt when it appears.
Once connected, you can ask Claude Desktop:
Claude decides which tools to call based on your question.
Error: Cannot find module '@whiskeysockets/baileys'You didn't install dependencies.
cd mcp-whatsapp
npm install
status=440, reconnect=true loop in logsTwo processes are fighting for the same WhatsApp session. Common causes:
claude_desktop_config.json:"preferences": {
"coworkScheduledTasksEnabled": false,
"ccdScheduledTasksEnabled": false
}
ps aux | grep "mcp-whatsapp" | grep -v grep
kill <PID>
setup.jsauth_info/:ps aux | grep "mcp-whatsapp" | grep -v grep
setup.js.auth_info/ and retry:rm -rf auth_info
node setup.js
# macOS
python3 -c "import json; json.load(open('$HOME/Library/Application Support/Claude/claude_desktop_config.json'))"
# macOS
tail -50 ~/Library/Logs/Claude/mcp-server-whatsapp.log
which node
connectionState: "connecting" forever# 1. Quit Claude Desktop (Cmd+Q)
# 2. Delete auth
rm -rf auth_info whatsapp.db
# 3. Re-run setup
node setup.js
# 4. Scan QR
0 chats, 0 messages in DB after setuprm -rf auth_info whatsapp.db
node setup.js
When your phone asks, choose to include history this time.node-gyp / better-sqlite3 build errorsxcode-select --installsudo apt install build-essential python3First time each tool is called, Claude Desktop asks for approval. Pick "Allow for this task" for smooth usage. You can also set permissions per-tool in Claude Desktop Settings.
No. The MCP server only runs while Claude Desktop is open. When Claude Desktop quits, the bot disconnects.
However — WhatsApp queues undelivered messages to linked devices for up to ~14 days. When you reopen Claude Desktop, offline messages arrive and are saved to the DB.
For true 24/7 capture, run a separate background daemon (not included in this repo).
Risk exists for any unofficial client. Mitigations:
This version is read-only intentionally (safer). To add send capability, add a whatsapp_send_message tool in mcp-server.js — but be careful, MCP-triggered sends are powerful and can be abused by prompt injection.
auth_info/ — session credentials (keep private, do not share/commit)whatsapp.db — SQLite with your chats and messages (keep private)Both are gitignored.
# Quit Claude Desktop
# Remove MCP server entry from claude_desktop_config.json
# Delete the repo folder
rm -rf mcp-whatsapp
On your phone: WhatsApp → Linked Devices → remove this device.
No. WhatsApp allows only one active connection per linked device auth. Running multiple MCP instances causes the status=440 conflict loop.
Group chats are supported — listed and readable like any other chat. JIDs end with @g.us.
Issues and PRs welcome. Please:
send_message without thoughtful safety design (permission gates, rate limits, confirmation UX)MIT © Danial Adzhar
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"whatsapp-mcp-server": {
"command": "npx",
"args": []
}
}
}