WhatsApp 消息服务

这是一个 MCP 服务器,通过 WhatsApp 提供消息收发能力,支持发送和接收文本、图片、文档,列出聊天与联系人,搜索消息,下载附件以及群组管理,适用于构建 WhatsApp 自动化集成和智能助手应用。

  • by newknew
  • Go
  • 本地部署
  • 更新于
在 GitHub 查看 newknew/whatsapp-mcp

使用说明

whatsapp-mcp

MCP server for WhatsApp messaging via whatsmeow.

Features

  • Send and receive messages (text, images, documents)
  • List chats and contacts
  • Search messages
  • Download attachments
  • Read receipts and dismiss tracking
  • Group info and management

Prerequisites

  • Go 1.24+
  • A WhatsApp account (phone number for QR pairing)

Install

go install github.com/newknew/whatsapp-mcp@main

First run

On first launch, the server displays a QR code in the terminal. Scan it with WhatsApp on your phone to pair.

whatsapp-mcp

The session is stored in ~/.local/share/newknew-mcp/whatsapp/ and persists across restarts.

Usage

Runs as an HTTP server on localhost:2053. Health check:

curl http://localhost:2053/health

Data paths

  • Session DB: ~/.local/share/newknew-mcp/whatsapp/
  • Debug log: ~/.local/log/newknew-mcp/whatsapp.log
  • Downloaded files: /tmp/newknew_whatsapp_*

License

MIT