WhatsApp Cloud API MCP Server
Provides tools for sending text and template messages, retrieving media files, and checking connectivity with the WhatsApp Cloud API to enable messaging capabilities through Meta's WhatsApp Business platform.
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 Cloud API MCP Serversend a text message to +1234567890 saying 'Your appointment is confirmed for tomorrow at 2 PM'"
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 Cloud API MCP Server – Spec v1.0
Overview
This project defines version 1.0 of an MCP Server that exposes the WhatsApp Cloud API to LLM agents through standardized MCP tools.
Goal: Provide a minimal, clean, production-ready baseline so developers can use WhatsApp messaging inside AI agents with zero complexity.
Related MCP server: WhatsApp Business MCP Server
Quick Start
Copy the environment template and fill in your Meta credentials:
cp .env.example .envInstall dependencies:
npm installRun the server locally:
npm run dev
Tip: if you're testing only the MCP tools locally, use valid WhatsApp Cloud API credentials in
.env. For webhook-only testing, you can use placeholder values while simulating incoming payloads.
1. Objectives
Create a lightweight MCP server (TypeScript + Node.js).
Expose WhatsApp Cloud API functionalities as tools.
Provide helpers for webhook verification.
Be deployable with a single command (Docker + local dev).
2. Tech Stack
Node.js 20+
TypeScript
Express (or Fastify) for HTTP + webhooks
MCP Server SDK
Axios for outbound WhatsApp API requests
WebSocket for MCP transport (mandatory)
Dotenv for configs
Pino or console logging
3. Project Structure (v1.0)
/src
/mcp
server.ts
/whatsapp
client.ts
webhook.ts
/config
env.ts
index.ts
.env.example
mcp.json
package.json
README.md4. Environment Variables
Required:
META_WHATSAPP_TOKEN=
META_WHATSAPP_PHONE_ID=
META_WHATSAPP_WABA_ID=
META_VERIFY_TOKEN=
PORT=4000
MCP_PORT=8000Optional:
LOG_LEVEL=debug5. WhatsApp Cloud API Endpoints to Support (v1.0)
The MCP server will call these official endpoints:
Send Text Message
POST /v18.0/{PHONE_ID}/messagesSend Template Message
POST /v18.0/{PHONE_ID}/messagesGet Media URL
GET /v18.0/{MEDIA_ID}Download Media
GET {MEDIA_URL}Health Check
GET /v18.0/{PHONE_ID}6. Webhook Handling
Expose:
GET /webhook (verification)Features:
Validate
hub.verify_token
7. MCP Tools (v1.0)
Tools exposed to agents:
1. send_text_message
Send a simple text message to a WhatsApp user.
Params:
{
"to": "string",
"text": "string"
}2. send_template_message
Send a WhatsApp template message.
Params:
{
"to": "string",
"template_name": "string",
"language": "string",
"components": []
}3. get_media
Retrieve a media file by MEDIA_ID.
Params:
{
"media_id": "string"
}4. health_check
Verify connectivity with WhatsApp Cloud API.
8. Security
Validate Meta webhook signature (optional v1).
Restrict MCP tool usage to authenticated WebSocket clients.
Sanitize user inputs.
Never log tokens.
9. Documentation Requirements
Setup Instructions
Install Dependencies
npm installConfigure Environment Copy
.env.exampleto.envand fill in your Meta WhatsApp API credentials.cp .env.example .envRun Locally
npm run devServer will start on port 4000 (HTTP) and expose MCP on WebSocket.
Configure Webhook
Expose your local server using ngrok or similar:
ngrok http 4000In Meta App Dashboard, set Webhook URL to
https://<your-ngrok-url>/webhookSet Verify Token to match
META_VERIFY_TOKENin.env
Docker Usage
docker build -t whatsapp-mcp .
docker run -p 4000:4000 --env-file .env whatsapp-mcpExample Usage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"whatsapp": {
"command": "docker",
"args": ["run", "-i", "--rm", "--env-file", "/path/to/.env", "whatsapp-mcp"]
}
}
}(Note: For local dev without docker, point to the build output)
10. Contact
For any inquiries or similar projects, please contact: marcelo@marcelomarchetti.com
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform. Supports chat management, message operations including sending/receiving messages, and marking chats as read.52189ISC
- AlicenseAquality-maintenanceConnects AI agents to the WhatsApp Business Cloud API, allowing them to send messages, manage templates, and retrieve account analytics. It facilitates automated customer interaction and marketing campaign management through the Model Context Protocol.16
- AlicenseAqualityBmaintenanceConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without the risk of account bans.187223MIT
- AlicenseBqualityDmaintenanceEnables sending messages, images, documents and more on WhatsApp directly from any MCP-compatible AI, with tools for chat management, groups, and webhooks.371MIT
Related MCP Connectors
Send and read WhatsApp messages on your Leporis account from AI coding agents, via your own API key.
AI voice agents: assistants, calls, campaigns, leads, knowledge bases, WhatsApp, SMS & SIP trunks.
Drive your real WhatsApp inbox from Claude — send, reply, label, assign, and triage via TimelinesAI.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mmarqueti/whatsapp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server