whatsapp-mcp-free
Provides tools for interacting with WhatsApp, enabling AI agents to read chats, messages, groups, newsletters, and statuses; send messages and files; manage groups and channels; and process an AI inbox triggered by custom prefixes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@whatsapp-mcp-free check my unread WhatsApp messages and summarize them"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
whatsapp-mcp-free
Free WhatsApp MCP server for CLI AI agents — no official API key needed.
Built on @whiskeysockets/baileys (WhatsApp Web multi-device protocol).
Works with any MCP-compatible AI CLI: opencode, Claude Code, Codex, Cursor,
Qwen Code, Gemini CLI, Cline, Roo Code — stdio (default) or streamable HTTP.
Self-tested: standard initialize → tools/list (29 tools) → tools/call.
⚠️ Unofficial API. WhatsApp may ban numbers using unofficial clients. Use a secondary number first, send slowly (2s+ gap), avoid broadcasts. One WA session = one process. Never run two clients/bots on the same AUTH_DIR.
Quick start
npm install
npm run build
npm start # prints QR to terminal (stderr)Scan the QR with WhatsApp > Settings > Linked Devices > Link a Device
Auth saves to
./wa-auth/(gitignored) — next starts need no QRWire it to your agent (below), then ask: "check WhatsApp connection status"
Related MCP server: zaileys-mcp
Use with opencode
~/.config/opencode/opencode.jsonc (global) or project opencode.json:
{
"mcp": {
"whatsapp-free": {
"type": "local",
"command": ["node", "E:/Personal/Coding/whatsapp-mcp-free/dist/index.js"],
"cwd": "E:/Personal/Coding/whatsapp-mcp-free",
"environment": {
"WHATSAPP_AUTH_DIR": "E:/Personal/Coding/whatsapp-mcp-free/wa-auth",
"WHATSAPP_AI_ENABLED": "1",
"WHATSAPP_AI_PREFIX": "/Wa.p",
"WHATSAPP_AI_COOLDOWN_S": "10",
"WHATSAPP_AI_ALLOW": "",
"WHATSAPP_AI_REACT_QUEUE": "👀",
"WHATSAPP_AI_REACT_DONE": "✅"
},
"enabled": true,
"timeout": 60000
}
}
}Wajib:
cwd+WHATSAPP_AUTH_DIRabsolut dan sama antara manual vs MCP. Tanpa ini MCP bikin sesi baru di folder lain (gejala:connected:false,hasQr:trueterus).
Restart opencode after editing. First start prints the QR in opencode's MCP logs / terminal — scan within ~60s.
Setup pertama kali (orang baru)
Syarat: Node.js ≥ 20, nomor WA kedua (jangan nomor utama — risiko ban), HP + laptop satu jaringan tidak wajib tapi HP harus online.
Install & login manual (sekali saja, untuk scan QR):
cd E:/Personal/Coding/whatsapp-mcp-free npm install npm run build npm startScan QR di terminal via WhatsApp > Linked Devices > Link a Device (≤ 60 dtk). Sukses ditandai
[whatsapp] connected. Matikan denganCtrl+C.Pasang ke opencode: copy blok JSON di atas ke
opencode.jsonc, sesuaikan path.Restart opencode total, lalu verifikasi dari chat agent:
ping→ haruspong:truedoctor→ok:true,connected:true,credsExists:truelist_chats→ chat mulai muncul setelah ada pesan masuk
Tes AI inbox: dari WA kirim
/Wa.p halo, lalu minta agentcek ai_inbox→ jawab viaai_reply confirm=true.Jangan jalankan
npm startmanual barengan dengan opencode (sesi rebutan → disconnect bolak-balik). Satu proses saja.Opsional: isi
WHATSAPP_AI_ALLOWdengan nomor full-akses (62812..,62897..), kosong = semua boleh.
HTTP mode (one server, many clients)
WHATSAPP_MCP_TRANSPORT=http WHATSAPP_HTTP_HOST=127.0.0.1 WHATSAPP_HTTP_PORT=8787 WHATSAPP_HTTP_PATH=/mcp npm startMCP endpoint:
http://127.0.0.1:8787/mcpHealth:
http://127.0.0.1:8787/healthCodex:
codex mcp add whatsapp --url http://127.0.0.1:8787/mcp
Semua AI CLI (kompatibilitas)
Server ini MCP standar (stdio JSON-RPC di stdin/stdout, log+QR hanya ke stderr). Semua pola di bawah memakai binary + auth yang sama — pilih SATU client aktif dalam satu waktu per AUTH_DIR.
opencode (
opencode.jsonc, lihat blok lengkap di atas).Claude Code:
claude mcp add whatsapp-free --cwd E:/Personal/Coding/whatsapp-mcp-free -e WHATSAPP_AUTH_DIR=E:/Personal/Coding/whatsapp-mcp-free/wa-auth -- node E:/Personal/Coding/whatsapp-mcp-free/dist/index.jsCodex:
codex mcp add whatsapp-free --cwd E:/Personal/Coding/whatsapp-mcp-free --env WHATSAPP_AUTH_DIR=E:/Personal/Coding/whatsapp-mcp-free/wa-auth -- node E:/Personal/Coding/whatsapp-mcp-free/dist/index.jsCursor (
.cursor/mcp.json):{ "mcpServers": { "whatsapp-free": { "command": "node", "args": ["E:/Personal/Coding/whatsapp-mcp-free/dist/index.js"], "cwd": "E:/Personal/Coding/whatsapp-mcp-free", "env": { "WHATSAPP_AUTH_DIR": "E:/Personal/Coding/whatsapp-mcp-free/wa-auth" } } } }Qwen Code / Gemini CLI (
~/.qwen/settings.jsonatau~/.gemini/settings.json):qwen mcp add -s user -e WHATSAPP_AUTH_DIR=E:/Personal/Coding/whatsapp-mcp-free/wa-auth --timeout 60000 whatsapp-free node E:/Personal/Coding/whatsapp-mcp-free/dist/index.jsHTTP (client apa pun): jalankan server sekali (lihat HTTP mode), lalu daftarkan URL
/mcp-nya di client masing-masing — cocok untuk banyak client tanpa rebutan sesi.
Cara kerja (teks)
HP (WhatsApp) SERVER whatsapp-mcp-free AI CLI (opencode/claude/codex/qwen/...)
============= ======================== =========================================
(1) client spawn via stdio:
node dist/index.js
+ env WHATSAPP_AUTH_DIR
(2) QR sekali saat <---- stdout: JSON-RPC MCP (29 tools)
pertama: stderr: QR + log (tidak ganggu MCP)
Linked Devices
scan QR
\____________________ Baileys socket ____________________/
\/ (WA Web protocol, 1 sesi)
wa-auth/ <-- creds.json, keys, lid-mapping
+
store.json <-- chats, pesan, kontak, antrean AI
BACA (tidak perlu konek ulang, dari cache + live bila perlu):
<------ list_chats / list_groups / list_newsletters (nama live)
<------ list_messages / search_messages / search_contacts / resolve_lid
<------ list_status / fetch_status_text / group_metadata / newsletter_metadata
TULIS (semua confirm=true, jeda 2 dtk anti-ban):
------> send_message / send_file / post_status / delete_status
------> group_leave / newsletter_follow|unfollow|mute ------> WA
AI INBOX /Wa.p (MCP tidak bisa push -> agent POLL tiap giliran):
user ketik: /Wa.p tolong rangkum ini
----> socket tangkap -> cek ALLOW -> react 👀 -> antre di store
agent: ai_inbox (lihat antrean) -> mikir (boleh baca chat dulu)
-> ai_reply confirm=true -> terkirim ke chat asal + react ✅
bukan ALLOW: tetap tersimpan sebagai chat biasa, tanpa antre/balas
DIAGNOSTIK: ping (pong+jam) | doctor (creds/store/versi/antrean) | help (panduan)
connection_status | auth_qrTools (v0.7)
Tool | What it does |
| connected? logged-in JID? |
| latest pairing QR text |
| recent chats |
| groups only (cache) |
| all participating groups with live subject/size |
| one group: subject, participants, admins |
| leave a group (needs |
| followed channels with live names |
| one channel: name, desc, subscribers |
| follow/unfollow (needs |
| mute/unmute channel (needs |
| history of one chat |
| substring search in cache |
| find by name/phone (+pn bila LID) |
| ubah LID acak jadi nowa + nama |
| contact About text |
| cached Status/stories |
| buat Status teks/media (needs |
| hapus Status sendiri (needs |
| config prefix AI + antrean |
| antrean |
| jawab antrean + kirim ke chat asal (needs |
| bersihkan antrean (needs |
| pong + jam server + status koneksi |
| diagnostik: creds, store, versi, antrean |
| panduan pakai + troubleshooting |
| send text (needs |
| send local file (needs |
AI inbox: /Wa.p (v0.7)
Nomor full-akses di WA ketik:
/Wa.p tolong rangkum chat iniNomor di
WHATSAPP_AI_ALLOW= full akses: pesan di-react 👀, masuk antrean, dijawab agent (react ✅ habisai_reply)Nomor lain = chat biasa: tetap tersimpan, tanpa antre, tanpa auto-balas
WHATSAPP_AI_ALLOWkosong = semua chat boleh (mode lama)
Alur agent per giliran:
ai_inbox→ ambil prompt belum terjawabJawab dengan pengetahuan +
list_messages/searchbila perluai_replydenganconfirm=true→ terkirim ke chat asal +answered+ react ✅Jeda 2 dtk antar kirim (anti-ban)
Config (env):
Var | Default | Meaning |
|
|
|
|
| prefix pemicu (case-insensitive) |
|
| cooldown per pengirim |
|
| potong prompt |
| (kosong) |
|
|
| react saat antre; kosong = mati |
|
| react habis jawab; kosong = mati |
Destructive sends require confirm=true so agents don't fire accidentally.
Config (env)
Var | Default | Meaning |
|
| Baileys auth + store cache |
|
|
|
|
| http bind |
|
| http port |
|
| MCP endpoint |
|
|
|
Roadmap
download_media+ voice-note transcribe (Whisper-compatible endpoint)sync_contactsfrom VCFRate-limit / anti-ban queue
SQLite store option (currently JSON file)
Dev
npm run dev # tsx hot run
npm run build # tsc -> dist/Requires @whiskeysockets/baileys@^7.0.0-rc.9 or later for QR pairing.
License
MIT — see LICENSE. Contributions welcome (CONTRIBUTING.md).
Available Tools
29 toolsai_clearB
Bersihkan antrean AI. answered-only default true. Requires confirm=true.
Inputs: confirm, onlyAnswered.
ai_configB
Lihat config prefix AI (/Wa.p), allowlist, react, cooldown, dan jumlah antrean
Inputs: no named parameters.
ai_inboxA
Antrean prompt /Wa.p dari WA untuk dijawab agent. Poll ini tiap giliran.
Inputs: limit, onlyUnanswered.
ai_replyA
Jawab antrean /Wa.p: kirim ke chat asal + tandai answered. Requires confirm=true. Jeda 2s antar kirim.
Inputs: answer (required), chatJid (required), messageId (required), confirm.
auth_qrA
Get the latest WhatsApp pairing QR (also printed on stderr). Scan with WhatsApp > Linked Devices.
Inputs: no named parameters.
connection_statusB
WhatsApp connection state + logged-in JID
Inputs: no named parameters.
delete_statusA
Hapus Status/story milik sendiri via message id. Requires confirm=true.
Inputs: messageId (required), confirm.
doctorB
Diagnostik WA: koneksi, creds, store, versi, antrean AI
Inputs: no named parameters.
fetch_status_textB
Check contact About/status text (fetchStatus). Input phone numbers or JIDs.
Inputs: jids (required).
group_leaveA
Leave a group. Requires confirm=true. Cannot be undone by bot.
Inputs: jid (required), confirm.
group_list_liveB
List all participating groups with live names (subject, size). Falls back to cache when offline.
Inputs: no named parameters.
group_metadataB
Check one group: subject, participants, admins, timestamps
Inputs: jid (required).
helpA
Panduan pakai whatsapp-mcp-free: tools, /Wa.p, anti-ban, troubleshooting
Inputs: no named parameters.
list_chatsC
List chats sorted by recent activity
Inputs: limit.
list_groupsB
List WhatsApp groups only
Inputs: limit.
list_messagesB
Recent messages from one chat (jid or phone number)
Inputs: jid (required), limit.
list_newslettersA
List followed WhatsApp channels (newsletters) with live names. Falls back to cache when offline.
Inputs: limit.
list_statusA
List cached Status/stories (status@broadcast), mine + contacts seen this session
Inputs: limit.
newsletter_followC
Follow a channel. Requires confirm=true.
Inputs: jid (required), confirm.
newsletter_metadataB
Check one channel: name, description, subscribers, verification
Inputs: jid (required).
newsletter_muteA
Mute/unmute a channel. Requires confirm=true.
Inputs: jid (required), muted, confirm.
newsletter_unfollowA
Unfollow a channel. Requires confirm=true.
Inputs: jid (required), confirm.
pingB
Ping MCP server: balas pong + jam server + status koneksi WA
Inputs: echo.
post_statusA
Buat Status/story teks (atau gambar/video jika filePath diisi). Requires confirm=true.
Inputs: font, text, confirm, filePath, +1 more.
resolve_lidA
Ubah LID acak jadi nowa + nama kontak (cache dulu, live bila perlu)
Inputs: lids (required).
search_contactsA
Find contacts by name or phone fragment
Inputs: query (required).
search_messagesB
Substring search across cached messages
Inputs: query (required), limit.
send_fileB
Send a local file as image/video/audio/document. Requires confirm=true.
Inputs: to (required), filePath (required), caption, confirm.
send_messageA
Send a text message. Requires confirm=true. Add 2s gap between sends to avoid bans.
Inputs: to (required), text (required), confirm.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools target distinct resources and actions, but there is clear overlap among connection_status, ping, and doctor, as well as between list_groups and group_list_live. Descriptions help somewhat, but an agent could easily pick the wrong diagnostic or group-list tool.
Names are mostly snake_case, but patterns are mixed: list_chats and list_groups coexist with group_list_live, while bare names like ping, doctor, and help break the verb_noun style. It remains readable, but the naming convention is not consistently applied.
At 29 tools, the surface is above the 25+ threshold and feels heavy for a WhatsApp MCP, especially with several overlapping health-check and group-list utilities. A more focused set could cover the same workflows with fewer near-duplicate tools.
The server covers connection, messaging, groups, newsletters, status, and AI queue workflows, but notable lifecycle operations are missing: no group creation or participant management, no message edit/delete, and no read/seen actions. Agents can work around some gaps, but create/get without update/delete leaves dead ends.
Maintenance
Related MCP Connectors
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
Read-only WhatsApp MCP for your AI agent: it reads the chats you choose. Try the public demo.
WhatsApp for AI agents — your own number or the official Cloud API: messages, media, templates.
WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history — all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with your personal WhatsApp account to search messages, list chats, and send messages. It stores all authentication and message data locally using SQLite for privacy and direct multi-device API connection.1ISC
- AlicenseBqualityDmaintenanceEnables AI agents to control WhatsApp, including sending messages and media, reading chats, managing groups and communities, with QR/pairing auth and session persistence.1415 npm2MIT
- AlicenseNot gradedqualityBmaintenanceConnects WhatsApp with AI agents and CLI, enabling agents to read and send messages while imitating the user's unique communication style per contact through a local memory system.245 npm5MIT

GoWA MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents and tools to send and manage WhatsApp messages, media, statuses, and scheduled sends across multiple linked devices.MIT