WhatsApp MCP

WhatsApp MCP

コミュニケーション
lharries/whatsapp-mcp5,969 スター
Lukas Harries
claudecursorvscodegeneric
FreeOpen Source

このサーバーについて

AI エージェントが WhatsApp メッセージを送受信できる MCP サーバー。WhatsApp Web インターフェースを介して接続し、テキストメッセージの送信、メッセージ履歴の読み取り、連絡先管理をサポート。AI 駆動の WhatsApp 自動化を実現します。

インストール

npx -y whatsapp-mcp
公式 README インストールガイド(英語原文)

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.

よくある質問

WhatsApp MCP はどのように動作しますか?安全ですか?

WhatsApp Web プロトコルを介して接続します。初回起動時に QR コードをスキャンして WhatsApp アカウントをリンクします。MCP サーバーはローカルで動作し、メッセージがサードパーティのサーバーを経由することはありません。個人アカウントへの影響を避けるため、専用の WhatsApp アカウントの使用をお勧めします。

WhatsApp MCP は一括メッセージ送信ができますか?

複数の連絡先に個別メッセージを順次送信できます。ただし WhatsApp にはスパム対策機能があり、短時間に大量送信するとアカウント制限を受ける可能性があります。レート制限を避けるために送信頻度を適切に制御してください。

WhatsApp MCP はチャット履歴を読めますか?

はい。最近のチャットメッセージ一覧と特定の会話のメッセージ内容を読み取れます。AI エージェントがコンテキストを理解してから返信や分析を行えます。ただし、既に WhatsApp 内にあるメッセージのみを読み取り、エンドツーエンド暗号化されたクラウドバックアップにはアクセスしません。