LW

lharries/whatsapp-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

6,8 тыс. stars 1,5 тыс. forks Качество 64 Тренд 44MIT

Сервер WhatsApp MCP

Обзор

Это сервер Model Context Protocol (MCP) для WhatsApp. С помощью этого вы можете искать и читать свои личные сообщения в Whatsapp (включая изображения, видео, документы и аудиосообщения), искать контакты и отправлять сообщения как отдельным лицам, так и группам. Вы также можете отправлять медиафайлы, включая изображения, видео, документы и аудиосообщения. Он подключается к вам напрямую через Web-мультиустройственный API Whatsapp (с использованием библиотеки whatsmeow). Все ваши сообщения хранятся локально в базе данных SQLite и отправляются в LLM (например, Claude) только тогда, когда агент обращается к ним через инструменты (которые вы контролируете). Вот пример того, что можно сделать, когда он связан с Клодом. Чтобы получать обновления по этому и другим проектам, над которыми я работаю, введите свой email здесь Внимание: как и на многих серверах MCP, WhatsApp MCP подвержен смертельной триаке. Это означает, что внедрение проекта может привести к утечке частных данных. - Go - Python 3.

Обзор (машинный перевод)

Это сервер Model Context Protocol (MCP) для WhatsApp.

С помощью этого вы можете искать и читать свои личные сообщения в Whatsapp (включая изображения, видео, документы и аудиосообщения), искать контакты и отправлять сообщения как отдельным лицам, так и группам. Вы также можете отправлять медиафайлы, включая изображения, видео, документы и аудиосообщения.

Он подключается к вашему личному аккаунту WhatsApp напрямую через Web-мультиустройственный API Whatsapp (используя библиотеку whatsmeow). Все ваши сообщения хранятся локально в базе данных SQLite и отправляются только в LLM (например, Claude), когда агент обращается к ним через инструменты (которые вы контролируете).

Вот пример того, что можно сделать, когда он связан с Клодом.

Чтобы получать обновления по этому и другим проектам, над которыми я работаю, введите свой email здесь

Внимание:, как и на многих серверах MCP, MCP WhatsApp подвержен смертельному триаму. Это означает, что внедрение проекта может привести к утечке частных данных.

Установка

Требования

  • Вперёд
  • Python 3.6+
  • Антропическое приложение Claude Desktop (или Cursor)
  • UV (менеджер пакетов на Python), установка с помощью curl -LsSf https://astral.sh/uv/install.sh | sh
  • FFmpeg (optional) — требуется только для аудиосообщений.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

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
    
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

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