whatsapp-mcp
v0.1.1Lightweight WhatsApp MCP Server using Baileys
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
connect Connect to WhatsApp
Start the WhatsApp socket. Generates a QR code if not paired yet.
| Parameter | Type | Description |
|---|---|---|
timeoutMs | integer | |
waitForOpen | boolean |
status Connection Status
Return current connection state, phone number, and whether a QR code is ready.
qr_code Get Pairing QR Code
Get the pairing QR code (default `png` returns an inline image).
| Parameter | Type | Description |
|---|---|---|
format | string |
disconnect Disconnect
Close the WhatsApp socket without losing saved auth.
logout Logout
Log out and wipe local auth state (requires re-pairing).
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean |
list_chats List Chats
List chats ordered by latest activity. Shows chatId, name, phone, lid, unreadCount, awaitingMyReply, and lastMessage (with fromMe and sender).
| Parameter | Type | Description |
|---|---|---|
awaitingMyReply | boolean | If true, only chats where they sent the last message or unread > 0 |
limit | integer | |
offset | integer | |
onlyGroups | boolean | |
onlyUnread | boolean | |
query | string | Filter by name, phone, or JID |
get_messages Get Messages
Get chronological messages (oldest first) for a chat. Accepts phone number, @s.whatsapp.net, @lid, or @g.us and resolves aliases automatically.
| Parameter | Type | Description |
|---|---|---|
chat * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
beforeTimestamp | integer | Pagination cursor: unix timestamp |
limit | integer |
search_messages Search Messages
Search messages across all chats (newest first), with optional surrounding context.
| Parameter | Type | Description |
|---|---|---|
after | ISO 8601 date/datetime or unix seconds | |
before | ISO 8601 date/datetime or unix seconds | |
chat | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
context | integer | |
fromMe | boolean | true = sent by you, false = received |
limit | integer | |
offset | integer | |
query | string | |
sender | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
get_message_context Get Message Context
Show messages before and after a specific message ID in the same chat.
| Parameter | Type | Description |
|---|---|---|
messageId * | string | |
after | integer | |
before | integer |
download_media Download Media
Download media for a messageId. Images and stickers return inline.
| Parameter | Type | Description |
|---|---|---|
messageId * | string |
fetch_history Fetch Older History
Request older messages from WhatsApp for a chat (answers asynchronously).
| Parameter | Type | Description |
|---|---|---|
chat * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
count | integer |
history_status History Sync Status
Show how much history WhatsApp has synced since connecting.
search_contacts Search Contacts
Search saved contacts and push names by name, phone, JID, or LID.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer |
get_contact Get Contact Summary
Get contact details, direct chat, last interaction, and shared groups.
| Parameter | Type | Description |
|---|---|---|
contact * | string |
get_group Get Group Info
Get a group's subject, description, and participants.
| Parameter | Type | Description |
|---|---|---|
jid * | string | Group JID ending in @g.us |
resolve_jid Resolve Phone/JID
Validate a phone number or JID on WhatsApp and return its canonical JID, phone, and LID.
| Parameter | Type | Description |
|---|---|---|
input * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
send_text Send Text Message
Send a text message to a phone number, JID, LID, or group.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
to * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
quotedMessageId | string |
send_media Send Media
Send image, audio (Opus voice note by default if ffmpeg is installed), video, or document.
| Parameter | Type | Description |
|---|---|---|
mediaType * | string | |
to * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
base64 | string | Base64 content (alternative to filePath) |
caption | string | |
filePath | string | Absolute path on disk (stdio only) |
filename | string | |
mimetype | string | |
ptt | boolean | For audio: send as voice note (default true) |
quotedMessageId | string |
send_reaction Send Reaction
React to a message with an emoji (empty string removes reaction).
| Parameter | Type | Description |
|---|---|---|
emoji * | string | |
targetMessageId * | string | |
to * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
fromMe | boolean |
mark_read Mark Chat As Read
Mark messages in a chat as read on WhatsApp and reset unreadCount. If messageIds is omitted, marks recent incoming messages.
| Parameter | Type | Description |
|---|---|---|
chat * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
messageIds | array |
edit_message Edit Message
Edit one of your previously sent messages.
| Parameter | Type | Description |
|---|---|---|
chat * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
messageId * | string | |
newText * | string |
delete_message Delete Message
Delete a message in a chat.
| Parameter | Type | Description |
|---|---|---|
chat * | string | Phone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID |
messageId * | string | |
fromMe | boolean |