whatsapp-local-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENAI_API_KEY | No | Used by Whisper. Falls back to api-key.txt in repo root. | |
| WHATSAPP_STALE_MS | No | Force reconnect if no socket activity in this long | 180000 |
| WHATSAPP_BRIDGE_PORT | No | Local HTTP port the bridge listens on | 8765 |
| WHATSAPP_HISTORY_DAYS | No | Drop history-sync messages older than this many days | 30 |
| WHATSAPP_VOICE_MAX_SECONDS | No | Skip voice notes longer than this when transcribing | 300 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_statusA | Return current WhatsApp connection status (connected, retention, transcription, cache size, idle seconds, etc). |
| list_chatsA | List WhatsApp chats from the local cache, sorted by most recent activity. Each chat has both |
| get_recent_messagesA | Get messages from the last N hours from the local cache. Optionally filter to one chatId or exclude groups. Each message includes |
| search_messagesA | Case-insensitive substring search across cached messages. Looks back |
| get_briefA | Return the most recently generated brief from data/brief.json, or null if none exists. |
| set_briefA | Write a JSON brief object to data/brief.json. Called by Claude after analyzing messages, so the WhatsApp Brief artifact can render it. |
| relink_whatsappA | Delete stale credentials and start a fresh QR pair. Returns the raw QR data string in |
| wait_for_linkA | Block until WhatsApp connection.open fires or timeout. Use after relink_whatsapp to confirm the user scanned successfully. |
| force_resyncA | Reconnect the WhatsApp socket. Use only when chats look stale; normally the bridge keeps itself connected. |
| get_imageA | Download a specific cached image from WhatsApp and return its bytes inline as image content so Claude can see and describe it natively (Opus vision is sharper than gpt-4o-mini). Pass the msgId and chatId from a get_recent_messages result that has hasMedia=true and type=imageMessage. Fails gracefully if media keys are missing (message cached before key tracking was added) or expired (>~14 days old). |
| set_descriptionA | After viewing an image via get_image, save your description back to the cache. Future briefs reuse it without re-asking Claude (so each image only costs vision tokens once). Pass chatId + msgId + description (1-2 sentences ideally). |
| enrich_windowA | VOICE-ONLY enrichment for the last N hours. Downloads voice notes and transcribes them via OpenAI Whisper. Idempotent (skips already-transcribed). IMPORTANT: this tool no longer touches images - image analysis is done by Claude (you) via the get_image tool, using the Cowork subscription instead of OpenAI Vision. To produce a full brief with both voice transcripts and image descriptions: (1) call enrich_window for voice, (2) call get_image one-by-one for each image in the window and call set_description to cache your description, (3) then call get_recent_messages to read the enriched text and write the brief. |
| save_imageA | Save a single WhatsApp image to disk. Pass the chatId + msgId from a get_recent_messages result. Default folder: /data/media//, named __.jpg. Returns the absolute path as a resource_link. On failure returns {ok:false, code, error} where code is one of: not_found, not_image, no_keys, media_expired, download_failed, disk_error, permission_denied, disk_full, timeout. The MCP response sets isError:true on failure. |
| save_voiceB | Save a single voice note (.ogg) to disk. Same parameter contract as save_image. Optionally pass transcribe:true to also run Whisper transcription on the saved file (requires OpenAI API key in api-key.txt). Returns transcript inline when transcribed successfully. Same error-code set as save_image, plus: transcribe_failed, no_api_key. |
| save_mediaB | Generic save-to-disk for any media kind (image / audio / video / document). Use save_image or save_voice when you know the type - they're clearer to read. Use this when you have a mixed list of msgIds and don't want to branch. |
| list_media_windowA | Preview which media items would be saved by save_media_window. Read-only - does NOT download or write anything. Returns per-item entries with chatId, msgId, kind, sender, chat, timestampISO, sizeBytes, mimeType, and |
| save_media_windowA | Bulk-save WhatsApp media from the last N hours to disk. Downloads with bounded concurrency (default 3) and returns PER-ITEM results - items that fail (expired, no keys, network) are reported in |
| where_do_media_files_goA | Return the default folder save_image / save_voice / save_media_window write to (today's folder under /data/media/YYYY-MM-DD), plus how many files are already in it. Useful for answering 'where did you save them?' without filesystem access. |
| backfill_historyA | Try to recover WhatsApp messages missed while the bridge was offline (e.g. you didn't open Cowork for a few days, leaving a gap in the history). For each of the most recently active chats it asks WhatsApp's on-demand history sync (Baileys fetchMessageHistory) for older messages, anchored at the newest cached message in that chat. Results arrive asynchronously and are cached. IMPORTANT: how far back WhatsApp actually serves is decided by WhatsApp, not us - run this to find out empirically for this account. Returns cacheBefore/cacheAfter (messagesAdded) and per-chat request info. If messagesAdded is ~0, WhatsApp didn't serve more for those anchors; a fresh re-link (relink_whatsapp) is the fuller-history fallback. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIBE13/whatsapp-local-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server