The WAHA MCP Server enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform, providing comprehensive WhatsApp management capabilities.
Chat Management: Retrieve recent chats with previews and unread counts, get message history, mark chats as read/unread, archive/unarchive, clear/delete chats, and get chat profile pictures.
Messaging: Send text (with link previews/reply support), media (images, videos, documents via URL or base64), audio/voice, location, and contact cards (vCard). Also supports editing, deleting, pinning/unpinning, reacting to, and starring/unstarring messages.
Group Management: List, create, and get detailed group info; set/delete group pictures; update group name/description; leave groups; manage participants (add, remove, promote/demote admins); get, revoke, or join via invite links; preview group info from an invite link; and toggle admin-only messaging/info editing restrictions.
Contact Management: Look up contacts, list all contacts with sorting/pagination, check if a phone number is registered on WhatsApp, get contact about/status text and profile pictures, and block/unblock contacts.
Presence: Get, subscribe to, and retrieve presence updates (online/offline/typing) for chats, and set your own presence status (online, offline, typing, recording, paused).
MCP Resources: Access cached, context-aware WhatsApp data — recent chats overview (waha://chats/overview) and chat message history (waha://chat/{chatId}/messages).
Enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform, providing tools for chat management, sending and retrieving messages, and marking messages as read.
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., "@WAHA MCP Serversend a message to John at 1234567890 saying I'll be 10 minutes late"
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.
WAHA MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform.
Features
Chat Management: Get overview of recent WhatsApp chats
Message Operations: Retrieve, send, and mark messages as read
MCP Resources: Access WhatsApp data as context-aware resources with caching
MCP Integration: Full compatibility with MCP clients (stdio transport)
Installation
Clone this repository
Install dependencies:
npm installConfigure your WAHA API connection:
cp .env.example .envThen edit
.envwith your WAHA instance details.
Configuration
Required environment variables in .env:
WAHA_BASE_URL: Your WAHA server URL (e.g.,http://localhost:3000)WAHA_API_KEY: Your WAHA API key for authenticationWAHA_SESSION: WhatsApp session name (default:default)
Development
Build the project
npm run buildRun in development mode with auto-reload
npm run devTest with MCP Inspector
The MCP Inspector is a web-based tool to test your MCP server interactively:
npm run inspectorThis will:
Start the WAHA MCP server
Launch the MCP Inspector web UI
Open your browser automatically
Use the inspector to:
Test all tools interactively
View tool schemas
See request/response data
Debug tool calls
Run in production
npm startUsage with Claude Desktop
Add this to your Claude Desktop MCP configuration:
Windows:
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["C:\\Users\\YourUsername\\path\\to\\waha\\dist\\index.js"],
"env": {
"WAHA_BASE_URL": "http://localhost:3000",
"WAHA_API_KEY": "your-api-key-here",
"WAHA_SESSION": "default"
}
}
}
}Mac/Linux:
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["/absolute/path/to/waha-mcp-server/dist/index.js"],
"env": {
"WAHA_BASE_URL": "http://localhost:3000",
"WAHA_API_KEY": "your-api-key-here",
"WAHA_SESSION": "default"
}
}
}
}Note: Windows users should use double backslashes (
\\) in paths.
Available Tools
Chat Management
Tool | Description |
| Get overview of recent WhatsApp chats |
| Get messages from a specific chat |
| Mark messages in a chat as read |
| Mark a chat as unread |
| Clear all messages from a chat (destructive) |
| Delete a chat completely (destructive) |
| Archive a chat |
| Unarchive a chat |
| Get the profile picture URL for a chat |
Messaging
Tool | Description |
| Send a text message to a chat |
| Send images, videos, or documents |
| Send audio/voice messages |
| Send location coordinates |
| Send contact card(s) using vCard format |
| Edit a sent message (own messages only) |
| Delete a specific message (destructive) |
| Pin a message in a chat |
| Unpin a message in a chat |
| Add or remove an emoji reaction |
| Star or unstar a message |
Groups
Tool | Description |
| List all groups with filtering and pagination |
| Get total number of groups |
| Get detailed info about a specific group |
| Get group profile picture URL |
| Set or update group profile picture |
| Remove group profile picture |
| Create a new WhatsApp group |
| Change group name/subject |
| Update group description |
| Leave a group |
| List all members in a group |
| Add member(s) to a group (admin required) |
| Remove member(s) from a group (admin required) |
| Promote participant(s) to admin (admin required) |
| Remove admin privileges (admin required) |
| Get group invite link |
| Revoke invite link and generate a new one (admin required) |
| Join a group using an invite code/link |
| Get group info from invite link without joining |
| Toggle admin-only messaging (admin required) |
| Toggle admin-only group info editing (admin required) |
Contacts
Tool | Description |
| Get contact information by ID |
| List all contacts with pagination |
| Check if a phone number is registered on WhatsApp |
| Get contact's about/status text |
| Get contact's profile picture URL |
| Block a contact |
| Unblock a contact |
Presence
Tool | Description |
| Get online/offline/typing status for a chat |
| Subscribe to presence updates for a chat |
| Get all subscribed presence information |
| Set your own presence status (online, offline, typing, etc.) |
MCP Resources
In addition to tools, the server exposes MCP Resources for context-aware data access:
Available Resources
waha://chats/overview- Recent chats with last message previewswaha://chat/{chatId}/messages- Message history from a specific chat
Resources support query parameters for filtering and pagination. Data is cached for 5 minutes for performance.
Project Structure
waha-mcp-server/
├── src/
│ ├── index.ts # Server entry point
│ ├── config.ts # Configuration management
│ ├── types/ # TypeScript type definitions
│ ├── tools/ # MCP tool implementations
│ ├── resources/ # MCP resource implementations
│ │ ├── base/ # Base resource class
│ │ ├── implementations/ # Concrete resources
│ │ ├── cache/ # LRU caching layer
│ │ └── manager/ # Resource registry
│ └── client/ # WAHA API client
├── dist/ # Built JavaScript output
├── .env # Your configuration (not in git)
├── .env.example # Configuration template
├── package.json
└── tsconfig.jsonChat ID Format
WhatsApp chat IDs have specific formats:
Individual chats:
<phone_number>@c.us(e.g.,1234567890@c.us)Group chats:
<group_id>@g.us(e.g.,123456789012345678@g.us)
You can get chat IDs by using the waha_get_chats tool first.
License
ISC