WhatsApp MCP Serverのロゴ

WhatsApp MCP Server

コミュニティ
felipeadeildo

WhatsApp Unofficial MCP Server

公開者felipeadeildo
リポジトリwhatsapp-mcp
言語Go
フォーク
36
スター
86
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスGPL-3.0
リンク
  • ツールをAIワークフローに接続

    WhatsApp MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには86件のスターと36件のフォークがあります。

WhatsApp MCP Server

Give AI assistants access to your WhatsApp conversations

Go Version MCP Protocol Docker License: GPL v3 Ask DeepWiki

Built with whatsmeow and mcp-go

Features • Quick Start • Architecture • MCP Integration

🎯 What is This?

A Model Context Protocol (MCP) server that bridges WhatsApp and AI assistants like Claude. It exposes your WhatsApp messages through standardized MCP tools, prompts, and resources - allowing AI to read, search, and send messages on your behalf.

The Vision: Let AI handle your WhatsApp conversations intelligently, with full context and natural language understanding.

You: "Summarize what João said about the budget meeting"
AI:  *searches all your chats* → "João mentioned in the Tech Team group..."

You: "Reply to Maria's last message and schedule lunch"
AI:  *reads context, sends reply* → "Sent! I've proposed Thursday at noon"

✨ Features

Core Capabilities

  • 📱 Full WhatsApp Integration - Connect to WhatsApp Web using your existing account
  • 💾 Local-First Storage - All messages stored in SQLite, synced in real-time
  • 🔍 Powerful Search - Pattern matching, cross-chat queries, sender filtering
  • ⏱️ Timezone Support - Messages displayed in your local timezone
  • 📥 On-Demand Loading - Fetch older messages from WhatsApp servers as needed
  • 🔐 Secure by Design - API key authentication, local data storage, HTTPS ready

MCP Features

This server implements the full MCP specification with:

  • 7 Tools for WhatsApp operations
  • 4 Prompts for common workflows
  • 4 Resources for interactive guides
  • Server Instructions for optimal AI interactions

Tools

ToolPurposeHighlights
list_chatsBrowse conversationsOrdered by recent activity
get_chat_messagesRead specific chatPagination, sender filtering
search_messagesSearch across all chatsPattern matching, wildcards
find_chatLocate chat by nameFuzzy search support
send_messageSend WhatsApp messagesTo any chat or group
load_more_messagesFetch older historyOn-demand from servers
get_my_infoGet your profile infoJID, name, status, picture

Prompts

Pre-built workflows that guide AI assistants:

  • search_person_messages - Find ALL messages from someone across all chats
  • get_context_about_person - Comprehensive analysis of someone's messages
  • analyze_conversation - Summarize recent chat activity
  • search_keyword - Find specific topics across conversations

Resources

Interactive documentation embedded in the MCP server:

  • Cross-Chat Search Guide - Master advanced search workflows
  • Workflow Guide - Common operations and best practices
  • JID Format Guide - Understanding WhatsApp identifiers
  • Search Patterns Guide - Wildcards and pattern matching

🏗️ Architecture

How It Works

  1. Initial Sync - WhatsApp sends message history on first connection
  2. Real-Time Updates - All new messages automatically stored in SQLite
  3. MCP Exposure - Tools, prompts, and resources expose functionality to AI
  4. On-Demand Loading - Fetch older messages from WhatsApp when needed
  5. AI Integration - Claude (or any MCP client) accesses WhatsApp through standardized protocol

🚀 Quick Start

Prerequisites

  • Go 1.25.5+ (for local setup) or Docker (recommended)
  • WhatsApp account (will be linked via QR code)
  • MCP-compatible AI client (Claude, Cursor, etc.)

Option 1: Docker Setup (Recommended)

  1. Clone and configure

    bash
    git clone https://github.com/felipeadeildo/whatsapp-mcp
    cd whatsapp-mcp
    cp .env.example .env
    # Edit .env with your settings (API key, timezone, etc.)
  2. Start the server

    bash
    docker compose up -d
  3. Link WhatsApp

    bash
    # View logs to see QR code
    docker compose logs -f whatsapp-mcp
    
    # Scan QR code with WhatsApp mobile app:
    # Settings → Linked Devices → Link a Device
  4. Verify it's running

    bash
    curl http://localhost:8080/health
    # Expected: "OK"

Option 2: Local Setup

  1. Install dependencies

    bash
    git clone https://github.com/felipeadeildo/whatsapp-mcp
    cd whatsapp-mcp
    go mod download
  2. Configure environment

    bash
    cp .env.example .env
    # Edit .env with your settings
  3. Run the server

    bash
    go run main.go
  4. Link WhatsApp (scan QR code shown in terminal)

🔌 MCP Integration

Connect to Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "whatsapp": {
      "type": "http",
      "url": "http://localhost:8080/mcp",
      "headers": {
        "Authorization": "Bearer your-secret-api-key"
      }
    }
  }
}

Connect to Other MCP Clients

The server exposes a Streamable HTTP endpoint compatible with any MCP client:

  • URL: http://localhost:8080/mcp
  • Transport: Streamable HTTP
  • Authentication: Two methods supported (Bearer header preferred)

Option A — Authorization header (recommended):

Keeps the key out of URLs, proxy logs, and shell history.

json
{
  "mcpServers": {
    "whatsapp": {
      "type": "http",
      "url": "http://localhost:8080/mcp",
      "headers": {
        "Authorization": "Bearer your-secret-api-key"
      }
    }
  }
}

Option B — Key in URL path (backward compatible):

Existing clients using /mcp/{key} continue to work unchanged.

json
{
  "mcpServers": {
    "whatsapp": {
      "url": "http://localhost:8080/mcp/your-secret-api-key",
      "type": "http"
    }
  }
}

🎨 Usage Examples

Once connected, your AI assistant can:

Search for People

You: "Find all messages from Arthur across all my chats"
AI: [Uses search_person_messages prompt]
    → Finds messages in DMs, groups, everywhere
    → Analyzes communication patterns
    → Provides context about Arthur

Analyze Conversations

You: "What did we discuss in the Tech Team group this week?"
AI: [Uses analyze_conversation prompt]
    → Reads recent messages
    → Summarizes key topics
    → Lists action items and deadlines

Smart Messaging

You: "Tell Maria I'll be 10 minutes late"
AI: [Uses find_chat + send_message]
    → Finds Maria's chat
    → Sends contextual message
    → Confirms delivery

Deep Search

You: "Find all mentions of 'budget meeting' in any chat"
AI: [Uses search_keyword prompt]
    → Searches across all conversations
    → Shows context around each mention
    → Orders by relevance/date

📊 Data & Privacy

Local Storage

All data is stored in ./data/:

  • db/ - Database files
    • messages.db - SQLite database with messages and chats
    • whatsapp_auth.db - WhatsApp session credentials
  • media/ - Downloaded media files
  • whatsapp.log - WhatsApp client logs

⚠️ Important: Database files contain sensitive data. Keep them secure (file permissions 600) and backed up.

🛣️ Roadmap

✅ Implemented

  • WhatsApp Web integration via whatsmeow
  • Real-time message sync to SQLite
  • MCP server with Streamable HTTP transport
  • Pattern matching and wildcards
  • Sender filtering and cross-chat search
  • Timestamp-based pagination
  • Timezone support
  • On-demand message loading from servers
  • Docker deployment (with healthcheck!)

🚧 Planned

  • Media Support

    • Voice message transcription
    • Image OCR and analysis
    • Video metadata extraction
    • Document parsing
    • Contact card handling
  • GraphRAG Integration

    • Entity extraction from conversations
    • Relationship mapping between contacts
    • Semantic search capabilities
    • Context-aware recommendations
  • Enhanced Tools

    • Mark messages as read
    • React to messages (emoji reactions)
    • Send media files
    • Group management (create, members)
    • Status updates
    • Account management (profile picture, name)
  • Analytics (maybe)

    • Message statistics
    • Conversation insights
    • Response time tracking

📚 Documentation

MCP Resources (Built-In)

The server includes interactive guides accessible through MCP:

  • Workflow Guide - Common operations and patterns
  • Cross-Chat Search - Master advanced search techniques
  • JID Format Guide - Understanding WhatsApp identifiers
  • Search Patterns - Wildcards and pattern matching

AI assistants can access these guides through the MCP Resources API.

Environment Variables

See .env.example and be happy!

🔔 Webhook Events

When WEBHOOK_URL is set, the server POSTs a JSON payload to that URL for every incoming and outgoing message.

Payload Structure

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event_type": "message.received",
  "timestamp": "2026-06-14T10:00:00Z",
  "data": {
    "message_id": "3EB0...",
    "chat_jid": "6281234567890@s.whatsapp.net",
    "sender_jid": "6281234567890@s.whatsapp.net",
    "text": "Hello!",
    "timestamp": "2026-06-14T10:00:00Z",
    "is_from_me": false,
    "message_type": "text",
    "chat_name": "John Doe",
    "sender_push_name": "John",
    "sender_contact_name": "John Doe",
    "is_group": false,
    "media_metadata": null,
    "referral": null
  }
}

Fields

FieldTypeDescription
idstring (UUID)Unique event identifier
event_typestringmessage.received or message.sent
timestampstring (RFC3339)When the event was generated
data.message_idstringWhatsApp message ID
data.chat_jidstringJID of the chat (DM or group)
data.sender_jidstringJID of the sender
data.textstringMessage text content
data.timestampstring (RFC3339)When the message was sent
data.is_from_mebooltrue if sent from your account
data.message_typestringtext, image, video, audio, document, sticker, ptt, gif
data.chat_namestringDisplay name of the chat (omitted if empty)
data.sender_push_namestringWhatsApp display name of the sender (omitted if empty)
data.sender_contact_namestringLocal contact name for the sender (omitted if empty)
data.is_groupbooltrue if the message is in a group chat
data.media_metadataobject | nullPresent when message has a media attachment (see below)
data.referralobject | nullPresent when message originated from a Meta Click-to-WhatsApp ad (see below)

Media Metadata

Present when message_type is image, video, audio, document, sticker, ptt, or gif.

json
"media_metadata": {
  "message_id": "3EB0...",
  "file_name": "photo.jpg",
  "file_size": 204800,
  "mime_type": "image/jpeg",
  "has_media": true
}

Referral (Click-to-WhatsApp Ads)

When a user taps a Meta ad with a "Message on WhatsApp" button, their first message carries ad attribution metadata (ExternalAdReply in the WhatsApp protocol). The server extracts this and populates referral:

json
"referral": {
  "ctwa_clid": "ARAkLkA8...",
  "source_id": "120208468219880053",
  "source_type": "AD",
  "source_url": "https://fb.com/ads/...",
  "headline": "Order Now"
}
FieldDescription
ctwa_clidMeta's click ID — use this for offline conversion attribution via Meta Conversions API
source_idThe ad ID that originated the conversation
source_typeAd placement type (e.g. AD)
source_urlDestination URL of the ad
headlineAd creative headline text

referral is null for all non-ad messages. It is supported on text, image, and video messages (the message types where WhatsApp carries ExternalAdReply).

Delivery & Retries

Failed deliveries are retried up to WEBHOOK_MAX_RETRIES times with exponential backoff. Delivery attempts are logged in the database and visible via the webhook management API (GET /webhooks/deliveries).

🤝 Contributing

This is a personal project I maintain for daily use. Contributions are welcome!

See CONTRIBUTING.md for:

  • Development setup and workflow
  • Project structure (main server vs migration CLI)
  • Database migration system
  • Code style guidelines

Quick start:

  1. Fork the repository
  2. Create your feature branch
  3. Follow the guidelines in CONTRIBUTING.md
  4. Submit a pull request

⚠️ Disclaimer

This project is not affiliated with WhatsApp or Meta. It uses the unofficial WhatsApp Web API through the whatsmeow library. Use at your own risk.

Important Notes:

  • WhatsApp may change their API at any time
  • Using unofficial APIs may violate WhatsApp's Terms of Service
  • This is provided as-is with no warranties
  • Keep your session data secure

Built with ❤️ for the MCP community

Report Bug • Request Feature

インストール

TypingMind
{
  "mcpServers": {
    "felipeadeildo-whatsapp-mcp": {
      "command": "go",
      "args": [
        "run",
        "main.go"
      ]
    }
  }
}

WhatsApp MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度WhatsApp MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

WhatsApp MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. WhatsApp MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "felipeadeildo-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてWhatsApp MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. WhatsApp MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
WhatsApp MCP Serverを使ってこのタスクを手伝ってもらえますか?
WhatsApp MCP Server
はい、読みました。
WhatsApp MCP Serverで調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

WhatsApp MCP Serverがすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックしてください。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを貼り付けてください。
  2. WhatsApp MCP Serverの接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックしてください。
  2. MCPコネクタの一覧に戻ってください。
  3. WhatsApp MCP Serverの接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でWhatsApp MCP Serverのツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でWhatsApp MCP Serverのツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
WhatsApp MCP Serverを使ってこのタスクを手伝ってもらえますか?
WhatsApp MCP Server
はい、読みました。
WhatsApp MCP Serverで調べた結果をお伝えします。

よくある質問

WhatsApp MCP Server MCPサーバーは何に使いますか?

WhatsApp MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでWhatsApp MCP Server MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでWhatsApp MCP Serverを利用できます。

TypingMindでWhatsApp MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。WhatsApp MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

WhatsApp MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

WhatsApp MCP Serverは、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでWhatsApp MCP Server MCPのどのようなツールを利用できますか?

WhatsApp MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

WhatsApp MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。WhatsApp MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇