Skip to main content
Glama
whatsapp-export-mcp

whatsapp-export-mcp

whatsapp-export-mcp

test license: MIT

An MCP server that lets Claude, Cursor and other AI assistants read a WhatsApp chat export. Point it at the .zip you get from Export chat and ask questions about the conversation: what was agreed, when someone said something, who sent the most voice messages, which photos are missing.

You:     Open ~/Downloads/WhatsApp Chat with Ana.zip. When did we settle the moving date, and who suggested it?
Claude:  (calls open_export, then search_messages "move")
         Ana suggested Saturday the 20th on 2024-04-02 at 18:31 (#1204); you confirmed it at 18:40 (#1207).
  • Six tools: summarise an export, read messages by date or sender, search (case and accents ignored), list attachments, per-person statistics, and save a file out of the export.

  • Every message line carries its index (#1204), so the assistant can cite the exact message.

  • iPhone and Android exports, .zip or .txt, including archives re-zipped by Windows. Parsing comes from whatsapp-export-reader.

  • Runs on your machine. The server makes no network requests.

Voice messages are listed, not transcribed, so the assistant can see that a voice message was sent but not what it said. To get every voice message written out inside the conversation, as a PDF, use Zap2Doc on the same export.

Install

Requires Node.js 18.17 or newer. No global install needed: clients start it with npx.

Claude Desktop

Settings → Developer → Edit Config, then add to claude_desktop_config.json:

{
  "mcpServers": {
    "whatsapp-export": {
      "command": "npx",
      "args": ["-y", "whatsapp-export-mcp"]
    }
  }
}

Restart Claude Desktop. The tools appear under the tools icon in a new chat.

Claude Code

claude mcp add whatsapp-export -- npx -y whatsapp-export-mcp

Cursor

Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "whatsapp-export": {
      "command": "npx",
      "args": ["-y", "whatsapp-export-mcp"]
    }
  }
}

Any other MCP client

Run npx -y whatsapp-export-mcp as a stdio server.

Related MCP server: whatsapp-mcp-local

Tools

Tool

What it does

open_export

Reads the export and summarises it: participants with message counts, period, attachments by kind, files the chat mentions but the export lacks, and notes about the file.

get_messages

Messages in order, filtered by date range (from_date, to_date) and/or sender, paged with offset and limit.

search_messages

Messages containing a word or phrase, ignoring case and accents, optionally from one sender.

list_attachments

Photos, voice messages, videos, documents, stickers and contact cards, with sender, time and whether the export contains them. Filter by kind.

chat_stats

Messages, voice messages and other attachments per person, messages per month, busiest days.

save_attachment

Copies one file (a photo, an .opus voice message, a PDF) out of the export into a folder. The only tool that writes to disk.

Every tool takes path, the export file. A file is parsed once and kept in memory until it changes on disk, so follow-up questions are fast.

Messages come back one per line:

#1204 2024-04-02 18:31 Ana Souza: What if we move on Saturday the 20th? The van is free that day
#1205 2024-04-02 18:32 Ana Souza: [voice message: PTT-20240402-WA0057.opus]
#1206 2024-04-02 18:38 Bruno Lima: [image: IMG-20240402-WA0058.jpg] the van's booking page
#1207 2024-04-02 18:40 Bruno Lima: Saturday works, booking it

Things to ask

  • "Summarise this chat month by month, citing message numbers."

  • "Find every message where we talked about the rent, and list the dates."

  • "What did Ana promise, and did she follow up later in the chat?"

  • "How many voice messages did each of us send? Which ones are missing from the export?"

  • "Save all the photos from March into ~/Desktop/march." (The assistant lists them, then calls save_attachment for each.)

Getting the export

iPhone: open the chat → tap the name at the top → Export Chat → With all media (or Without media). Android: open the chat → ⋮ → More → Export chat → Include media.

Guides with screenshots: iPhone · Android.

Privacy

The server reads the file from your disk and makes no network requests. But what the tools return goes to the AI assistant you are using, and from there to its model provider, under that assistant's own terms. Ask about a conversation only if you are comfortable with that provider reading the parts the assistant pulls in. The assistant reads only what the tools return, so a narrow question (one month, one search) sends less than "summarise everything".

FAQ

Can the assistant hear the voice messages? No. It sees that a voice message was sent, by whom and when. To have them transcribed, save the .opus files with save_attachment and use a speech-to-text tool, or turn the export into a PDF with every voice message written out at Zap2Doc.

Does it work with group chats? Yes. Notices such as "Ana added Bruno" are marked as notices, not as messages from a person.

The dates look wrong. WhatsApp writes dates in the phone's regional format without saying which one. If open_export reports that the date order is a guess, pass date_order: "dmy" or "mdy".

How big an export can it handle? The archive is read entry by entry, and only the chat text is held in memory. Years of messages are fine. Each entry is capped at 512 MiB.

Development

npm install
npm test        # end-to-end through an in-memory MCP client, synthetic chats only
npm run build

License

MIT © Sam Rodrigues

Available Tools

6 tools
chat_statsChat statisticsB
Read-only

Messages, voice messages and other attachments per person, messages per month, and the busiest days.

Inputs: path (required), date_order.

get_messagesRead messagesA
Read-only

Return messages in order, optionally between two dates and from one sender. Each line starts with #index so answers can cite the exact message. Page with offset and limit.

Inputs: path (required), limit, offset, sender, +3 more.

list_attachmentsList attachmentsA
Read-only

List the photos, voice messages, videos, documents and other files the chat refers to, with who sent them, when, and whether the export contains them.

Inputs: path (required), kind, limit, date_order.

open_exportOpen a WhatsApp exportA
Read-only

Read a WhatsApp chat export and summarise it: participants and their message counts, period, attachments and anything unusual about the file. Call this first.

Inputs: path (required), date_order.

save_attachmentSave an attachmentA

Copy one file out of the export (a photo, a voice message .opus, a document) into a folder, by the name the chat uses for it. Returns the saved path.

Inputs: name (required), path (required), output_dir (required).

search_messagesSearch messagesA
Read-only

Find messages containing a word or phrase (case and accents ignored), optionally from one sender.

Inputs: path (required), query (required), limit, sender, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool has a distinct role: open_export bootstraps, get_messages reads sequentially, search_messages finds by text, chat_stats aggregates, and the two attachment tools list vs. save. Mild overlap exists between open_export's summary (participants, counts, period) and chat_stats, which could make an agent hesitate on where to get aggregate numbers, but the descriptions steer reasonably well.

    Naming Consistency4/5

    Five of six names follow a verb_noun snake_case pattern (open_export, get_messages, search_messages, list_attachments, save_attachment). chat_stats deviates by being noun_noun with no verb, a minor inconsistency in an otherwise predictable scheme.

    Tool Count5/5

    Six tools is well-scoped for a read-only chat-export analyzer: one entry point, one message reader, one search, one stats tool, and two attachment handlers. Nothing appears redundant or missing in terms of surface size.

    Completeness4/5

    The read-only lifecycle is covered: open, summarize, page through messages, search, list and extract attachments. Minor gaps remain, such as retrieving a single message by index directly or filtering attachments by type/sender, but agents can work around these with offset paging and client-side filtering.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables local querying of WhatsApp message history via SQLite, with profile separation, media transcription, and operational summaries.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides Claude with read-only access to your WhatsApp chat history entirely on your local machine, enabling natural language search, summarization, and retrieval of messages without sending data to the cloud.
      14 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to read and search your WhatsApp chat history locally with no cloud or API keys, and optionally send audited messages.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to ingest WhatsApp chat exports and shared files, search messages without diacritics, read conversations and documents or images, and draft WhatsApp replies via wa.me links while keeping data in the user's own Cloudflare account.
      MIT