Whatsapp MCP README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Whatsapp MCP listing page.

πŸ“± WhatsApp MCP

Give your AI agent a WhatsApp account.

Read, search, send, schedule, and manage WhatsApp β€” all through the Model Context Protocol. 87 tools, one process (Node or Bun), your messages in local SQLite.

Works with any MCP client β€” Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot), OpenAI Codex CLI, OpenCode, Cline, Zed, Goose, and more.

Release License: MIT Node Bun MCP


[!WARNING] Use a dedicated/burner number. This is unofficial automation and violates WhatsApp's Terms of Service β€” your account can be banned. Never connect your primary line. New numbers should warm up slowly (~20 messages/day for the first week). You accept this risk.


✨ What you can do

Ask your assistant things like:

β€œWhat did the design team say in the group chat today?” β€œSend the invoice template to +60123456789 with order #4471.” β€œSchedule a birthday message to Rimu for 9am tomorrow.” β€œWho voted for option B in yesterday's poll?” β€œPost a status to my close friends with this photo.”

It just works β€” your assistant drives WhatsApp on your behalf.

🎯 Features

πŸ’¬ MessagingText, media, location, contacts, polls, events, reactions, edits, replies, forwards, pins
πŸ”Ž Read & searchFull-text search your whole history offline β€” chats, contacts, unread, media download
πŸ‘₯ GroupsCreate, manage members, admin controls, invite links, join requests, metadata
πŸ“£ Status / StoryRich text (backgrounds + fonts), image, video, gif, voice β€” to contacts and groups
πŸ—‚οΈ Chat managementArchive, pin, mute, star, mark read, disappearing messages
πŸ” Profile & privacyName, about, avatar, block list, privacy settings, presence
⏰ AutomationScheduled messages, reusable templates, keyword auto-replies
🧩 InteractiveButtons, lists, and commerce (product/order) messages
πŸ›‘οΈ Safety built-inAnti-ban send pacing, daily cap, and a one-flip kill-switch for all sends

β†’ See all 87 tools

πŸš€ Quick start

1. Add it to your agent

No install, no token, no path β€” npx (or bunx) fetches and runs it on demand. Pick your client below.

Requires Node 18+ (for npx) or Bun (for bunx). Using Bun instead? Swap npx -y for bunx in any command below.

Claude Code
Terminal
claude mcp add whatsapp -- npx -y @kahflane/whatsapp-mcp
OpenAI Codex CLI

Add to ~/.codex/config.toml:

toml
[mcp_servers.whatsapp]
command = "npx"
args = ["-y", "@kahflane/whatsapp-mcp"]
env = { WA_PAIRING_NUMBER = "", WA_SYNC_FULL_HISTORY = "true", WA_DAILY_CAP = "100" }
OpenCode

Add to opencode.json (or ~/.config/opencode/opencode.json):

config.json
{
  "mcp": {
    "whatsapp": {
      "type": "local",
      "command": ["npx", "-y", "@kahflane/whatsapp-mcp"],
      "enabled": true
    }
  }
}
Cursor / Windsurf / Cline / Zed

These read a JSON MCP block (Cursor: ~/.cursor/mcp.json, Windsurf: ~/.codeium/windsurf/mcp_config.json, Cline: its MCP settings, Zed: settings.json under context_servers):

config.json
{
  "mcpServers": {
    "whatsapp": {
      "command": "npx",
      "args": ["-y", "@kahflane/whatsapp-mcp"],
      "env": { "WA_PAIRING_NUMBER": "", "WA_SYNC_FULL_HISTORY": "true", "WA_DAILY_CAP": "100" }
    }
  }
}
Claude Desktop / VS Code Copilot / Goose / any other MCP client

Add the same server block to your client's config (Claude Desktop: claude_desktop_config.json, VS Code: .vscode/mcp.json, Goose: its extensions config):

config.json
{
  "mcpServers": {
    "whatsapp": {
      "command": "npx",
      "args": ["-y", "@kahflane/whatsapp-mcp"],
      "env": {
        "WA_PAIRING_NUMBER": "",
        "WA_SYNC_FULL_HISTORY": "true",
        "WA_DAILY_CAP": "100"
      }
    }
  }
}
Prefer to run from source?
bash
git clone https://github.com/kahflane/whatsapp-mcp.git
cd whatsapp-mcp && bun install
# then point your client at:  bun run /ABSOLUTE/PATH/TO/whatsapp/src/index.ts

2. Log in

Restart your MCP client, then just ask your assistant to connect:

  1. β€œCheck WhatsApp status” β†’ it calls wa_status.
  2. β€œShow me the login QR” β†’ it calls wa_get_login_qr. Scan it in WhatsApp β–Έ Settings β–Έ Linked Devices. (Prefer a code? Set WA_PAIRING_NUMBER and ask for the pairing code instead.)
  3. β€œCheck status again” β†’ reads open. Your history starts syncing into local SQLite.

Auth persists β€” you only do this once. πŸŽ‰

🧠 How it works

One process is both the MCP server and the WhatsApp client β€” a single long-lived WebSocket shared by every tool, with everything stored in local SQLite.

Code
  Your AI assistant
        β”‚  stdio (JSON-RPC)
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  whatsapp-mcp  (one Node/Bun process)         β”‚
β”‚                                               β”‚
β”‚   MCP Server  ◄──►  Baileys WhatsApp socket   β”‚
β”‚        β”‚                     β”‚                 β”‚
β”‚        └────────►  SQLite β—„β”€β”€β”˜                 β”‚
β”‚              (contacts Β· chats Β· messages)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Local-first β€” your full history lives on your machine in SQLite. Reading & search work offline.
  • Private β€” auth credentials and your message database never leave your computer.
  • Safe by default β€” every send is paced with jittered delays + a daily cap, and can be frozen instantly with the kill-switch.

βš™οΈ Configuration

All optional, set via environment variables (see .env.example):

VariableDefaultDescription
WA_PAIRING_NUMBER(empty)Set a number to log in by code instead of QR
WA_SYNC_FULL_HISTORYtruePull full chat history on first sync
WA_DAILY_CAP100Max sends per day (anti-ban)
WA_MIN_GAP_MS / WA_MAX_GAP_MSβ€”Jittered delay window between sends
WA_DATA_DIR~/.whatsapp-mcpWhere auth, database + media live (WA_AUTH_DIR / WA_DB_PATH / WA_MEDIA_DIR default under it)
WA_LOG_LEVELwarnLog verbosity (to stderr)

🧰 Tool reference

Connection & login
ToolDescription
wa_statusConnection, login state, store stats, send counters
wa_get_login_qr Β· wa_get_pairing_codeFirst-time login
wa_logoutLog out and wipe local auth
wa_restrict_sendingπŸ›‘ Kill-switch β€” block/allow all outbound sends
Reading & search (works offline)
ToolDescription
wa_list_chatsList chats, newest first
wa_list_contacts Β· wa_resolve_nameContacts + name resolution
wa_get_messagesRead a chat's full messages
wa_search_messagesFull-text search your history
wa_get_unread Β· wa_mark_readUnread tracking + read receipts
wa_fetch_historyPull older history (50/call)
wa_history_statusSync progress
wa_download_mediaDownload + decrypt media to a file
Sending
ToolDescription
wa_check_numberVerify numbers are on WhatsApp (anti-ban precheck)
wa_send_textText with mentions / reply / typing
wa_send_mediaImage, video, audio, document, sticker
wa_send_location Β· wa_send_contactLocation pin Β· contact card(s)
wa_send_poll Β· wa_get_poll_votesSend a poll Β· read decrypted vote tallies
wa_send_eventEvent card
wa_send_buttons Β· wa_send_listInteractive buttons + list messages
wa_react Β· wa_edit_message Β· wa_delete_messageModify messages
wa_forward_message Β· wa_pin_messageForward Β· pin in chat
wa_send_broadcast Β· wa_broadcast_infoBroadcast to a list Β· query a list
wa_send_product Β· wa_send_orderCommerce messages (Business accounts)
Status / Story
ToolDescription
wa_post_statusPost a story mentioning up to 5 contacts
wa_post_status_toPost to a chosen audience (contacts and groups) β€” text with rich backgrounds + fonts, image, video, gif, voice note, audio
Chat management
ToolDescription
wa_archive_chat Β· wa_pin_chat Β· wa_mute_chatArchive Β· pin Β· mute (and undo)
wa_mark_chat_read Β· wa_star_messageMark read/unread Β· star a message
wa_delete_chat Β· wa_delete_message_for_meDelete chat Β· clear a message locally
wa_disappearing_chatPer-chat disappearing-message timer
Groups
ToolDescription
wa_create_group Β· wa_groups_list Β· wa_group_metadataCreate Β· list all Β· full metadata
wa_get_group_membersParticipants with names + admin flags
wa_group_participantsAdd / remove / promote / demote
wa_group_update_subject Β· wa_group_update_descriptionRename Β· set description
wa_group_setting Β· wa_group_add_mode Β· wa_group_ephemeralAnnounce-lock Β· who-can-add Β· disappearing
wa_group_invite_code Β· wa_group_join Β· wa_group_info_by_codeInvite links Β· join Β· preview by code
wa_group_join_requests Β· wa_group_join_decisionList Β· approve/reject requests
wa_group_member_label Β· wa_group_leaveLabel a member Β· leave group
Profile, privacy & presence
ToolDescription
wa_set_name Β· wa_set_status Β· wa_set_picture Β· wa_remove_pictureManage your own profile
wa_block Β· wa_blocklistBlock/unblock Β· list blocked
wa_get_privacy Β· wa_set_privacy Β· wa_default_disappearingRead/set privacy + default timer
wa_get_status Β· wa_get_picture_url Β· wa_get_business_profileSomeone's about Β· avatar Β· business profile
wa_subscribe_presence Β· wa_send_presenceSubscribe to Β· broadcast presence
Calls Β· Scheduling Β· Templates Β· Auto-reply
ToolDescription
wa_reject_callReject an incoming call
wa_schedule_message Β· wa_list_scheduled Β· wa_cancel_scheduledSchedule sends (persisted, fires exactly once)
wa_list_templates Β· wa_render_template Β· wa_create_template Β· wa_send_templateReusable message templates
wa_autoreply_set Β· wa_autoreply_add_rule Β· wa_autoreply_list_rules Β· wa_autoreply_remove_ruleKeyword/pattern auto-replies (off by default)

πŸ’‘ Good to know

  • Only one server may run at a time β€” it owns the auth dir + database. After changing config, restart your MCP client to respawn it.
  • History arrives in chunks after login; wa_fetch_history pages older messages 50 at a time (WhatsApp may not always relay on-demand history to linked devices).
  • Pacing reduces, not eliminates, ban risk. Respect the daily cap and warm up new numbers slowly.
  • Auto-reply is OFF by default. Enable it explicitly with wa_autoreply_set.

πŸ› οΈ Tech

Node Β· Bun Β· node-sqlite3-wasm Β· bun:sqlite Β· @innovatorssoft/baileys Β· Anthropic MCP SDK Β· TypeScript

🀝 Contributing

Issues and PRs welcome. Run bun run typecheck and bun run build before submitting β€” they're the verification gates.

πŸ“„ License

MIT Β© KahfLane

Not affiliated with or endorsed by WhatsApp or Meta. Use responsibly and at your own risk.