WhatsApp

by tonydgbd

Not rated
GitHub

About

Search, read, and send personal WhatsApp messages, contacts, and media files.

Details

Author
tonydgbd
Categories
Communication, Search, Knowledge Base, Other, Productivity

Setup

Install WhatsApp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/tonydgbd/whatsapp-mcp-go

Follow the installation instructions in the repository README, then restart your MCP client.

This is a Model Context Protocol (MCP) server for WhatsApp.

With this you can search and read your personal Whatsapp messages (including images, videos, documents, and audio messages), search your contacts and send messages to either individuals or groups. You can also send media files including images, videos, documents, and audio messages.

It connects to yourpersonal WhatsApp accountdirectly via the Whatsapp web multidevice API (using thewhatsmeowlibrary). All your messages are stored locally in a SQLite database and only sent to an LLM (such as Claude) when the agent accesses them through tools (which you control).

Here's an example of what you can do when it's connected to Claude.

To get updates on this and other projects I work onenter your email here

- Go
- Python 3.6+
- Anthropic Claude Desktop app (or Cursor)
- UV (Python package manager), install withcurl -LsSf https://astral.sh/uv/install.sh | sh
- FFmpeg (optional) - Only needed for audio messages. If you want to send audio files as playable WhatsApp voice messages, they must be in.oggOpus format. With FFmpeg installed, the MCP server will automatically convert non-Opus audio files. Without FFmpeg, you can still send raw audio files using thesend_filetool.

git clone https://github.com/lharries/whatsapp-mcp.git cd whatsapp-mcp

Navigate to the whatsapp-bridge directory and run the Go application:

The first time you run it, you will be prompted to scan a QR code. Scan the QR code with your WhatsApp mobile app to authenticate.

After approximately 20 days, you will might need to re-authenticate.

Copy the below json with the appropriate {{PATH}} values:

{ "mcpServers": { "whatsapp": { "command": "{{PATH_TO_UV}}", // Run which uv and place the output here "args": [ "--directory", "{{PATH_TO_SRC}}/whatsapp-mcp/whatsapp-mcp-server", // cd into the repo, run pwd and enter the output here + "/whatsapp-mcp-server" "run", "main.py" ] } } }

ForClaude, save this asclaude_desktop_config.jsonin your Claude Desktop configuration directory at:

~/Library/Application Support/Claude/claude_desktop_config.json

ForCursor, save this asmcp.jsonin your Cursor configuration directory at:

Open Claude Desktop and you should now see WhatsApp as an available integration.

If you're running this project on Windows, be aware thatgo-sqlite3requiresCGO to be enabledin order to compile and work properly. By default,CGO is disabled on Windows, so you need to explicitly enable it and have a C compiler installed.
-

Install a C compiler
We recommend usingMSYS2to install a C compiler for Windows. After installing MSYS2, make sure to add theucrt64\binfolder to yourPATH.
→ A step-by-step guide is available
here.

cd whatsapp-bridge go env -w CGO_ENABLED=1 go run main.go

Without this setup, you'll likely run into errors like:

Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work.

This application consists of two main components:
-

Go WhatsApp Bridge(whatsapp-bridge/): A Go application that connects to WhatsApp's web API, handles authentication via QR code, and stores message history in SQLite. It serves as the bridge between WhatsApp and the MCP server.

Python MCP Server(whatsapp-mcp-server/): A Python server implementing the Model Context Protocol (MCP), which provides standardized tools for Claude to interact with WhatsApp data and send/receive messages.

- All message history is stored in a SQLite database within thewhatsapp-bridge/store/directory
- The database maintains tables for chats and messages
- Messages are indexed for efficient searching and retrieval

Once connected, you can interact with your WhatsApp contacts through Claude, leveraging Claude's AI capabilities in your WhatsApp conversations.

Claude can access the following tools to interact with WhatsApp:

- search_contacts: Search for contacts by name or phone number
- list_messages: Retrieve messages with optional filters and context
- list_chats: List available chats with metadata
- get_chat: Get information about a specific chat
- get_direct_chat_by_contact: Find a direct chat with a specific contact
- get_contact_chats: List all chats involving a specific contact
- get_last_interaction: Get the most recent message with a contact
- get_message_context: Retrieve context around a specific message
- send_message: Send a WhatsApp message to a specified phone number or group JID
- send_file: Send a file (image, video, raw audio, document) to a specified recipient
- send_audio_message: Send an audio file as a WhatsApp voice message (requires the file to be an .ogg opus file or ffmpeg must be installed)
- download_media: Download media from a WhatsApp message and get the local file path

The MCP server supports both sending and receiving various media types:

You can send various media types to your WhatsApp contacts:

- Images, Videos, Documents: Use thesend_filetool to share any supported media type.
- Voice Messages: Use thesend_audio_messagetool to send audio files as playable WhatsApp voice messages.

- For optimal compatibility, audio files should be in.oggOpus format.
- With FFmpeg installed, the system will automatically convert other audio formats (MP3, WAV, etc.) to the required format.
- Without FFmpeg, you can still send raw audio files using thesend_filetool, but they won't appear as playable voice messages.

By default, just the metadata of the media is stored in the local database. The message will indicate that media was sent. To access this media you need to use the download_media tool which takes themessage_idandchat_jid(which are shown when printing messages containing the meda), this downloads the media and then returns the file path which can be then opened or passed to another tool.
- Claude sends requests to the Python MCP server
- The MCP server queries the Go bridge for WhatsApp data or directly to the SQLite database
- The Go accesses the WhatsApp API and keeps the SQLite database up to date
- Data flows back through the chain to Claude
- When sending messages, the request flows from Claude through the MCP server to the Go bridge and to WhatsApp

- If you encounter permission issues when running uv, you may need to add it to your PATH or use the full path to the executable.
- Make sure both the Go application and the Python server are running for the integration to work properly.

- QR Code Not Displaying: If the QR code doesn't appear, try restarting the authentication script. If issues persist, check if your terminal supports displaying QR codes.
- WhatsApp Already Logged In: If your session is already active, the Go bridge will automatically reconnect without showing a QR code.
- Device Limit Reached: WhatsApp limits the number of linked devices. If you reach this limit, you'll need to remove an existing device from WhatsApp on your phone (Settings > Linked Devices).
- No Messages Loading: After initial authentication, it can take several minutes for your message history to load, especially if you have many chats.
- WhatsApp Out of Sync: If your WhatsApp messages get out of sync with the bridge, delete both database files (whatsapp-bridge/store/messages.dbandwhatsapp-bridge/store/whatsapp.db) and restart the bridge to re-authenticate.

For additional Claude Desktop integration troubleshooting, see theMCP documentation. The documentation includes helpful tips for checking logs and resolving common issues.

A WhatsApp MCP (Model Context Protocol) server that connects your WhatsApp account with AI agents, enabling automated messaging, contact search, and chat interaction through LLMs.

Connect Claude, ChatGPT, and other AI tools to your Granola meeting notes via MCP. Query your notes, search transcripts, and get meeting insights in your favorite AI assistants.

MCP server for full Gmail operations via Unipile API. 9 tools: send, reply, list, read, delete, search, labels, attachments, drafts. Dry-run by default, 55 unit tests. MIT licensed.

Telegram MCP server with 20 tools — read chats, search messages, download media via MTProto

MCP server for Stalwart mail server via JMAP — mailboxes, search, send, and admin

Manage your WhatsApp, SMS and Phone Calls using a single MCP connector

Connect your Plaud recordings to any MCP-compatible AI client. Search recordings, read transcripts, and generate documents without leaving your AI assistant.

Send SMS, WhatsApp, and RCS messages programmatically with DLT compliance. Manage contacts, schedule campaigns, and track delivery reports.

Agent-native forum for the x402/A2A ecosystem. The hosted MCP server exposes the whole forum as tools — threads, comments, votes, USDC bounties (Coinbase x402 on Base), provider reviews, and search. Endpoint: https://api.achivx.com/mcp/ (HTTP, OAuth 2.1).

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.