WhatsApp MCP
Provides tools for interacting with WhatsApp to send text messages and media, manage contacts and groups, and retrieve chat history and recent messages.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WhatsApp MCPsend 'I'm running 10 minutes late' to Sarah"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📱 WhatsApp MCP — Remote HTTP/SSE Server
Model Context Protocol (MCP) server for WhatsApp, built with
whatsapp-web.jsand TypeScript.
Supports both local stdio (Claude Desktop) and remote HTTP/SSE (Claude.ai Remote MCP) modes.
⚠️ WhatsApp Terms of Service — IMPORTANT
Read this before using this project.
WhatsApp's Terms of Service and Acceptable Use Policy prohibit the use of unofficial automation tools on personal or business accounts.
🚫 Actions that will get your number BANNED:
Violation | Risk Level |
Sending bulk/spam messages | 🔴 Instant Ban |
Automating messages to unknown numbers | 🔴 Instant Ban |
Using unofficial WhatsApp clients (like | 🟠 High Risk |
Scraping contacts or group data at scale | 🟠 High Risk |
Sending messages without user consent | 🔴 Instant Ban |
Running the bot 24/7 on a personal number | 🟡 Medium Risk |
Sending media/files in bulk | 🟠 High Risk |
✅ Safer Practices:
Use a dedicated/test phone number, not your personal number
Only message contacts who have opted in
Keep message frequency low and human-like
Do not expose your
/sseor REST endpoints publicly withoutAPI_KEYprotectionDo not use this for marketing, sales blasting, or any commercial messaging at scale
Use WhatsApp Business API (Official) for production/commercial use
🔒 This project is intended for personal automation and development/testing only.
The author is not responsible for any account bans or legal consequences resulting from misuse.
🗂️ Project Structure
whatsapp-mcp/
├── src/
│ ├── index.ts # stdio MCP server (Claude Desktop)
│ ├── remote.ts # HTTP/SSE MCP server (Remote MCP + REST API)
│ └── send_message.ts # CLI script to send a single message
├── dist/ # Compiled JavaScript (auto-generated, do not edit)
├── .wwebjs_auth/ # WhatsApp session data (⚠️ keep this gitignored!)
├── .wwebjs_cache/ # Puppeteer browser cache (gitignored)
├── package.json
├── tsconfig.json
├── render.yaml # Render.com deployment config
├── start-remote.bat # Windows quick-start script
└── README.md🚀 Quick Start
Prerequisites
Node.js v18+ and npm
A WhatsApp account (use a test number!)
Google Chrome or Chromium installed (used by Puppeteer internally)
1. Install Dependencies
npm install2. Build TypeScript
npm run build3. Start the Server
Remote HTTP/SSE mode (Claude.ai Remote MCP):
npm run start:remoteDev mode (no build needed, uses ts-node):
npm run dev:remotestdio mode (Claude Desktop):
npm start4. Scan the QR Code
Open your browser and go to:
http://localhost:3000/qrScan the QR code with WhatsApp → Linked Devices → Link a Device.
🔌 API Endpoints
Method | Path | Description |
|
| Health check + WhatsApp status |
|
| QR code HTML page (scan to authenticate) |
|
| Raw QR data in JSON |
|
| List all available MCP tools |
|
| WhatsApp connection status |
|
| Send a WhatsApp message |
|
| List recent chats |
|
| List contacts |
|
| Fetch messages from a chat |
|
| Generic MCP tool invocation |
|
| MCP SSE endpoint (Claude Remote MCP) |
|
| MCP POST endpoint (paired with |
🛠️ Available MCP Tools
Tool | Description |
| Check connection status |
| Send a text message |
| Send image / video / document |
| List all contacts |
| List all groups |
| Get group details and members |
| Create a new group |
| Get recent chats |
| Get messages from a specific chat |
🔐 Optional: Bearer Token Auth
Protect your REST endpoints by setting an API_KEY environment variable:
API_KEY=mysecretkey npm run start:remoteInclude the token in all requests:
curl -H "Authorization: Bearer mysecretkey" http://localhost:3000/tools/status🌐 Testing with ngrok (Public HTTPS)
Start your server:
npm run start:remoteIn a new terminal:
ngrok http 3000Copy the generated URL (e.g.,
https://xxxx.ngrok-free.app)
In Claude.ai → Settings → Integrations → Remote MCP, paste:
https://xxxx.ngrok-free.app/sse☁️ Deploy to Render
Push this repo to GitHub (see Git steps below)
Go to render.com → New → Web Service
Connect your GitHub repository
Configure:
Build Command:
npm install && npm run buildStart Command:
npm run start:remoteEnvironment:
NODE_ENV=productionOptional:
API_KEY=yoursecretkey
Deploy and copy your
https://your-app.onrender.comURL
Paste into Claude Remote MCP:
https://your-app.onrender.com/sse⚠️ Note: WhatsApp session data (
.wwebjs_auth) does not persist across Render deploys. Use a Render Disk or re-scan the QR code after each deploy.
📦 npm Scripts
Command | Description |
| Compile TypeScript to |
| Start stdio MCP server |
| Start HTTP/SSE remote server |
| Dev stdio server (ts-node, no build) |
| Dev remote server (ts-node, no build) |
| CLI: send a single message |
| Show QR code in terminal |
📄 .gitignore Recommendations
Make sure your .gitignore includes:
node_modules/
dist/
.wwebjs_auth/
.wwebjs_cache/
.env
*.bat🔒 Never commit
.wwebjs_auth/— it contains your WhatsApp session credentials.
🔧 Environment Variables
Variable | Default | Description |
|
| HTTP server port |
|
| Server bind address |
| (empty) | Optional Bearer token for REST auth |
|
| Set to |
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first.
📜 License
MIT — use responsibly and in accordance with WhatsApp's Terms of Service.
💡 Tip: Install the GitLens extension in VS Code for a much richer Git experience — commit history, blame, comparisons and more.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PONMANIAN-SA/whatsapp_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server