mac-wa-mcp

v0.1.0
mac-wa-mcp Checked 1 day ago Published 4 months ago

WhatsApp MCP server (stdio) — pair with `wa` CLI (mac-wa)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_contacts

Search WhatsApp contacts by name or phone number. Args: query: Search term to match against contact names or phone numbers

ParameterTypeDescription
query *string

list_messages

Get WhatsApp messages matching specified criteria with optional context. Args: after: Optional ISO-8601 formatted string to only return messages after this date before: Optional ISO-8601 formatted string to only return messages before this date sender_phone_number: Optional phone number to filter messages by sender chat_jid: Optional chat JID to filter messages by chat query: Optional search term to filter messages by content limit: Maximum number of messages to return (default 20) page: Page number for pagination (default 0)…

ParameterTypeDescription
after
before
chat_jid
context_afterinteger
context_beforeinteger
include_contextboolean
limitinteger
pageinteger
query
sender_phone_number

list_chats

Get WhatsApp chats matching specified criteria. Args: query: Optional search term to filter chats by name or JID limit: Maximum number of chats to return (default 20) page: Page number for pagination (default 0) include_last_message: Whether to include the last message in each chat (default True) sort_by: Field to sort results by, either "last_active" or "name" (default "last_active")

ParameterTypeDescription
include_last_messageboolean
limitinteger
pageinteger
query
sort_bystring

get_chat

Get WhatsApp chat metadata by JID. Args: chat_jid: The JID of the chat to retrieve include_last_message: Whether to include the last message (default True)

ParameterTypeDescription
chat_jid *string
include_last_messageboolean

get_direct_chat_by_contact

Get WhatsApp chat metadata by sender phone number. Args: sender_phone_number: The phone number to search for

ParameterTypeDescription
sender_phone_number *string

get_contact_chats

Get all WhatsApp chats involving the contact. Args: jid: The contact's JID to search for limit: Maximum number of chats to return (default 20) page: Page number for pagination (default 0)

ParameterTypeDescription
jid *string
limitinteger
pageinteger

get_last_interaction

Get most recent WhatsApp message involving the contact. Args: jid: The JID of the contact to search for

ParameterTypeDescription
jid *string

get_message_context

Get context around a specific WhatsApp message. Args: message_id: The ID of the message to get context for before: Number of messages to include before the target message (default 5) after: Number of messages to include after the target message (default 5)

ParameterTypeDescription
message_id *string
afterinteger
beforeinteger

send_message

Send a WhatsApp message to a person or group. For group chats use the JID. Args: recipient: The recipient - either a phone number with country code but no + or other symbols, or a JID (e.g., "123456789@s.whatsapp.net" or a group JID like "123456789@g.us") message: The message text to send Returns: A dictionary containing success status and a status message

ParameterTypeDescription
message *string
recipient *string

send_file

Send a file such as a picture, raw audio, video or document via WhatsApp to the specified recipient. For group messages use the JID. Args: recipient: The recipient - either a phone number with country code but no + or other symbols, or a JID (e.g., "123456789@s.whatsapp.net" or a group JID like "123456789@g.us") media_path: The absolute path to the media file to send (image, video, document) Returns: A dictionary containing success status and a status message

ParameterTypeDescription
media_path *string
recipient *string

send_audio_message

Send any audio file as a WhatsApp audio message to the specified recipient. For group messages use the JID. If it errors due to ffmpeg not being installed, use send_file instead. Args: recipient: The recipient - either a phone number with country code but no + or other symbols, or a JID (e.g., "123456789@s.whatsapp.net" or a group JID like "123456789@g.us") media_path: The absolute path to the audio file to send (will be converted to Opus .ogg if it's not a .ogg file) Returns: A dictionary containing success status and a status message…

ParameterTypeDescription
media_path *string
recipient *string

download_media

Download media from a WhatsApp message and get the local file path. Args: message_id: The ID of the message containing the media chat_jid: The JID of the chat containing the message Returns: A dictionary containing success status, a status message, and the file path if successful

ParameterTypeDescription
chat_jid *string
message_id *string