WhatsApp MCP

WhatsApp MCP

Communication
lharries/whatsapp-mcp5,969 étoiles
Lukas Harries
claudecursorvscodegeneric
FreeOpen Source

À propos de ce serveur

Un serveur MCP qui permet aux agents IA d'envoyer et de recevoir des messages WhatsApp. Se connecte via WhatsApp Web, prenant en charge l'envoi de messages texte, la lecture de l'historique des messages et la gestion des contacts — une automatisation WhatsApp pilotée par l'IA.

Installation

npx -y whatsapp-mcp
Guide d'installation officiel du README (en anglais)

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

bash
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:

bash
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:

json
{
  "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:

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

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

text
~/.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 here.

2. Enable CGO and run the app

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

Questions fréquentes

Comment fonctionne WhatsApp MCP ? Est-ce sûr ?

Il se connecte via le protocole WhatsApp Web. Au premier lancement, vous devrez scanner un code QR pour lier votre compte WhatsApp. Le serveur MCP s'exécute localement et les messages ne transitent pas par des serveurs tiers. Il est recommandé d'utiliser un compte WhatsApp dédié pour éviter d'affecter votre compte personnel.

WhatsApp MCP peut-il envoyer des messages en masse ?

Il supporte l'envoi de messages personnalisés à plusieurs contacts de manière séquentielle. Cependant, WhatsApp dispose de mécanismes anti-spam — envoyer trop de messages en peu de temps peut entraîner des restrictions de compte. Contrôlez votre fréquence d'envoi pour éviter les limitations de débit.

WhatsApp MCP peut-il lire l'historique des conversations ?

Oui. Il peut lire les listes de messages récents et le contenu de conversations spécifiques, permettant aux agents IA de comprendre le contexte avant de répondre ou d'analyser. Il lit uniquement les messages déjà disponibles dans votre WhatsApp — il n'accède pas aux sauvegardes cloud chiffrées de bout en bout.