Skip to main content
Glama
WhatsApp MCP Server

WhatsApp MCP Server

by MAnasLatif
README.md
# WhatsApp MCP Server

An open-source, self-hosted [Model Context Protocol](https://modelcontextprotocol.io) server that lets you manage several WhatsApp accounts from ChatGPT, Codex, Claude Code or any other MCP client.

> [!IMPORTANT]
> **Early development.** The repository, requirements and startup configuration are in place. WhatsApp and MCP features are not implemented yet, so there is nothing to deploy. Progress is tracked in the [issues](https://github.com/MAnasLatif/wa-mcp/issues).

## Purpose

- **Your own server.** You deploy it, and your data stays with you. The project runs no central service.
- **Many accounts.** Connect personal, WhatsApp Business app and company numbers to one server.
- **Any MCP client.** The server follows the MCP standard and contains no AI. Your client does the thinking.
- **Content passed through unchanged.** Files and text reach the client exactly as WhatsApp delivered them.
- **Confirmation based on risk.** Deletes, bulk sends and new recipients need your approval outside the conversation.

The full requirements are in [docs/SRS.md](docs/SRS.md).

> [!WARNING]
> This project uses [whatsapp-web.js](https://wwebjs.dev), an unofficial library. It is not affiliated with or endorsed by WhatsApp or Meta, and WhatsApp may block a number that uses it. Do not test with a number you cannot afford to lose.

## Stack

| Part | Technology |
|---|---|
| Runtime | Node.js 26 and TypeScript |
| Configuration | Zod |
| Checks | Biome, Vitest, Lefthook and commitlint |
| Planned | MCP TypeScript SDK, whatsapp-web.js, Chromium, Cloudflare R2 and Docker |

## Structure

```text
.github/               Issue forms, pull request template and workflows
docs/
  SRS.md               Requirements, rules and numbered decisions
  ARCHITECTURE.md      Design, deployment and recovery
  USERFLOW.md          Owner and client journeys
src/
  config/              Environment variables and their validation
  startup.ts           Startup checks
  main.ts              Entry point
```

## Setup

You need [Git](https://git-scm.com), [Node.js 26](https://nodejs.org) and [pnpm](https://pnpm.io/installation). pnpm switches to the version this project pins.

```bash
git clone https://github.com/MAnasLatif/wa-mcp.git
cd wa-mcp
pnpm install
cp .env.example .env
```

Fill in `.env`, then check it:

```bash
pnpm build
pnpm start
```

## Commands

| Task | Command |
|---|---|
| Set up | `pnpm install` |
| Format | `pnpm format` |
| Lint and check format | `pnpm lint` |
| Type check | `pnpm typecheck` |
| Test | `pnpm test` |
| Build | `pnpm build` |
| Check the configuration | `pnpm start` |
| Full verification | `pnpm verify` |

## Contributing

Read [CONTRIBUTING.md](CONTRIBUTING.md) before you start. Report security problems privately, as described in [SECURITY.md](SECURITY.md). For help, see [SUPPORT.md](SUPPORT.md).

## License

[MIT](LICENSE)