whatsapp mcp

personal project


i wanted claude to be able to read and send whatsapp messages on my behalf — check what came in, reply to something, pull up an old conversation — without me switching apps. whatsapp doesn’t have a public api for personal accounts, so the only real option was to speak its multi-device protocol directly.

the go side handles that: a binary built on whatsmeow maintains the actual websocket connection to whatsapp, handles the multi-device pairing handshake, and mirrors every incoming/outgoing message into a local sqlite database. python doesn’t touch the protocol at all — it talks to the go binary over a small flask api, which keeps the fragile, stateful part (the live connection) isolated from the part that changes often (the mcp tool surface).

on top of that sits the mcp server itself: tools for sending text/images/video/audio/documents, pulling chat history, and full-text search across everything that’s ever come through. the search was the part that made this actually useful day-to-day — being able to ask “what did i say about the invoice last month” and have it search the local db instead of scrolling.

the annoying part was session durability: whatsapp’s multi-device pairing can silently drop, and go and python disagreeing about connection state is a good way to lose messages. most of the reliability work ended up being in reconnect/health-check logic between the two processes rather than in the mcp layer itself.