WhatsApp HTTP API integration for Claude Desktop & MCP-compatible clients
WAHA MCP Server
WhatsApp HTTP API integration for Claude Desktop & MCP-compatible clients
Documentation • Installation • Configuration • 🤖 Claude Code Setup • Tools Reference
🚀 What is WAHA MCP?
WAHA MCP Server bridges the powerful WAHA (WhatsApp HTTP API) with AI assistants like Claude Desktop, enabling seamless WhatsApp automation through the Model Context Protocol (MCP).
✨ Key Features
- 📱 Complete WhatsApp Control - Send/receive messages, manage chats, create groups
- 🎯 63 Tools - Comprehensive API coverage for sessions, messaging, contacts, groups, and interactive workflows
- 🔄 Smart Media Handling - Auto-conversion for voice/video, support for URLs & local files
- 🤖 AI-Native - Built specifically for LLM integration via MCP
- 🔒 Secure - Environment-based API key management
- ⚡ Fast & Reliable - TypeScript-powered with robust error handling
📋 Prerequisites
Before you begin, ensure you have:
- Node.js 18+ - Download here
- A running WAHA instance - Setup guide
- WAHA API Key - Generated from your WAHA dashboard
🛠️ Installation
1. Clone & Install
git clone https://github.com/dudu1111685/waha-mcp.git
cd waha-mcp
npm install
npm run build
2. Set Environment Variables
Create a .env file or export variables:
export WAHA_API_KEY="your-api-key-here"
export WAHA_URL="http://localhost:3001" # Optional, defaults to localhost:3001
⚙️ Configuration
Claude Desktop
Add to claude_desktop_config.json:
Linux: ~/.config/claude/claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["/absolute/path/to/waha-mcp/dist/index.js"],
"env": {
"WAHA_API_KEY": "your-api-key-here",
"WAHA_URL": "http://localhost:3001"
}
}
}
}
Cline / VS Code
Add to your Cline MCP settings (~/.vscode/mcp.json or workspace settings):
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["/absolute/path/to/waha-mcp/dist/index.js"],
"env": {
"WAHA_API_KEY": "your-api-key-here"
}
}
}
}
Claude Code (Autonomous Development)
🤖 Enable truly autonomous AI development:
Instead of Claude stopping when it needs user input, it can ask questions via WhatsApp and continue working!
🚀 Complete Setup Guide: `CLAUDE_CODE_SETUP.md`
Quick config example:
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["/path/to/waha-mcp/dist/index.js"],
"env": {
"WAHA_API_KEY": "your-key",
"USER_WHATSAPP_CHAT_ID": "1234567890@c.us"
}
}
},
"globalInstructions": "When you need user input during development, use ask_user_via_whatsapp tool. Never stop and wait for manual console input."
}
How it works:
- Claude hits a question → asks via WhatsApp
- You reply from your phone
- Claude continues working immediately
- Zero downtime! ⚡
📖 See also:
- `CLAUDE_CODE_SETUP.md` - Complete setup guide
- `CLAUDE_CODE_INSTRUCTIONS.md` - Usage examples for AI assistants
Other MCP Clients
Use the mcporter CLI for quick testing:
mcporter call 'waha-mcp.waha_list_sessions()'
mcporter call 'waha-mcp.waha_send_text(chatId: "1234567890@c.us", text: "Hello from MCP!")'
🧰 Tools Reference
📂 Categories
Session Management (8 tools)
| Tool | Description |
|---|---|
waha_list_sessions |
List all sessions and their statuses |
waha_get_session |
Get detailed info about a session |
waha_create_session |
Create a new session |
waha_start_session |
Start a stopped session |
waha_stop_session |
Stop a running session |
waha_restart_session |
Restart a session |
waha_delete_session |
Delete a session permanently |
waha_logout_session |
Disconnect WhatsApp account from session |
Authentication (3 tools)
| Tool | Description |
|---|---|
waha_get_qr_code |
Get QR code for WhatsApp authentication |
waha_request_pairing_code |
Request phone number pairing code |
waha_check_auth_status |
Check session authentication status |
Messaging (14 tools)
| Tool | Description |
|---|---|
waha_send_text |
Send a text message |
waha_send_image |
Send an image (local file or URL) |
waha_send_video |
Send a video with auto-conversion |
waha_send_voice |
Send a voice message with auto-conversion |
waha_send_file |
Send any document/file |
waha_send_location |
Send a location pin |
waha_send_contact |
Send a contact vCard |
waha_send_poll |
Create and send a poll |
waha_react_to_message |
React with emoji 👍❤️😂 |
waha_forward_message |
Forward a message |
waha_get_messages |
Get messages with pagination |
waha_delete_message |
Delete a message |
waha_edit_message |
Edit a sent message |
waha_mark_as_read |
Mark messages as read |
waha_star_message |
Star/unstar a message |
📤 Media Upload Features:
- ✅ Local files & URLs supported
- ✅ Auto MIME type detection
- ✅ Auto video/voice conversion to WhatsApp format
- ✅ 50+ file types supported
- ✅ Base64 encoding handled automatically
Chat Management (7 tools)
| Tool | Description |
|---|---|
waha_list_chats |
List all chats |
waha_get_chat |
Get detailed chat info |
waha_archive_chat |
Archive/unarchive a chat |
waha_pin_chat |
Pin/unpin a chat |
waha_mute_chat |
Mute/unmute a chat |
waha_delete_chat |
Delete a chat |
waha_clear_chat |
Clear all messages |
Contacts (5 tools)
| Tool | Description |
|---|---|
waha_get_contacts |
Get all contacts |
waha_get_contact |
Get info about a contact |
waha_check_number_exists |
Check if number is on WhatsApp |
waha_block_contact |
Block/unblock a contact |
waha_get_profile_picture |
Get profile picture URL |
Groups (13 tools)
| Tool | Description |
|---|---|
waha_create_group |
Create a new group |
waha_list_groups |
List all groups |
waha_get_group |
Get detailed group info |
waha_get_group_participants |
List group participants |
waha_add_group_participants |
Add participants |
waha_remove_group_participants |
Remove participants |
waha_promote_group_participant |
Promote to admin |
waha_demote_group_participant |
Demote from admin |
waha_update_group_subject |
Update group name |
waha_update_group_description |
Update group description |
waha_update_group_picture |
Set group profile picture |
waha_leave_group |
Leave a group |
waha_get_group_invite_code |
Get invite link |
waha_revoke_group_invite |
Revoke & regenerate link |
Presence & Status (5 tools)
| Tool | Description |
|---|---|
waha_set_presence |
Set online/offline status |
waha_get_presence |
Get contact's presence |
waha_start_typing |
Show typing indicator |
waha_stop_typing |
Stop typing indicator |
waha_send_status |
Post a text status/story |
Labels (5 tools)
| Tool | Description |
|---|---|
waha_get_labels |
Get all labels |
waha_create_label |
Create a new label |
| `waha_delet |
Tools (63)
waha_list_sessionsList all sessions and their statuseswaha_get_sessionGet detailed info about a sessionwaha_create_sessionCreate a new sessionwaha_start_sessionStart a stopped sessionwaha_stop_sessionStop a running sessionwaha_restart_sessionRestart a sessionwaha_delete_sessionDelete a session permanentlywaha_logout_sessionDisconnect WhatsApp account from sessionwaha_get_qr_codeGet QR code for WhatsApp authenticationwaha_request_pairing_codeRequest phone number pairing codewaha_check_auth_statusCheck session authentication statuswaha_send_textSend a text messagewaha_send_imageSend an image (local file or URL)waha_send_videoSend a video with auto-conversionwaha_send_voiceSend a voice message with auto-conversionwaha_send_fileSend any document/filewaha_send_locationSend a location pinwaha_send_contactSend a contact vCardwaha_send_pollCreate and send a pollwaha_react_to_messageReact with emoji 👍❤️😂waha_forward_messageForward a messagewaha_get_messagesGet messages with paginationwaha_delete_messageDelete a messagewaha_edit_messageEdit a sent messagewaha_mark_as_readMark messages as readwaha_star_messageStar/unstar a messagewaha_list_chatsList all chatswaha_get_chatGet detailed chat infowaha_archive_chatArchive/unarchive a chatwaha_pin_chatPin/unpin a chatwaha_mute_chatMute/unmute a chatwaha_delete_chatDelete a chatwaha_clear_chatClear all messageswaha_get_contactsGet all contactswaha_get_contactGet info about a contactwaha_check_number_existsCheck if number is on WhatsAppwaha_block_contactBlock/unblock a contactwaha_get_profile_pictureGet profile picture URLwaha_create_groupCreate a new groupwaha_list_groupsList all groupswaha_get_groupGet detailed group infowaha_get_group_participantsList group participantswaha_add_group_participantsAdd participantswaha_remove_group_participantsRemove participantswaha_promote_group_participantPromote to adminwaha_demote_group_participantDemote from adminwaha_update_group_subjectUpdate group namewaha_update_group_descriptionUpdate group descriptionwaha_update_group_pictureSet group profile picturewaha_leave_groupLeave a groupwaha_get_group_invite_codeGet invite linkwaha_revoke_group_inviteRevoke & regenerate linkwaha_set_presenceSet online/offline statuswaha_get_presenceGet contact's presencewaha_start_typingShow typing indicatorwaha_stop_typingStop typing indicatorwaha_send_statusPost a text status/storywaha_get_labelsGet all labelswaha_create_labelCreate a new labelwaha_delete_labelDelete a labelwaha_add_label_to_chatAdd label to chatwaha_remove_label_from_chatRemove label from chatask_user_via_whatsappSend a question and WAIT for user reply (blocking operation). Perfect for Claude Code workflows that need user input mid-execution.Environment Variables
WAHA_API_KEYrequiredAPI key generated from WAHA dashboardWAHA_URLWAHA instance URL, defaults to http://localhost:3001USER_WHATSAPP_CHAT_IDUser WhatsApp chat ID for interactive workflowsConfiguration
{
"mcpServers": {
"waha": {
"command": "node",
"args": ["/absolute/path/to/waha-mcp/dist/index.js"],
"env": {
"WAHA_API_KEY": "your-api-key-here",
"WAHA_URL": "http://localhost:3001"
}
}
}
}