Skip to main content
Glama
README.md
<p align="center"><img src="icon.png" width="72" alt=""></p>

# Whatsgate

**Give Claude Code, Codex and other AI apps controlled access to your WhatsApp accounts.** Whatsgate runs on your Windows PC, links your accounts by QR code, and lets you decide per account what AI may do, who it may never read or message, and how careful it must be.

- **Several accounts.** Personal, business, an agent or outreach number: add as many as you like.
- **Permissions per account.** Read and send, read only, send only, or no AI access, enforced by Whatsgate.
- **Blocklist.** Hide a person or group from AI, stop AI from messaging them, or both, on one account or all of them.
- **Care levels.** Strict, normal or relaxed tell the AI how much to confirm with you before sending.
- **AI that knows your setup.** Whatsgate writes a skill for Claude Code and Codex with your accounts, numbers, permissions and rules, and rewrites it whenever you change something.
- **One-click connect.** The Connect AI tab registers the MCP server with Claude Code and Codex. Apps built on them, such as T3 Code, pick it up too.
- **Safety rails.** Per-account rate limits, duplicate-send protection, an action history, credential files that can't be sent, and recovery when a session drops.
- **Move PCs.** Export your settings and import them on another PC.
- **Lightweight.** A small Node.js service and an app window in the Edge or Chrome you already have. No Docker, no browser download, no cloud.

## Install

Requirements: Windows 10 or 11, Microsoft Edge or Google Chrome. The installer adds Node.js 22 with winget if it is missing.

1. [Download the latest release](https://github.com/MusaBukhari237/whatsgate/releases/latest) (or clone this repository) and extract it.
2. Double-click **`install.cmd`**.

Whatsgate installs to `%LOCALAPPDATA%\Whatsgate`, starts at sign-in without a window, restarts itself if it stops, and opens the **Whatsgate** app from the Start menu or desktop. To update, run the new version's `install.cmd`; your settings and linked sessions stay.

## Set up

1. **Accounts:** add each number, choose its AI access, care level, rate limit and notes, then scan its QR code on that phone (WhatsApp → Linked Devices → Link a Device).
2. **Connect AI:** click Connect for Claude Code and Codex. For other MCP apps, copy the server entry shown there.
3. **Settings:** add your name and any rules of your own, such as "never message clients after 9 pm".
4. Start a new AI session and ask it to check your WhatsApp accounts.

## Tools the AI gets

`accounts`, `list_chats`, `read_messages`, `search_messages`, `download_attachment`, `group_info`, `group_invite_info`, `action_history`, `reconnect_account`, `open_dashboard`, and on accounts that allow sending: `send_message`, `send_file`, `edit_message`, `delete_message`, `react_message`, `mark_chat_read`, `join_group`, `leave_group`, `create_group`, `update_group_members`.

## What is enforced, and what is not

Whatsgate enforces access levels, the blocklist, rate limits, duplicate protection and the file block list on every request. **Care levels and confirming with you are instructions the AI follows, not locks.** A confused model, or one tricked by text inside a WhatsApp message, could send something without asking on an account where you allowed sending. Give send access only where you accept that.

The app opens without a password using a key stored in `state`. Any program running as your Windows user, including an AI with shell access, could read that folder; the skill forbids it, but Windows cannot. Messages the AI reads go to that AI's provider.

## Risks

Whatsgate uses [whatsapp-web.js](https://github.com/wwebjs/whatsapp-web.js), an unofficial WhatsApp Web client. It can break when WhatsApp changes, and WhatsApp may restrict accounts that automate messaging, especially bulk or unsolicited messages. It is not affiliated with or endorsed by WhatsApp or Meta. For a supported business integration, see the [WhatsApp Business Platform](https://developers.facebook.com/docs/whatsapp).

## Uninstall

Run `uninstall.ps1` in `%LOCALAPPDATA%\Whatsgate`. Add `-KeepData` to keep settings and sessions. Also remove the linked device on each phone.

## Development

```powershell
npm install
npm test   # runs the service against a simulated WhatsApp
```

The service is `bridge.mjs` (HTTP on `127.0.0.1:48731`, change with `WHATSGATE_PORT`), the MCP server is `mcp.mjs`, settings and the skill writer are in `config.mjs`, and the app is `owner.html` / `owner.js`.

## Sponsors

Whatsgate is sponsored by **[LeadCeleris](https://leadceleris.com)**.

## License

[MIT](LICENSE)