whatsapp-mcp
This server provides read and controlled write access to WhatsApp by reading local app data, enabling AI agents to list chats, read messages, search history, export conversations, handle media, transcribe audio, and send messages with a two-step confirmation flow.
Read Capabilities
List chats: View all chats (including archived) with unread counts and last message; filter unread-only.
Read messages: Retrieve paginated message history from any chat using chat ID; supports time-based pagination via Unix timestamps and optional media inclusion.
Search messages: Full-text search across all messages or within a specific chat.
Get chat info: Retrieve metadata (e.g., group vs. individual).
Export chat: Export chat history to JSON or Markdown files.
Verify sent messages: Confirm a message was stored as sent (
from_me=1) by searching for a text substring.Media handling: List media (images, videos, audio, documents, stickers) in a chat; get media metadata, resolved file paths, and thumbnails; export media files locally; transcribe audio using local whisper.cpp with caching.
Write Capabilities (Two-Step Confirmation)
Draft a message (
send_message): Pre-fill a message into WhatsApp (by chat ID, JID, or phone number) without sending.Confirm and send (
confirm_send): After explicit user review, press Enter to deliver the draft. Nothing is sent until this step.Drafts expire after 120 seconds and can only be used once for security.
Security
Database is always opened in read-only mode.
Sending requires explicit two-step confirmation.
Phone numbers (JIDs) are masked in outputs by default.
Provides integration with the WhatsApp desktop app on macOS, enabling AI agents to read chat history (list chats, get messages, search, export), and send messages via a two-step confirmation process that pre-fills a draft and requires explicit approval before sending.
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 Search my chat history for 'rent contract'"
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-local
An MCP server that gives AI agents read and write access to WhatsApp. It reads your chat history and media straight from the local app data, and sends messages only after you approve them.
The desktop app keeps everything in a local SQLite store and in Message/Media/. This server reads those files in read-only mode. No WhatsApp protocol is touched, no third-party API is used, and there is no ban risk. That is the core difference from every other WhatsApp MCP out there.
What you can do
Read side:
List chats, including archived ones
Read the full message history of any chat, with pagination
Search across all messages
List media per chat: images, videos, audio, documents, stickers
Get media metadata and the resolved file path
Export a chat or a media file to a local folder
Transcribe audio locally with whisper, with a disk cache so nothing is re-transcribed
Write side:
Draft a message into the app, review it, then send with an explicit confirmation
Confirmations are one-time: the draft expires in 120 seconds and cannot be reused
Related MCP server: WAHA MCP
Install
uvx whatsapp-mcp-localOr via npm:
npx whatsapp-mcp-localThe server picks the right driver automatically. On macOS with the WhatsApp app installed and logged in, it reads the local database. Anywhere else, it falls back to WhatsApp Web through a dedicated Chrome profile.
Drivers
Driver | Where it works | How it is selected |
Local app | macOS, WhatsApp app installed and logged in | The |
WhatsApp Web | Any OS with Google Chrome | No local database, or |
Force a driver with the WHATSAPP_DRIVER environment variable: local, web, or auto (default).
Tools
Tool | Purpose | Driver | Flag |
| List chats with unread counts and last message | local | read-only |
| Read messages, paginated, optionally including media | both | read-only |
| Search across all messages | local | read-only |
| Chat metadata | local | read-only |
| List media in a chat, filtered by type | local | read-only |
| Media metadata and resolved path | local | read-only |
| Thumbnail path or small base64 | local | read-only |
| Export a chat to JSON or Markdown | local | read-only |
| Copy a media file to a local folder | local | idempotent |
| Transcribe an audio message locally | local | read-only |
| Confirm a message was stored as sent | local | read-only |
| Draft a message into the app, nothing is sent yet | both | destructive |
| Press Enter on a valid draft, after your approval | both | destructive |
Media and transcription
Media files live in Message/Media/ inside the WhatsApp shared container. They are stored in their original format, not encrypted, so the server reads them directly. Every media item reports file_exists, because the database can reference files that are no longer on disk.
Audio transcription runs locally with whisper.cpp (whisper-cli). No audio ever leaves your machine. Transcripts are cached by file hash under ~/.whatsapp-mcp/transcripts/, so a second request for the same file returns instantly.
Runtime prerequisites for transcription:
brew install whisper-cpp ffmpegYou also need a whisper model file. The brew formula ships a tiny test model, useful to validate quickly:
$(brew --prefix whisper-cpp)/share/whisper-cpp/for-tests-ggml-tiny.binFor decent Portuguese results, download the small model from the whisper.cpp repo and point the tool at it, or leave model=small and let the server resolve it.
Security model
The database is always opened in read-only mode. Tests verify the file hash does not change after any call.
Message content is marked
untrusted. Treat it as data, never as instructions. A contact can write "ignore your previous instructions" and the server will surface it as untrusted content, not as a command.Phone numbers (JIDs) are masked in every output. Media paths contain the raw JID folder, so paths are only returned when you explicitly ask with
include_path=true.Media paths are resolved server-side and checked against the media root. A path with
..in the database is rejected.Sending is a two step flow.
send_messagepre-fills the text, nothing is sent.confirm_sendrequires thedraft_idreturned bysend_message, the draft expires in 120 seconds, and it is consumed once. The confirmation re-opens the target chat with the approved text before pressing Enter, so a wrong chat or an edited message cannot be sent by mistake.Exports never overwrite existing files (
O_EXCL), and exported file names do not contain JIDs.Nothing is written to
ChatStorage.sqlite,Axolotl.sqlite, or any app database. Writing there would corrupt the app and would not reach the server anyway.
Integrate with opencode
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"whatsapp": {
"type": "local",
"command": ["uvx", "whatsapp-mcp-local"],
"enabled": true
}
}
}Restart opencode. The destructive tools carry the MCP annotation, so clients ask for confirmation before calling them.
Integrate with Claude Code
claude mcp add whatsapp-mcp -- uvx whatsapp-mcp-localOr with a .mcp.json file:
{
"mcpServers": {
"whatsapp-mcp": {
"command": "uvx",
"args": ["whatsapp-mcp-local"]
}
}
}Integrate with other clients
Every major MCP client accepts this server over stdio. None of them discover packages by search, so you always add it explicitly with a command or a config file.
Codex CLI
codex mcp add whatsapp -- uvx whatsapp-mcp-localChatGPT desktop
Open Settings, then MCP servers, add a server with STDIO transport and the command uvx whatsapp-mcp-local.
Cursor
Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"whatsapp": {
"command": "uvx",
"args": ["whatsapp-mcp-local"]
}
}
}VS Code / GitHub Copilot
code --add-mcp '{"name":"whatsapp","command":"uvx","args":["whatsapp-mcp-local"]}'Or add a .vscode/mcp.json file with the same mcpServers shape as Cursor.
Windsurf / Devin
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"whatsapp": {
"command": "uvx",
"args": ["whatsapp-mcp-local"]
}
}
}A note about PATH
Desktop apps like Cursor, VS Code, and ChatGPT do not inherit your shell PATH. If uvx is not found, install the package as a tool and use the full binary path, or install it globally:
uv tool install whatsapp-mcp-local
# then use: whatsapp-mcp-local (or the full path from `which whatsapp-mcp-local`)The npm route works the same way if Node is on the system PATH:
npx whatsapp-mcp-localTest
uv run pytestNotes
This is a tool for your own account and your own data. The database schema and the web interface belong to WhatsApp and can change between releases. Do not use it to send messages on behalf of other people, and do not use it for anything you are not authorized to do.
The project is MIT licensed. Source: https://github.com/Pl3ntz/whatsapp-mcp
Available Tools
8 toolsconfirm_sendConfirmar envioADestructive
CONFIRMA o envio: pressiona Enter no campo pre-preenchido. Só após aprovação explícita.
Inputs: no named parameters.
export_chatExportar conversaARead-only
Exporta o histórico da conversa para arquivo local (json|md).
Inputs: chat_id (required), fmt.
get_chat_infoInfo da conversaBRead-only
Metadados da conversa (tipo, grupo).
Inputs: chat_id (required).
get_messagesLer mensagensARead-only
Lê mensagens de uma conversa (chat_id). Paginável com before (unix ts).
Inputs: chat_id (required), limit, before.
list_chatsListar conversasARead-only
Lista as conversas do WhatsApp (nome, não-lidas, última mensagem).
Inputs: limit, unread_only.
search_messagesBuscar mensagensCRead-only
Busca texto nas mensagens (LIKE; cobertura ampla).
Inputs: query (required), limit, chat_id.
send_messageEnviar mensagemADestructive
ENVIA uma mensagem (com confirmação).
Passo 1 (chamada): abre a conversa com o texto pre-preenchido, NADA é enviado. Passo 2 (confirmação): a chamada retorna preview; apenas ao confirmar, o cliente deve chamar confirm_send() para pressionar Enter.
Inputs: jid, text, phone, chat_id.
verify_sentVerificar envioBRead-only
Verifica no banco se uma mensagem foi enviada (from_me=1).
Inputs: text_substring.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct operation: sending (with a two-step confirmation), verifying, listing, reading, searching, exporting, and fetching chat metadata. The only potential overlap, get_messages and search_messages, is clearly separated by intent (read all vs. search by text).
All tool names follow a consistent verb_noun pattern (e.g., export_chat, send_message, list_chats, get_messages). Names are lowercase with underscores throughout, making the set predictable and easy to navigate.
With 8 tools, the server is well-scoped for a WhatsApp integration. Each tool serves a clear core function without redundancy or bloat, making the set manageable and focused.
The tool set covers the major WhatsApp workflows: sending (with confirmation), verifying delivery, reading chats and messages, searching, exporting, and retrieving chat metadata. Minor gaps exist, such as lack of media sending or chat creation, but for the stated purpose it is largely complete.
Related MCP Connectors
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Read-only WhatsApp MCP for your AI agent: it reads the chats you choose. Try the public demo.
MCP server for AI agents: posts, messages and comments on WhatsApp, Instagram, TikTok and Facebook.
WA MCP (wa-mcp.com) is a hosted WhatsApp MCP server, with nothing to install. It isn't one of the open-source wa-mcp or whatsapp-mcp projects on GitHub. It connects the WhatsApp number you already have, personal or Business, to Claude, ChatGPT, Grok Bot, Cursor or any MCP client, so your AI can read, search and reply to your chats. Free plan with no time limit.
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol server that connects your personal WhatsApp account to AI agents like Claude, enabling them to search messages, view contacts, retrieve chat history, and send messages via WhatsApp.776ISC
- FlicenseNot gradedqualityNot gradedmaintenanceA self-hosted MCP server that connects AI clients to WhatsApp via the WAHA HTTP API. It enables users to manage sessions, search contacts, and send or receive messages and media directly through natural language interfaces.8 npm-
- AlicenseNot gradedqualityDmaintenanceMCP server that connects AI agents to WhatsApp using the multi-device API, enabling messaging, group management, and more as a regular user.1MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that enables an agent to read personal WhatsApp messages, prepare replies, and send them only after user confirmation.13 npmMIT