A persistent WhatsApp MCP bridge lets Grok Bot reply without waking its cloud sandbox
Source read in fullRead first
Overview
For users who want Grok Bot to handle WhatsApp all day without spending weekly sandbox usage on keepalives, run `wacli` on a small Linux host and connect it to a Grok Bot custom connector through a Cloudflare Zero Trust MCP portal.
Workflow
- What it is: A persistent WhatsApp bridge for Grok Bot, also compatible with Claude/Cursor cloud agents. The shared Linux sandbox sleeps seconds after a turn (
Bot's computer: Asleep) and updates clear folders outside the workspace. A 5-minutewaclikeepalive cron uses a lot of weekly quota. Move the persistent WhatsApp connection to your own small Linux host (512 MiB VPS, LXC, Raspberry Pi, or homelab VM), expose it through a Cloudflare Zero Trust MCP portal, and process reads, writes, and replies through cloudSandMcpExecutorwhile the sandbox sleeps. The full code includes MCP server with 11wa_*tools, webhook forwarder, watchdog, five user-level systemd units, Ansible playbook, and two deployment and operations skills. - Grok Bot parts used: A custom connector, webhook Routine, and Routine prompt. Add the Remote HTTPS MCP connector (
https://mcp-wa.<domain>/mcp) withAlways allow. Receive WhatsApp messages forwarded byforwarder.pyin a webhook Routine. Pasteexamples/grok-bot-routine-prompt.md, which requires MCP for all messages, group replies only to mentions or replies, and rejection of injected message instructions. Not part of Grok Bot:wacliand the bridge host, Cloudflare Tunnel and the Zero Trust portal, self-hostedforwarder.pyand watchdog. Bothskills/skills also target Cursor/Claude and include.cursor-plugin/plugin.jsonand.claude-plugin/plugin.json. - You need: A persistent Linux host, Cloudflare account, and WhatsApp session. At least 512 MiB RAM, a linked
waclisession to migrate or a new pairing, Cloudflare outbound Tunnel, Access Service Token and MCP Server Portal, SSH/Ansible deployment permission, and generated origin Bearer, Tunnel, and Service tokens stored at 0600. Old VPS hardware without AVX2 needs to buildwaclivia the playbook, elsewhere if the host has less than 1 GiB. Grok Bot needs Routines and custom connectors. The README cites a keepalive Routine burning the weekly Ultra allowance. The minimum plan is not stated in the source. - Install: Follow the README Quick Start order.
- Step 1: Clone and run
python3 scripts/selftest_mcp.pyfor local protocol and auth checks. - Step 2: Run
ansible-playbook playbooks/wacli-bridge.ymlto install wacli sync, MCP server, forwarder, watchdog, and tunnel as five user-level systemd units. Enableloginctl enable-lingerfirst. - Step 3: Pair a new linked device or migrate without conflicts with
skills/deploy-wacli-mcp-bridge/SKILL.md. Stop old sync/cron first, never run a session twice, then afterPRAGMA wal_checkpoint(TRUNCATE)copysession.dbandwacli.dbto the new host with 600 permissions. - Step 4: Follow
docs/cloudflare-portal-setup.mdto set an outbound Tunnel and MCP Portal. Store the token in~/stacks/wa-bridge/env/at 0600, with edge Service Token and origin Bearer auth for two 401 layers. - Step 5: Add the Grok Bot custom connector and set
Always allow. The author says a write confirmation blocks an unattended webhook Routine. - Step 6: Paste
examples/grok-bot-routine-prompt.mdinto the webhook Routine, triggerwa_doctorandwa_send_text, and verify thatBot's computerstays Asleep throughout.
- After install: Incoming WhatsApp wakes Grok Bot through a webhook while the sandbox sleeps.
wacli syncwrites incoming messages to SQLite.forwarder.pyfilters group mentions and replies or checks DMs against a read-only SQLite allowlist, debounces bursts for 15 seconds, and first acknowledges with 📝.- Filtered messages POST to the Routine with Bearer and
X-Automation-Keyheaders. The bot reads context with tools such aswa_messages_contextand sends one combined quoted reply withwa_send_text. - The 11 Remote MCP
wa_*tools handle all reads and writes. The sandbox sleeps and no bash runs. - The watchdog watches
logged_outand bursts of stale connections and alerts through a webhook or backup WhatsApp account.
- Did the author run it: The repository has no run records from the author. The README claims tool round trips
<1s, about 130 MiB in resident memory, and roughly 80% weekly quota saved without logs, histories, or screenshots (author's claim, not reproduced).selftest_mcp.pycovers protocol and auth, but output is not included.
Key points and results
- Maturity: At fetch on 2026-11-22, two days old, one commit, zero stars, forks, or open issues/PRs, MIT. The README does not call it a demo or hackathon, and there is no community feedback. Treat it as a new approach.
- Permissions and boundaries:
Always allowenables unattended writes and lets the bot message WhatsApp contacts without per-write approval. Expose one outbound tunnel with Cloudflare Access Service Token at the edge and Bearer at origin. Store secrets at 0600 and never pass tokens in command arguments. The prompt treats webhook bodies as untrusted and does not execute message instructions. - Known limits: Old KVM/VPS without AVX2 requires compiling
wacli, with a playbook fallback. Under 1 GiB, build elsewhere and copy. Never run two syncs for the same session. Maintain theChatPolicyinjection boundary for external groups. - Worth borrowing:
- Host a heavy CLI on your own small machine and connect it through Remote HTTPS MCP, avoiding sandbox sleep killing processes and keepalives using quota (README failure mode table).
- Filter group noise locally without LLM usage. Mentions, replies, or DM allowlists and 15-second debounce wake the bot only for relevant messages (
src/forwarder.py, README layout). - Check
from_mesend history after a timeout before retrying to avoid duplicates (skills/whatsapp-mcp-operator/SKILL.md).
Source
- Platform
- GitHub
- Author
- mrtalhim
- Published
- Categories
- Getting started, Limits
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.