# @kahflane/whatsapp-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/kahflane/whatsapp-mcp  
**GitHub Stars:** 8  
**npm Downloads (last month):** 416  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/kahflane-whatsapp-mcp

## Description
WhatsApp MCP server built on the innovatorssoft Baileys fork + the Anthropic Model Context Protocol SDK. Runs on Node or Bun.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "whatsapp-mcp": {
    "command": "npx",
    "args": ["-y","@kahflane/whatsapp-mcp"],
    "env": {
      "WA_PAIRING_NUMBER": "",
      "WA_SYNC_FULL_HISTORY": "",
      "WA_DAILY_CAP": "",
      "WA_MIN_GAP_MS": "",
      "WA_MAX_GAP_MS": "",
      "WA_DATA_DIR": "",
      "WA_LOG_LEVEL": ""
    }
  }
}
```

**Requires environment variables:** `WA_PAIRING_NUMBER`, `WA_SYNC_FULL_HISTORY`, `WA_DAILY_CAP`, `WA_MIN_GAP_MS`, `WA_MAX_GAP_MS`, `WA_DATA_DIR`, `WA_LOG_LEVEL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What @kahflane/whatsapp-mcp does

@kahflane/whatsapp-mcp exposes WhatsApp account operations as Model Context Protocol tools. It can inspect connection state, list chats and contacts, resolve names, read messages, search synchronized history, track unread conversations, and download media. Messaging tools cover text, images, video, audio, documents, stickers, locations, contacts, polls, events, reactions, edits, replies, forwards, pins, broadcasts, interactive buttons, lists, and commerce messages for Business accounts.

The tool set also covers group administration, chat organization, profile and privacy settings, status or story publishing, scheduled messages, reusable templates, and keyword-based automatic replies. Status content can include text, images, video, GIFs, and voice, with delivery to contacts or groups.

## How it works

The MCP process contains both the protocol server and the WhatsApp client. A long-lived Baileys WebSocket handles the WhatsApp connection while the MCP side receives JSON-RPC requests from an AI client over stdio. Contacts, chats, messages, authentication data, and media are kept on the local machine in SQLite and related local directories.

Reading and searching can use the locally synchronized history without an active online lookup. On first login, the account can synchronize its history into the local store. Authentication persists between runs, so the QR or pairing-code login is intended as an initial setup step rather than a recurring action.

Outbound activity includes jittered send delays, a configurable daily send limit, and a kill-switch that blocks all sends. These controls are intended to reduce automated sending risk, not to guarantee account safety.

## Setup and configuration

The package can be launched on demand with `npx -y @kahflane/whatsapp-mcp` or with `bunx`, requiring Node.js 18+ for `npx` or Bun 1.1+. It can also be run from a source checkout after installing dependencies with Bun. MCP clients need a local server entry whose command is `npx` and whose arguments are `-y` and `@kahflane/whatsapp-mcp`.

After restarting the client, call `wa_status`, request a login QR with `wa_get_login_qr`, and scan it from WhatsApp's Linked Devices settings. `WA_PAIRING_NUMBER` enables pairing-code login instead. The connection state can then be checked again with `wa_status`.

Configuration is supplied through environment variables. `WA_SYNC_FULL_HISTORY` controls full history synchronization on the first sync, `WA_DAILY_CAP` sets the daily send ceiling, and `WA_MIN_GAP_MS` plus `WA_MAX_GAP_MS` define the jittered delay range. `WA_DATA_DIR` selects the base directory for authentication, the database, and media; `WA_LOG_LEVEL` controls stderr logging. The default data directory is `~/.whatsapp-mcp`.

## Tools and capabilities

- Check connection, login state, store statistics, and send counters.
- Obtain a QR code or pairing code, log out, and remove local authentication.
- List chats and contacts, resolve names, read messages, search history, and inspect unread items.
- Fetch older history, monitor synchronization, and download decrypted media.
- Send and modify messages, including polls, events, broadcasts, interactive content, and Business commerce messages.
- Create and administer groups, manage invite links and join requests, and control chat settings.
- Publish status content, manage profile and privacy settings, and configure automation.
- Restrict outbound sending with the kill-switch.

## Limitations and notes

WhatsApp automation through this project is unofficial and violates WhatsApp's Terms of Service according to its warning. Accounts can be banned, so the project recommends using a dedicated or burner number rather than a primary line. It also recommends gradually warming up new numbers and provides pacing and daily-cap controls.

Local-first storage means the synchronized history and credentials reside on the machine running the MCP process. The amount of available history depends on synchronization and any subsequent history-fetch operations. Sending can be blocked globally by the restriction control, and the daily cap or configured delays can limit automated message throughput.

_Full upstream README: https://allmcps.com/mcp/kahflane-whatsapp-mcp/readme_

