whatsapp-mcp
An MCP server that connects Claude to WhatsApp for reading group messages, searching conversations, and sending messages. It includes advanced tools for analyzing group activity patterns, member statistics, and syncing message history.
README
whatsapp-mcp
An MCP (Model Context Protocol) server that connects Claude to WhatsApp. Read messages, search conversations, get group stats, and send messages — all through Claude Code or any MCP client.
Built on Baileys (WhatsApp Web API) and the MCP SDK.
Features
- Read group messages with flexible time ranges (24h, 7d, 2w, or ISO dates)
- Full-text search across all messages, optionally filtered by group
- Group stats — activity breakdown, top contributors, hourly/daily patterns, media counts
- Per-member stats — message counts, media usage, active hours
- Send messages to any WhatsApp group
- History sync — request older messages from WhatsApp servers
- Persistent store — messages are saved to disk and survive restarts
Quick Setup
1. Install dependencies
npm install
2. Pair WhatsApp (first time only)
npm run dev
A QR code will appear in your terminal. Scan it with WhatsApp on your phone (Settings > Linked Devices > Link a Device). Auth state is saved in auth_info/, so you only need to do this once. You can stop the process after pairing.
3. Configure MCP
Add to your Claude Code MCP config (.mcp.json in your project or ~/.claude.json):
{
"mcpServers": {
"whatsapp": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "/path/to/whatsapp-mcp/src/index.ts"]
}
}
}
Claude Code will start the server automatically when it needs WhatsApp tools — you don't need to run it separately.
Available Tools
| Tool | Description |
|---|---|
connection_status |
Check WhatsApp connection state, store size, group count |
list_groups |
List all groups with name, JID, participant count, message count |
get_group_info |
Group details: members, admins, description, creation date |
fetch_messages |
Get messages from a group with time range filtering |
search_messages |
Full-text search across messages, optionally scoped to a group |
get_group_stats |
Activity stats: message counts, top contributors, hourly/daily patterns |
get_member_stats |
Per-member breakdown: messages, media, active hours |
request_history |
Request older messages from WhatsApp servers (async) |
send_message |
Send a text message to a group |
Architecture
src/
├── index.ts # Entry point — starts WhatsApp + MCP server
├── whatsapp.ts # Baileys connection, message store, history sync
├── mcp-server.ts # MCP tool registrations
├── store.ts # Message querying and stats computation
└── tools/
├── groups.ts # list_groups, get_group_info
├── messages.ts # fetch_messages, search_messages
├── stats.ts # get_group_stats, get_member_stats
└── send.ts # send_message
Messages are stored in-memory and flushed to store/message-store.json every 30 seconds. History sync messages from WhatsApp are automatically ingested on connection.
Scripts
scripts/cron-summary.sh— Daily summary cron job. Uses Claude CLI to fetch and summarize all active group conversations.scripts/find-group.ts— Utility to look up a group JID by name.
Skills
The .claude/skills/ directory contains reusable Claude Code skills:
summarize-group— Fetches messages and stats for a group, then produces a concise summary of activity. Usage:/summarize-group [group name] [time range]
Development
npm run dev # Run with tsx (hot reload)
npm run build # Compile TypeScript
npm run start # Run compiled output
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.