hn.today

Show HN: WhatsApp MCP running free on Cloudflare

github.com54 points37 comments
Screenshot of Show HN: WhatsApp MCP running free on Cloudflare

A self-hosted MCP server that runs on Cloudflare Workers and lets an AI agent read and search a single WhatsApp account’s message history. Link a phone like WhatsApp Web once, then any MCP-capable client (Claude Code, Claude Desktop, etc.) can call tools to list chats, fetch messages, full-text search, name unnamed numbers, force a sync, check link status, or relink. The server only reads and indexes text into a SQLite database inside a Durable Object; it does not send messages, download media (images/voice notes appear as labeled placeholders), or transcribe audio. The first link imports whatever WhatsApp provides for a new device; the import is one-time unless you relink. Unnamed chats appear as phone numbers and are resolved by the agent using the owner’s contacts tool via set_contact_names.

Implementation details: one Durable Object ("owner") holds SQLite (messages, auth keys, FTS5 index) and runs Baileys sessions only during pairing or pulls; the Worker is stateless aside from a KV namespace for OAuth tokens and a short-lived sign-in record. A daily cron plus on-demand sync pulls queued updates. Setup requires Cloudflare Workers Paid plan (higher CPU limits for large imports), Node 20+, and a phone. This uses the WhatsApp Web protocol through Baileys and thus violates WhatsApp terms; the author warns to use it only for your own account and not for sending messages.

Read on github.com37 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.