Price Per TokenPrice Per Token

WhatsApp MCP Server

by lharries

0

About

WhatsApp MCP Server enables AI assistants to interact with your personal WhatsApp account for messaging and media management. It connects directly to WhatsApp Web via the whatsmeow library and stores your messages locally in a SQLite database. Key features of WhatsApp MCP Server: - Search and read personal WhatsApp messages with full conversation history - View and download media files including images, videos, documents, and audio messages - Search your WhatsApp contacts directory - Send text messages to individuals or groups - Send media files including images, videos, documents, and voice messages - Automatic audio format conversion to WhatsApp-compatible Opus format via FFmpeg - Local data storage ensuring messages are only accessed when explicitly requested through tools

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
       

    For Cursor, save this as mcp.json in your Cursor configuration directory at:

       ~/.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

       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.

    Architecture Overview

    This application consists of two main components:

    1. Go WhatsApp Bridge (whatsapp-bridge/): A Go application that connects to WhatsApp's web API, handles authentication via QR code, and stores message history in SQLite. It serves as the bridge between WhatsApp and the MCP server.

    2. Python MCP Server (whatsapp-mcp-server/): A Python server implementing the Model Context Protocol (MCP), which provides standardized tools for Claude to interact with WhatsApp data and send/receive messages.

    Data Storage

  • All message history is stored in a SQLite database within the whatsapp-bridge/store/ directory
  • The database maintains tables for chats and messages
  • Messages are indexed for efficient searching and retrieval
  • Usage

    Once connected, you can interact with your WhatsApp contacts through Claude, leveraging Claude's AI capabilities in your WhatsApp conversations.

    ###

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81