Labsco
lharries logo

WhatsApp MCP

β˜… 5,900

from lharries

Send and receive messages using the WhatsApp API.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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.

Architecture Overview

This application consists of two main components:

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.

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

Technical Details

  • Claude sends requests to the Python MCP server

  • The MCP server queries the Go bridge for WhatsApp data or directly to the SQLite database

  • The Go accesses the WhatsApp API and keeps the SQLite database up to date

  • Data flows back through the chain to Claude

  • When sending messages, the request flows from Claude through the MCP server to the Go bridge and to WhatsApp