Skip to main content
Glama
WhatsApp MCP for macOS

WhatsApp MCP for macOS

by kalki-kgp

macOS用 WhatsApp MCP

ClaudeをWhatsAppに接続するためのModel Context Protocolサーバーです。メッセージの読み取り、連絡先の検索、返信の送信をすべて自然な会話で行えます。

機能

  • 連絡先の検索 — 名前や電話番号で誰でも検索可能

  • メッセージの読み取り — 日付フィルタリングや検索機能付きでチャット履歴を取得

  • チャット一覧の表示 — 未読数を含む最近の会話を表示

  • メッセージの送信 — Claudeから直接返信(QR認証が必要)

  • リアルタイム受信 — メッセージが届くと同時に取得

Related MCP server: whatsapp-mcp

要件

  • macOS(WhatsAppデスクトップアプリがインストールされ、ログイン済みであること)

  • Python 3.10+

  • Node.js 18+(メッセージ送信に必要)

インストール

pipを使用する場合

pip install whatsapp-mcp-macos

ソースからインストールする場合

git clone https://github.com/kalki-kgp/whatsapp-mcp.git
cd whatsapp-mcp
pip install -e .

Claude Desktopへの接続

  1. 設定ファイルを開きます:

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

    ファイルが存在しない場合は作成してください。

  2. WhatsApp MCPサーバーを追加します:

    {
      "mcpServers": {
        "whatsapp": {
          "command": "python3",
          "args": ["-m", "whatsapp_mcp"]
        }
      }
    }
  3. Claude Desktopを再起動します(Cmd+Qで終了後、再度開く)

  4. チャット入力欄にあるMCPツールアイコン(🔨)を探し、クリックして「whatsapp」がリストに含まれていることを確認します

  5. チャットを開始します:

    • 「最近のWhatsAppチャットを表示して」

    • 「夕食の予定に関するメッセージを検索して」

Cursorへの接続

プロジェクト内の .cursor/mcp.json に以下を追加します:

{
  "mcpServers": {
    "whatsapp": {
      "command": "python3",
      "args": ["-m", "whatsapp_mcp"]
    }
  }
}

Cursorを再起動し、AIチャットでWhatsAppツールを使用します。

使用方法

メッセージの読み取り(即時利用可能)

Claudeに話しかけるだけです:

  • 「最近のWhatsAppチャットを表示して」

  • 「夕食についてのメッセージを検索して」

  • 「昨日ジョンは何と言った?」

  • 「未読メッセージをまとめて」

メッセージの送信(ブリッジが必要)

  1. WhatsAppブリッジを起動します:

    cd bridge && npm install && npm start
  2. Claudeに接続状況を確認させます:

    • 「WhatsAppのステータスを確認して」

  3. QRコードが表示されたら、ブラウザでデータURLを開き、スマートフォンでスキャンします

  4. 接続が完了すると、送信が可能になります:

    • 「お母さんに『遅れる』とメッセージを送って」

    • 「ジョンに『了解』と返信して」

ツール

ツール

説明

ブリッジが必要

whatsapp_status

接続確認、必要に応じてQRコードを取得

いいえ

whatsapp_search_contacts

名前や電話番号で連絡先を検索

いいえ

whatsapp_list_chats

最近の会話を一覧表示

いいえ

whatsapp_get_messages

チャットからメッセージを取得

いいえ

whatsapp_search_messages

すべてのチャットから検索

いいえ

whatsapp_unread

未読メッセージの概要を取得

いいえ

whatsapp_send

メッセージを送信

はい

whatsapp_incoming

リアルタイムの受信メッセージを取得

はい

仕組み

Claude ──MCP──▶ WhatsApp MCP Server
                       │
                       ├──▶ Local SQLite DBs (read messages)
                       │    ~/Library/Group Containers/group.net.whatsapp.WhatsApp.shared/
                       │
                       └──▶ WhatsApp Bridge (:3010) ──▶ WhatsApp Web
                            (for sending)

読み取り操作はローカルのWhatsAppデータベースを直接クエリするため、高速でオフラインでも動作します。

送信操作はブリッジを経由します。このブリッジはBaileysを使用してWhatsApp Webに接続します。

開発

# Clone
git clone https://github.com/kalki-kgp/whatsapp-mcp.git
cd whatsapp-mcp

# Install in dev mode
pip install -e ".[dev]"

# Run server
python -m whatsapp_mcp

プライバシー

  • すべてのデータはローカルに保持されます。メッセージは自身のWhatsAppデータベースから読み取られます。

  • 外部サーバーにはデータは送信されません(送信時のWhatsApp Webを除く)。

  • MCPサーバーはマシン上でローカルに実行されます。

ライセンス

MIT

Available Tools

8 tools
whatsapp_get_messagesA
Read-only

Get messages from a specific WhatsApp chat.

Args: chat_jid: JID of the chat (from whatsapp_search_contacts or whatsapp_list_chats). after: Only messages after this datetime (ISO 8601). Defaults to 24h ago. before: Only messages before this datetime (ISO 8601). Defaults to now. limit: Max messages to return (max 200). search_text: Optional text to filter messages.

Inputs: chat_jid (required), after, limit, before, +1 more. Returns: result

whatsapp_incomingA
Read-only

Get recent incoming WhatsApp messages from the live connection.

These are real-time messages, not from the local database. Useful for checking new messages that just arrived.

Args: since_minutes: Look back N minutes (default 5, max 60).

Inputs: since_minutes. Returns: result

whatsapp_list_chatsA
Read-only

List recent WhatsApp chats ordered by last message time.

Args: limit: Number of chats to return (max 50). chat_type: Filter by 'dm', 'group', or 'all'.

Inputs: limit, chat_type. Returns: result

whatsapp_search_contactsA
Read-only

Search WhatsApp contacts by name or phone number.

Returns matching contacts with their JID, display name, and phone number. Use this to find a contact before reading their messages or sending them a message.

Args: query: Name or phone number to search for (partial match supported).

Inputs: query (required). Returns: result

whatsapp_search_messagesA
Read-only

Search for messages containing specific text across all chats.

Args: query: Text to search for (case-insensitive). chat_jid: Optional - restrict search to a specific chat. limit: Max results (max 50).

Inputs: query (required), limit, chat_jid. Returns: result

whatsapp_sendA

Send a WhatsApp message.

IMPORTANT:

  1. First use whatsapp_status to ensure WhatsApp is connected.

  2. Use whatsapp_search_contacts to get the correct JID.

  3. Always confirm with the user before sending.

Args: recipient_jid: The JID from whatsapp_search_contacts. message: The text message to send.

Inputs: message (required), recipient_jid (required). Returns: result

whatsapp_statusA
Read-only

Check WhatsApp connection status.

Returns current status: 'connected', 'qr_pending', 'disconnected', or 'bridge_offline'. If QR code is needed, returns a data URL you can open in a browser to scan.

Call this before sending messages to ensure WhatsApp is connected.

Inputs: no named parameters. Returns: result

whatsapp_unreadA
Read-only

Get a summary of all unread WhatsApp messages.

Returns chats with unread messages and recent message previews. Great for "catch me up" or "what did I miss" requests.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes, but whatsapp_get_messages and whatsapp_search_messages could cause confusion as both retrieve messages with text filtering. whatsapp_get_messages focuses on a specific chat with time filters, while whatsapp_search_messages searches across all chats, but the overlap in functionality might lead to misselection by agents.

    Naming Consistency5/5

    All tools follow a consistent 'whatsapp_verb_noun' pattern with snake_case throughout. The naming is predictable and clear, making it easy for agents to understand the action and target resource without ambiguity.

    Tool Count5/5

    With 8 tools, this server is well-scoped for managing WhatsApp interactions on macOS. It covers essential operations like checking status, listing chats, searching contacts, retrieving messages, and sending messages, which is appropriate for the domain without being overly complex or sparse.

    Completeness4/5

    The toolset provides good coverage for core WhatsApp workflows, including status checks, contact search, message retrieval, and sending. However, there are minor gaps such as the inability to delete messages or manage group settings, which agents might need to work around, but the surface supports most common use cases effectively.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude to interact with WhatsApp: read chats, search messages, send messages with a mandatory confirmation step, and transcribe voice notes locally, all with encrypted storage and prompt-injection scrubbing.
      9
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to read, search, and reply to your personal WhatsApp messages by linking as an extra device, with support for chat history, full-text search, media downloads, and sending messages or files.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude Desktop to read, search, send, and broadcast WhatsApp messages and files, and manage groups and communities through a linked personal WhatsApp account.
      22
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude to read WhatsApp Desktop chats on a Mac, including messages, images, documents, and locally transcribed audio, through a local MCP server. Everything runs on the Mac with read-only access and no messages sent.
      6
      4
      MIT