whatsapp-mcp

whatsapp-mcp

Connects WhatsApp to Claude Code, enabling message reading, audio transcription, image analysis, and message sending with full codebase context.

Category
访问服务器

README

whatsapp-mcp

Connect your WhatsApp to Claude Code. Read messages, transcribe audio, analyze images — all from your terminal, with full codebase context.

The real unlock isn't just reading messages. It's that Claude Code already knows your project — the architecture, the decisions, the debt. Now it also knows what your client just said on WhatsApp. Ask it to diagnose the bug they described, draft a reply that references actual code, or triage who needs attention most urgently.

# From inside your project directory:
"Read the last messages from Lucas and tell me if the issue he described
 is related to the auth refactor we did last week"

"Transcribe the audio João sent and create a GitHub issue with the requirements"

"Look at the screenshot Camila sent — what error is she seeing and where is it thrown?"

"Who's been waiting for a reply the longest?"

What it does

📨 Read

  • All chats with unread messages at a glance
  • Full message history with infinite backwards pagination
  • Full-text search across your entire conversation history (SQLite FTS5)
  • Contact and group info — participants, metadata, phone numbers

🎵 Audio → Text (local, offline)

Audio messages are automatically transcribed when you call get_media. Uses mlx-whisper with the large-v3-turbo model on Apple Silicon. No API key, no data leaving your machine, ~2–5s per message.

"Transcribe the voice note Rodrigo sent this morning"
→ [full transcript returned inline, ready for Claude to act on]

🖼️ Images → Claude sees them

Images aren't returned as file paths — they're sent as native MCP visual content blocks, so Claude receives and analyzes them directly.

"What does the screenshot Valentina sent show?"
→ Claude sees the image and describes the UI bug, error message, or whatever is in it

✍️ Write

  • Send text messages with a human-like delay (avoids the "instant robot" feel)
  • Reply quoting a specific message
  • Send images with caption
  • React with any emoji (or remove a reaction)
  • Set presence: typing, recording, paused
  • Mark chats as read

🧠 Intelligence tools

  • find_pending_replies — which clients are waiting for you, sorted by recency
  • get_chat_stats — message volume, media breakdown, active hours, date range
  • export_chat — full conversation to Markdown or JSON
  • sync_recent — force reconnect to recover messages missed during a gap

Real-world use cases

Client support with codebase context

"Read the last 10 messages from [client] and check if what they're
 describing matches the bug we logged in the database module"

Requirements from voice

"Transcribe the 3 audios Pedro sent today and write a PRD from them"

Visual debugging

"Daiana sent a screenshot — look at it and tell me what's broken and
 which component would throw that error"

Inbox triage

"I have 8 unread chats. Summarize each one in one sentence and tell
 me which needs a reply today"

Draft replies in your voice

"Reply to Camila — tell her the deploy is done and the image upload
 issue she reported is fixed. Keep it casual."

Turn WhatsApp into a task source

"Read everything Lucas sent this week and create Notion tasks for
 each thing he asked for"

Setup

Requirements

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Node.js 18+
  • Python 3.11+
  • Claude Code

1. Clone and install

git clone https://github.com/emawritz/whatsapp-mcp
cd whatsapp-mcp
npm install

2. Set up Whisper (local audio transcription)

./setup.sh

This creates a .venv, installs mlx-whisper, and pre-downloads the model (~1.5 GB, one-time). Sets WHISPER_PYTHON in .env automatically.

3. First run — scan QR code

npm run build
npm start

Scan the QR code with WhatsApp on your phone → Settings → Linked Devices → Link a Device.

Session is saved in auth_info_baileys/ — you only scan once.

4. Configure Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "whatsapp": {
      "type": "http",
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}

5. Run persistently with pm2 (recommended)

Running via pm2 means one WhatsApp connection shared across all Claude Code sessions — no conflicts, auto-restarts on crash, starts on boot.

npm install -g pm2
npm run build
pm2 start ecosystem.config.js
pm2 save
pm2 startup   # run the printed command with sudo

Why pm2? WhatsApp only allows one active session per linked device. Without pm2, each Claude Code terminal spawns its own process and they conflict (error 440). pm2 keeps one process alive for everyone.


Architecture

Claude Code  ←── MCP/HTTP ───►  whatsapp-mcp  ◄─── Baileys ───►  WhatsApp
                                      │
                                 SQLite (local)
                              mlx-whisper (local)
  • Transport: StreamableHTTPServerTransport on localhost:3001 — stateless, one shared process
  • Persistence: SQLite stores full message history, chat metadata, and encrypted proto for media downloads
  • Audio: Python subprocess runs mlx-whisper with output silenced; transcript returned inline with the message
  • Images: Returned as MCP image content blocks — Claude receives them visually, not as a path

Tools reference

Tool What it does
get_unread_messages All chats with unread messages
list_chats N most recently active chats
get_chat_messages Last N messages from a specific chat
search_messages Full-text search across all history
get_contact_info Contact or group metadata
load_more_history Paginate further back in a chat's history
send_message Send a text message (with human-like delay)
reply_to_message Reply quoting a specific message
send_image Send an image file with optional caption
react_to_message Add or remove an emoji reaction
mark_as_read Mark a chat as read
set_typing Set typing / recording / paused presence
get_media Download media; auto-transcribes audio, returns images visually
find_pending_replies Chats waiting for your reply, newest first
get_chat_stats Message volume, media types, active hours, date range
export_chat Export full conversation to Markdown or JSON
sync_recent Force reconnect to recover messages missed during a gap
backfill_media_proto Recover downloadable media from historical connection gaps
edit_message Edit the text of a previously sent message
delete_message Delete (revoke for everyone) a previously sent message
get_message_context Get N messages before and after a specific message for context

Stack


Disclaimer

This project uses Baileys, an unofficial WhatsApp Web client. Using unofficial clients may violate WhatsApp's Terms of Service and could result in your account being banned. Use at your own risk. This project is not affiliated with or endorsed by WhatsApp or Meta.


License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选