WhatsApp MCP Server logo

WhatsApp MCP Server

Community
felipeadeildo

WhatsApp Unofficial MCP Server

Publisherfelipeadeildo
Repositorywhatsapp-mcp
LanguageGo
Forks
36
Stars
86
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseGPL-3.0
Links
  • Connect tools to AI workflows

    WhatsApp MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    86 stars and 36 forks from the linked repository.

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

Installation

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

Use WhatsApp MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once WhatsApp MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add WhatsApp MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the WhatsApp MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "felipeadeildo-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the WhatsApp MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the WhatsApp MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use WhatsApp MCP Server to help me with this task?
WhatsApp MCP Server
Sure. I read it.
Here is what I found using WhatsApp MCP Server.

Option 2: Add an MCP server URL

Use this when WhatsApp MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for WhatsApp MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the WhatsApp MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the WhatsApp MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the WhatsApp MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use WhatsApp MCP Server to help me with this task?
WhatsApp MCP Server
Sure. I read it.
Here is what I found using WhatsApp MCP Server.

Frequently asked questions

What is the WhatsApp MCP Server MCP server used for?

WhatsApp MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use WhatsApp MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use WhatsApp MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use WhatsApp MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With WhatsApp MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect WhatsApp MCP Server MCP to TypingMind?

WhatsApp MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does WhatsApp MCP Server MCP provide in TypingMind?

WhatsApp MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use WhatsApp MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If WhatsApp MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇