WhatsApp MCP Server

WhatsApp MCP Server

A WhatsApp MCP (Message Control Protocol) Server implementation

krusleung

Communication
Visit Server

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

  1. Clone the repository:
git clone https://github.com/krusleung/whatsapp-mcp-server.git
cd whatsapp-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file from the example:
cp .env.example .env
  1. 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:

  1. Open WhatsApp on your phone
  2. Tap Menu or Settings and select WhatsApp Web
  3. Scan the QR code displayed in the terminal

API Endpoints

Auth Routes

  • GET /api/auth/status - Check authentication status
  • POST /api/auth/logout - Logout from WhatsApp
  • POST /api/auth/restart - Restart the WhatsApp client

Message Routes

  • POST /api/messages/send - Send a text message
  • POST /api/messages/send-media - Send a media message
  • GET /api/messages/history/:contact - Get chat history with a contact

Contact Routes

  • GET /api/contacts - Get all contacts
  • GET /api/contacts/:id - Get a contact by ID
  • GET /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

Recommended Servers

graphlit-mcp-server

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.

Official
Featured
TypeScript
Apple MCP Server

Apple MCP Server

Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.

Featured
Local
TypeScript
MCP Server Trello

MCP Server Trello

Facilitates interaction with Trello boards via the Trello API, offering features like rate limiting, type safety, input validation, and error handling for seamless management of cards, lists, and board activities.

Featured
TypeScript
@kazuph/mcp-gmail-gas

@kazuph/mcp-gmail-gas

Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.

Featured
JavaScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Composio MCP Server

Composio MCP Server

A server implementation that provides MCP-compatible access to Composio applications like Gmail and Linear, allowing interaction through a structured interface for language models.

Official
TypeScript
Folderr

Folderr

A Model Context Protocol (MCP) server that provides tools to interact with Folderr's API, specifically for managing and communicating with Folderr Assistants.

Official
JavaScript
mcp-google

mcp-google

A specialized Model Context Protocol (MCP) server that integrates Google services (Gmail, Calendar, etc.) into your AI workflows. This server enables seamless access to Google services through MCP, allowing AI agents to interact with Gmail, Google Calendar, and other Google services.

Local
TypeScript
MCP-JIRA-Python Server

MCP-JIRA-Python Server

A Python-based server allowing seamless integration with JIRA for managing and interacting with projects through custom APIs.

Local
Python
Email Sending MCP

Email Sending MCP

Send emails directly from Cursor with this email sending MCP server

Local
TypeScript