Whatsapp

Messaging and email

WhatsApp MCP server.

Your AI app calls the Whatsapp MCP server, which does the work through tools like search_contacts, list_messages, list_chats and get_chat and sends the result back to the chat.

About Whatsapp

Whatsapp is a community MCP server from lharries, filed in our directory under messaging and email. WhatsApp MCP server.

The README for Whatsapp lists tools such as search_contacts, list_messages, list_chats and get_chat, which your AI app can call once the server is connected.

At a glance

Publisher
lharries (community)
Runs
See the README for setup
Written in
Go
License
MIT
GitHub stars
6,985

Tools Whatsapp gives your AI app

  • search_contactsSearch for contacts by name or phone number.
  • list_messagesRetrieve messages with optional filters and context.
  • list_chatsList available chats with metadata.
  • get_chatGet information about a specific chat.
  • get_direct_chat_by_contactFind a direct chat with a specific contact.
  • get_contact_chatsList all chats involving a specific contact.
  • get_last_interactionGet the most recent message with a contact.
  • get_message_contextRetrieve context around a specific message.
  • send_messageSend a WhatsApp message to a specified phone number or group JID.
  • send_fileSend a file (image, video, raw audio, document) to a specified recipient.
  • send_audio_messageSend an audio file as a WhatsApp voice message (requires the file to be an .ogg opus file or ffmpeg must be installed).
  • download_mediaDownload media from a WhatsApp message and get the local file path.

Tool names as the Whatsapp README lists them. Your AI app shows the live list once Whatsapp is connected.

How to set up Whatsapp

  1. Follow the install steps in the Whatsapp README; it is written in Go, so have that toolchain ready.
  2. Check the Whatsapp README for keys or settings; the registry lists none that Whatsapp requires.
  3. Add Whatsapp to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Whatsapp tools to confirm the connection.
  5. Run one read-only task with Whatsapp first, such as a call to search_contacts, before you allow anything that writes or sends.

Whatsapp compared with similar servers

  • Lemonade by lemonade-sdk has fewer GitHub stars than Whatsapp (6.3k against 7k); both are community servers, and both run locally.
  • Waha by devlikeapro has more GitHub stars than Whatsapp (8k against 7k); both are community servers, and both run locally.
  • Vexa by Vexa-ai has fewer GitHub stars than Whatsapp (3k against 7k); both are community servers, and Vexa runs as a remote server and Whatsapp runs on your own machine.

Before you connect Whatsapp

  • Give Whatsapp its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Whatsapp tool call until you trust what it does with them.
  • Treat text that Whatsapp fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Whatsapp on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Whatsapp

How marketing and sales teams put Whatsapp to work, by company size. Pick the size closest to yours and start Whatsapp on one use case.

Small business

  • A small team can have Whatsapp summarize the inbox or channel each morning, so nothing from a customer waits until the afternoon.
  • Owners can draft replies and follow-ups with Whatsapp and send them only after a read, keeping the personal tone customers expect.
  • Whatsapp runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Whatsapp to turn long launch threads into decisions, owners and dates that land in the project tracker.
  • Sales and success teams can connect Whatsapp so an agent drafts follow-ups after every customer call, ready to edit and send.
  • Start with search_contacts and list_messages, the tools Whatsapp lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can deploy Whatsapp with retention and data loss rules intact, so agents summarize conversations without moving data outside policy.
  • Internal comms teams can use Whatsapp to find what employees ask most across channels and answer it once, in the right place.
  • Whatsapp is a community server, so have security review the code and pin a version before Whatsapp touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Whatsapp README

From lharries/whatsapp-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

WhatsApp MCP Server

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 your personal WhatsApp account directly via the Whatsapp web multidevice API (using the whatsmeow library). 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 on enter your email here

Caution: as with many MCP servers, the WhatsApp MCP is subject to the lethal trifecta. This means that project injection could lead to private data exfiltration.

Installation

Prerequisites
  • Go
  • Python 3.6+
  • Anthropic Claude Desktop app (or Cursor)
  • UV (Python package manager), install with curl -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 .ogg Opus format. With FFmpeg installed, the MCP server will automatically convert non-Opus audio files. Without FFmpeg, you can still send raw audio files using the send_file tool.
Steps
  1. Clone this repository

    git clone https://github.com/lharries/whatsapp-mcp.git
    cd whatsapp-mcp
    
  2. Run the WhatsApp bridge

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

    cd whatsapp-bridge
    go run main.go
    

    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.

  3. Connect to the MCP server

    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"
          ]
        }
      }
    }
    

    For Claude, save this as claude_desktop_config.json in your Claude Desktop configuration directory at:

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

    For Cursor, save this as mcp.json in your Cursor configuration directory at:

    ~/.cursor/mcp.json
    
  4. Restart Claude Desktop / Cursor

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

    Or restart Cursor.

Windows Compatibility

If you're running this project on Windows, be aware that go-sqlite3 requires CGO to be enabled in 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.

Steps to get it working:
  1. Install a C compiler
    We recommend using MSYS2 to install a C compiler for Windows. After installing MSYS2, make sure to add the ucrt64\bin folder to your PATH.
    → A step-by-step guide is available code.visualstudio.com/docs/cpp/config-mingw.

  2. Enable CGO and run the app

    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.

Architecture Overview

This application consists of two main components:

  1. 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.

  2. 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.

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

Usage

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

MCP Tools

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
Media Handling Features

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

Media Sending

You can send various media types to your WhatsApp contacts:

  • Images, Videos, Documents: Use the send_file tool to share any supported media type.
  • Voice Messages: Use the send_audio_message tool to send audio files as playable WhatsApp voice messages.
    • For optimal compatibility, audio files should be in .ogg Opus 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 the send_file tool, but they won't appear as playable voice messages.
Media Downloading

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 the message_id and chat_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.

Technical Details

  1. Claude sends requests to the Python MCP server
  2. The MCP server queries the Go bridge for WhatsApp data or directly to the SQLite database
  3. The Go accesses the WhatsApp API and keeps the SQLite database up to date
  4. Data flows back through the chain to Claude
  5. When sending messages, the request flows from Claude through the MCP server to the Go bridge and to WhatsApp

Troubleshooting

  • 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.
Authentication Issues
  • 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.db and whatsapp-bridge/store/whatsapp.db) and restart the bridge to re-authenticate.

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

Questions about Whatsapp

What is the Whatsapp MCP server?

WhatsApp MCP server. Whatsapp is maintained by lharries on GitHub at lharries/whatsapp-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Whatsapp MCP server?

Whatsapp doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (lharries/whatsapp-mcp). Like most servers, Whatsapp ends with a command or URL you paste into your AI app's MCP config.

Does Whatsapp need an API key?

The registry lists no required keys for Whatsapp. Check the Whatsapp README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Whatsapp an official MCP server?

No. Whatsapp is a community server maintained by lharries. Community servers can be excellent; read the code and the open issues before you give Whatsapp access to company data.

What license is Whatsapp under?

Whatsapp is released under the MIT license, according to its GitHub repository. The license covers the code of Whatsapp; the service it connects to has its own terms.