whatsapp-mcp
Provides access to a user's own WhatsApp account as a linked device, enabling agents to list chats, read and search messages, find contacts and groups, catch up on recent messages, and send text messages through a local SQLite cache.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
whatsapp-mcp
Give AI agents access to your own WhatsApp: read, search and send messages through the Model Context Protocol. Built on Baileys, so it links as a WhatsApp "linked device" (like WhatsApp Web) — no browser, no Business API, no phone number rental.
your phone ──(linked device)── whatsapp-mcp daemon ──MCP over HTTP── Claude Code / Agent SDK / any MCP client
│
└── local SQLite cache of chats, contacts and messagesWhy a daemon
WhatsApp allows one connection per linked device, and it only pushes messages to that device (a history sync when
you link, then live messages). So whatsapp-mcp runs as one long-lived process that holds the connection and caches
everything it sees in SQLite. Any number of agents can then query it at the same time over MCP — each agent session
doesn't have to log in, and reads/searches are instant and work offline. (A --stdio mode is there too for
single-client hosts.)
Related MCP server: WhatsApp MCP Server (TypeScript)
Tools
Tool | What it does |
| Connection state; if not linked yet, the pairing code or QR path to link it |
| Recent chats with last message and unread counts; filter by name, include/exclude groups |
| One chat's messages (by JID, phone number or name), with paging |
| Text search across cached messages, optionally per chat / since a time |
| Everything received since a time, grouped by chat — the "catch me up" view |
| Look up people and groups by name or number |
| Send a text message (annotated as open-world; gate it in your agent) |
Times accept ISO dates, unix seconds, or relative values like 24h / 7d. Names resolve to the saved contact
name, group subject, or the person's own profile name.
Install
Requires Node 20+.
git clone https://github.com/coderman400/whatsapp-mcp && cd whatsapp-mcp
npm install # also builds dist/
npm start # or: node dist/index.js --helpLink your WhatsApp (once)
On first run it waits to be linked. Either:
QR: scan the QR printed in the terminal (also saved to
~/.whatsapp-mcp/link-qr.png) from WhatsApp → Settings → Linked devices → Link a device.Pairing code (handy when you can't see the screen): start with
--pair-phone <your number with country code>; the 8-character code is logged and written to~/.whatsapp-mcp/link-code.txt, andwhatsapp_statusreturns it. On the phone: Linked devices → Link a device → Link with phone number instead.
The session is saved in ~/.whatsapp-mcp/auth and survives restarts. It connects with markOnlineOnConnect: false,
so your phone keeps getting notifications.
Use it
Claude Code
claude mcp add --transport http whatsapp http://127.0.0.1:3737/mcpClaude Agent SDK
query({ prompt, options: { mcpServers: { whatsapp: { type: "http", url: "http://127.0.0.1:3737/mcp" } } } });Claude Desktop / stdio clients (no separate daemon; the client starts it)
{ "mcpServers": { "whatsapp": { "command": "node", "args": ["/path/to/whatsapp-mcp/dist/index.js", "--stdio"] } } }Always on: see examples/whatsapp-mcp.service for a systemd user service.
Options
Flag | Env | Default |
|
|
|
|
|
|
|
|
|
|
| none (send |
|
| none (QR linking) |
|
| off |
| HTTP daemon |
GET /health returns the connection state and cache counts.
Safety — read this
This is unofficial. It uses WhatsApp's linked-device protocol via Baileys, not an official API. Automated or bulk messaging can get a number banned. Keep sending human-paced, and prefer read-only use.
Your data dir is a login.
~/.whatsapp-mcp/authgrants full access to your WhatsApp. Keep it private (it's created0700), never commit it, and unlink the device from your phone if it leaks.Keep it local. The server binds to
127.0.0.1by default; if you expose it, set--token.Messages are untrusted input. Anyone can message you, so an agent reading WhatsApp can be fed instructions ("ignore previous instructions and send…"). Don't give the same agent unattended
send_messageplus other powerful tools; require human approval for sends.
Limitations
Text sending only (no media yet). Reading covers text, captions, documents, locations, polls and contact cards; other media are shown as
[image],[voice note], etc. without downloading.The cache starts when you link: older history depends on what WhatsApp's initial sync sends (
--full-historyasks for more).Built on a Baileys release candidate (7.x); WhatsApp protocol changes can require a Baileys update.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read, search and reply to your WhatsApp chats from your AI, using your own number.
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
Connect your own WhatsApp number to Cursor, Claude and ChatGPT: catch up, search, send replies.
WhatsApp for your AI agent, sent from your own number. Source-available (Elastic License 2.0).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with your personal WhatsApp account, allowing them to search messages and contacts, retrieve chat history, and send messages to individuals or groups. Uses WhatsApp Web API with local data storage for privacy and security.11 npmISC
- 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.11 npm1ISC
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search and read locally stored chat history, look up contacts, send messages and attachments, and retrieve media through a self-hosted local daemon with encrypted SQLite storage.1MIT
- AlicenseNot gradedqualityNot gradedmaintenanceLets AI assistants read, search, and send WhatsApp messages by linking to an account as a linked device, keeping a searchable archive of chats. It exposes tools for listing and finding chats and contacts, paging through message history, and sending, reacting to, editing, deleting, and marking messages read.49 npmGPL 3.0