Whatsaap MCP Server
A lightweight agent-ready messaging server built with FastMCP and Twilio to send real-time WhatsApp messages. Powered by an async Python backend.
Ask AI about Whatsaap MCP Server
Powered by Claude Β· Grounded in docs
I know everything about Whatsaap MCP Server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π¬ WhatsApp-MCP: Streamable Messaging Server
A powerful, event-stream-based WhatsApp messaging server built with FastMCP and Twilio API.
Send messages programmatically or from a browser using Server-Sent Events β perfect for agents, automation, or dashboards.
π Features
- β FastMCP 2.x support (streamable HTTP transport)
- β Real-time messaging using Twilio WhatsApp Sandbox
- β Dynamic phone & message input (via HTML or CLI)
- β
Streaming response with
text/event-stream - β Works with AI agents, CLI, or browser UI
- β Optional: deployable to Render, Railway, Replit
π Usage Guide
π§ 1. Setup
git clone https://github.com/your-username/whatsapp-mcp.git
cd whatsapp-mcp
python -m venv venv
venv\Scripts\activate # or source venv/bin/activate
pip install -r requirements.txt
Create a .env file:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_WHATSAPP_FROM=whatsapp:+14155238886
π§ 2. Start the Server
python server.py
Youβll see:
π Server URL: http://localhost:8000/mcp
π¦ Transport: Streamable-HTTP
π 3. Use the Browser UI
Open index.html in your browser.
Enter:
- π± Phone number (e.g.,
+91xxxxxxxxxx) - π¬ Message
Click Send WhatsApp Message β and receive it instantly!
π§ͺ 4. Test with curl
curl -X POST http://localhost:8000/mcp ^
-H "Content-Type: application/json" ^
-H "Accept: text/event-stream" ^
-d "{\"tool\":\"send_whatsapp_message\", \"inputs\":{\"to\":\"+91xxxxxxxxxx\", \"body\":\"Hello from curl!\"}}"
β Replace
+91xxxxxxxxxxwith your verified WhatsApp number
π System Flow (Mermaid Diagram)
graph TD
A[π§ User] -->|Enters message & number| B[π HTML UI]
B -->|POST /mcp| C[π FastMCP Server]
C -->|calls| D[π² Twilio API]
D -->|sends| E[π± WhatsApp Message]
C -->|streams response| B
π§© Tech Stack
- π§ FastMCP v2.x
- π§ͺ Twilio WhatsApp API
- βοΈ Python 3.11+
- π HTML + JS (Fetch API)
- π Server-Sent Events (SSE)
π‘οΈ Security Notes
- Never commit
.envsecrets - Sandbox can only message verified users
- Upgrade to Twilio Business for full sending capabilities
π€ Agent-Ready Example (Python)
from fastmcp import Client
from server import mcp
async with Client(mcp) as client:
await client.call_tool("send_whatsapp_message", {
"to": "+91xxxxxxxxxx",
"body": "Triggered from an agent π"
})
π Author
Made with β€οΈ by K Rajtilak
