WhatsApp MCP Server
A WhatsApp MCP (Message Control Protocol) Server implementation
krusleung
README
WhatsApp MCP Server
A Multi-Channel Platform server for WhatsApp integration that allows you to send and receive messages programmatically through a REST API.
Features
- WhatsApp connection management with QR code authentication
- Send and receive text messages
- Send media messages (images, documents, etc.)
- Contact management
- Chat history
- Session persistence
- REST API for integration with other applications
Prerequisites
- Node.js (v14 or higher)
- MongoDB (optional but recommended for message storage)
- A WhatsApp account
Installation
- Clone the repository:
git clone https://github.com/krusleung/whatsapp-mcp-server.git
cd whatsapp-mcp-server
- Install dependencies:
npm install
- Create a
.env
file from the example:
cp .env.example .env
- Edit the
.env
file with your configuration
Running the Server
Start the development server:
npm run dev
For production:
npm start
API Documentation
Authentication
The server uses WhatsApp Web's QR code for authentication. When you start the server for the first time, a QR code will be displayed in the console. Scan this with your WhatsApp mobile app:
- Open WhatsApp on your phone
- Tap Menu or Settings and select WhatsApp Web
- Scan the QR code displayed in the terminal
API Endpoints
Auth Routes
GET /api/auth/status
- Check authentication statusPOST /api/auth/logout
- Logout from WhatsAppPOST /api/auth/restart
- Restart the WhatsApp client
Message Routes
POST /api/messages/send
- Send a text messagePOST /api/messages/send-media
- Send a media messageGET /api/messages/history/:contact
- Get chat history with a contact
Contact Routes
GET /api/contacts
- Get all contactsGET /api/contacts/:id
- Get a contact by IDGET /api/contacts/chats
- Get all chats
Example Usage
Sending a Message
curl -X POST http://localhost:3000/api/messages/send \
-H "Content-Type: application/json" \
-d '{"to": "1234567890", "message": "Hello from WhatsApp MCP Server!"}'
Getting Contacts
curl -X GET http://localhost:3000/api/contacts
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- whatsapp-web.js - WhatsApp Web API
- Express - Web framework
- Mongoose - MongoDB ODM
推荐服务器
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Apple MCP Server
通过 MCP 协议与 Apple 应用(如“信息”、“备忘录”和“通讯录”)进行交互,从而使用自然语言发送消息、搜索和打开应用内容。
@kazuph/mcp-gmail-gas
用于 Gmail 集成的模型上下文协议 (Model Context Protocol, MCP) 服务器。它允许 Claude Desktop(或任何 MCP 客户端)通过 Google Apps Script 与您的 Gmail 帐户进行交互。
MCP Server Trello
通过 Trello API 促进与 Trello 看板的交互,提供速率限制、类型安全、输入验证和错误处理等功能,以实现对卡片、列表和看板活动的无缝管理。

Linear MCP Server
一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。
Composio MCP Server
一个服务器实现,提供与 MCP 兼容的 Composio 应用(如 Gmail 和 Linear)的访问,允许通过结构化的接口与语言模型进行交互。

Folderr
一个模型上下文协议 (MCP) 服务器,它提供与 Folderr API 交互的工具,专门用于管理 Folderr 助手并与之通信。

mcp-google
一个专门的模型上下文协议(MCP)服务器,它将 Google 服务(Gmail、日历等)集成到您的 AI 工作流程中。该服务器通过 MCP 实现对 Google 服务的无缝访问,从而允许 AI 代理与 Gmail、Google 日历和其他 Google 服务进行交互。
MCP-JIRA-Python Server
一个基于 Python 的服务器,可以与 JIRA 无缝集成,并通过自定义 API 管理和交互项目。
Email sending MCP 💌
Send emails directly from Cursor with this email sending MCP server