Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

An async Rust library, CLI and local HTTP API for the WhatsApp Web multi-device protocol.

112
21
Rust
MPL-2.0
new today
+112 stars in 15h

What it does

WhatsRust implements the WhatsApp Web multi-device protocol in async Rust, porting WhatsMeow workflows and bundling all 60 reference protobuf schemas. The workspace separates the protocol engine and transports from a SQLite session store, and exposes three interfaces: a CLI for linking a device and moving messages, a local HTTP API with SSE events, and a Rust library with typed protocol events. Calling the protocol directly from your own Rust code is the main use case; the CLI and HTTP server are thin wrappers on top of it.

Coverage spans sessions, groups, media, presence, business accounts, history and newsletters, with the supported client methods tracked in a method-by-method coverage list.

Quick start

You need Rust stable 1.95+, Cargo, and a native toolchain for building SQLite (on Windows MSVC, Visual Studio Build Tools with the C++ workload and a Windows SDK). You also need a WhatsApp account on a phone for the initial link.

From the directory containing Cargo.toml, start the listener:

cargo run --locked -- listen

Open WhatsApp on the phone, choose Linked devices → Link a device, and scan the QR code shown in the terminal. Incoming messages then print as JSON Lines on stdout. Ctrl+C disconnects, and the next run reuses .whatsrust/session.db.

If you cannot scan, pair by phone number instead and enter the code shown in the terminal in the Linked devices screen:

cargo run --locked -- listen --pair-phone +628123456789

After linking, send a message with a session that no listener or server is currently using:

cargo run --locked -- send --to +628123456789 --text "Hello from WhatsRust"

The command prints the message ID and recipient as JSON and then disconnects. An optional ping test replies pong when you send ping in your Message Yourself chat.

HTTP API and library

Set WHATSRUST_API_TOKEN and run cargo run --locked -- serve. The server binds to 127.0.0.1:8765 by default, and --port changes it; requests to /v1/ endpoints carry Authorization: Bearer <token>. The endpoints cover /healthz, session status, sending text, and an SSE event stream. Token setup and request examples are in the HTTP guide.

For library use, add whatsrust with default-features = false to skip CLI and server dependencies. Session::open creates or restores a session, Session::run_until drives the connection, and Client::subscribe delivers message summaries. Native protocol types live under whatsrust::protocol, and the original schemas under whatsrust::proto; the library guide has examples.

Constraints

  • The session database stores linked-device credentials, so keep it private and run only one WhatsRust process per database. If the link is revoked, start from a fresh database and pair again.
  • Sending requires a linked session with no listener or server holding the same database open.
  • Server linking needs an interactive terminal; HTTP API requests are authenticated with the bearer token and bound to localhost unless you configure otherwise.
  • The application is MPL-2.0; the imported protocol engine and supporting crates keep their MIT license.

HotRepo's take

WhatsRust entered the new-project list on 2026-12-02 with 112 stars and 21 forks, all recorded inside a single roughly 14-hour growth window that began at repository creation. There is no GitHub daily rank and no discussion traffic attached, so this is one burst of early attention rather than a sustained curve. The project's substance rests on its stated lineage: the protocol behavior and protobuf reference come from WhatsMeow, and engine code is incorporated from whatsapp-rust since release 0.7.0, which means much of the protocol work is ported rather than written from scratch, and that origin is worth checking when weighing maturity. For Rust developers who want a strongly typed WhatsApp client without leaving Rust, the library and CLI split keeps the dependency footprint optional; the documented coverage list is the practical measure of what still needs work.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. lharries/whatsapp-mcpLets an LLM agent search, read, and send WhatsApp messages from your own account, locally.Go6,710
  2. tulir/whatsmeowA Go library that lets developers build WhatsApp messaging into their own apps via the web multidevice API.Go7,687
  3. aldinokemal/go-whatsapp-web-multideviceSelf-hosted WhatsApp REST API server in Go with multip-device support, webhooks, MCP tools and a web dashboard.Go5,047
  4. crmne/zapfastA native desktop WhatsApp client for Linux, macOS and Windows that skips the browser engine.Rust2,291
  5. finereli/whatsapp-mcpRead-only MCP server that lets an AI agent search and read your own WhatsApp history.TypeScript391