WhatsApp MCP

WhatsApp MCP

Comunicación
lharries/whatsapp-mcp5,969 estrellas
Lukas Harries
claudecursorvscodegeneric
FreeOpen Source

Acerca de este servidor

Un servidor MCP que permite a los agentes de IA enviar y recibir mensajes de WhatsApp. Se conecta a través de WhatsApp Web, permitiendo enviar mensajes de texto, leer el historial de mensajes y gestionar contactos — automatización de WhatsApp impulsada por IA.

Instalación

npx -y whatsapp-mcp
Guía oficial de instalación del README (en inglés)

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.

Preguntas frecuentes

¿Cómo funciona WhatsApp MCP? ¿Es seguro?

Se conecta mediante el protocolo WhatsApp Web. Al iniciar por primera vez, deberás escanear un código QR para vincular tu cuenta de WhatsApp. El servidor MCP se ejecuta en local y los mensajes no pasan por servidores de terceros. Se recomienda usar una cuenta de WhatsApp dedicada para evitar afectar tu cuenta personal.

¿Puede WhatsApp MCP enviar mensajes masivos?

Soporta el envío de mensajes personalizados a múltiples contactos de forma secuencial. Sin embargo, WhatsApp tiene mecanismos antispam — enviar demasiados mensajes en poco tiempo puede resultar en restricciones de la cuenta. Controla la frecuencia de envío para evitar límites de tasa.

¿Puede WhatsApp MCP leer el historial de chats?

Sí. Puede leer listas de mensajes recientes y el contenido de conversaciones específicas, permitiendo a los agentes de IA entender el contexto antes de responder o analizar. Solo lee mensajes ya disponibles en tu WhatsApp — no accede a copias de seguridad en la nube cifradas de extremo a extremo.