whatsapp-mcp

v0.1.1
@vfunctt/whatsapp-mcp Checked 3 days ago Published 22 days ago

Lightweight 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.

ParameterTypeDescription
timeoutMsinteger
waitForOpenboolean

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).

ParameterTypeDescription
formatstring

disconnect Disconnect

Close the WhatsApp socket without losing saved auth.

logout Logout

Log out and wipe local auth state (requires re-pairing).

ParameterTypeDescription
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).

ParameterTypeDescription
awaitingMyReplybooleanIf true, only chats where they sent the last message or unread > 0
limitinteger
offsetinteger
onlyGroupsboolean
onlyUnreadboolean
querystringFilter 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.

ParameterTypeDescription
chat *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
beforeTimestampintegerPagination cursor: unix timestamp
limitinteger

search_messages Search Messages

Search messages across all chats (newest first), with optional surrounding context.

ParameterTypeDescription
afterISO 8601 date/datetime or unix seconds
beforeISO 8601 date/datetime or unix seconds
chatstringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
contextinteger
fromMebooleantrue = sent by you, false = received
limitinteger
offsetinteger
querystring
senderPhone 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.

ParameterTypeDescription
messageId *string
afterinteger
beforeinteger

download_media Download Media

Download media for a messageId. Images and stickers return inline.

ParameterTypeDescription
messageId *string

fetch_history Fetch Older History

Request older messages from WhatsApp for a chat (answers asynchronously).

ParameterTypeDescription
chat *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
countinteger

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.

ParameterTypeDescription
query *string
limitinteger

get_contact Get Contact Summary

Get contact details, direct chat, last interaction, and shared groups.

ParameterTypeDescription
contact *string

get_group Get Group Info

Get a group's subject, description, and participants.

ParameterTypeDescription
jid *stringGroup 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.

ParameterTypeDescription
input *stringPhone 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.

ParameterTypeDescription
text *string
to *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
quotedMessageIdstring

send_media Send Media

Send image, audio (Opus voice note by default if ffmpeg is installed), video, or document.

ParameterTypeDescription
mediaType *string
to *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
base64stringBase64 content (alternative to filePath)
captionstring
filePathstringAbsolute path on disk (stdio only)
filenamestring
mimetypestring
pttbooleanFor audio: send as voice note (default true)
quotedMessageIdstring

send_reaction Send Reaction

React to a message with an emoji (empty string removes reaction).

ParameterTypeDescription
emoji *string
targetMessageId *string
to *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
fromMeboolean

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.

ParameterTypeDescription
chat *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
messageIdsarray

edit_message Edit Message

Edit one of your previously sent messages.

ParameterTypeDescription
chat *stringPhone 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.

ParameterTypeDescription
chat *stringPhone number (e.g. 212674046386), @s.whatsapp.net JID, @lid, or @g.us group JID
messageId *string
fromMeboolean