SM

sealjay/mcp-whatsapp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

15 stars 23 forks 质量 82 趋势 35MIT

Single-binary Go MCP server that wraps whatsmeow to expose a personal WhatsApp account as 42 MCP tools (messaging, groups, polls, media, privacy).

概览

A single-binary Go MCP server that wraps whatsmeow to expose a personal WhatsApp account to LLMs. whatsapp-mcp serve runs as a lightweight HTTP daemon on 127.0.0.1:8765; MCP clients (Claude Desktop, Cursor, Claude Code, etc.) connect to it via HTTP — no process spawning, no stdin/stdout juggling. Messages are cached in local SQLite and only travel to the model when the agent calls a tool. This is an independent open-source project. It is not affiliated with, endorsed by, or otherwise associated with Meta Platforms, Inc., WhatsApp, or whatsmeow. "WhatsApp" is a trademark of Meta Platforms, Inc., used here nominatively to describe interoperability. This started as a fork of lharries/whatsapp-mcp and has since been rewritten as a single Go binary. What it adds over the original: - — normalises @lid JIDs to real phone numbers for accurate contact matching. - — outgoing messages are persisted locally so conversation history stays complete.

README

以下为原文 README 节选,完整内容请查看原文。

WhatsApp MCP Server

A single-binary Go MCP server that wraps whatsmeow to expose a personal WhatsApp account to LLMs. whatsapp-mcp serve runs as a lightweight HTTP daemon on 127.0.0.1:8765; MCP clients (Claude Desktop, Cursor, Claude Code, etc.) connect to it via HTTP — no process spawning, no stdin/stdout juggling. Messages are cached in local SQLite and only travel to the model when the agent calls a tool.

Unaffiliated. This is an independent open-source project. It is not affiliated with, endorsed by, or otherwise associated with Meta Platforms, Inc., WhatsApp, or whatsmeow. “WhatsApp” is a trademark of Meta Platforms, Inc., used here nominatively to describe interoperability.

This started as a fork of lharries/whatsapp-mcp and has since been rewritten as a single Go binary. What it adds over the original:

  • LID resolution — normalises @lid JIDs to real phone numbers for accurate contact matching.
  • Sent-message storage — outgoing messages are persisted locally so conversation history stays complete.
  • Disappearing-message timers — outgoing messages inherit the group chat’s ephemeral timer automatically.
  • Targeted history sync — on-demand per-chat backfill via the request_sync tool.
  • Extended tool surface — 42 tools (see below): reactions, replies, edits, revoke, mark-read, typing, is-on-whatsapp, full group admin, blocklist, polls (create + vote + tally), contact cards, view-once flag, presence, privacy settings, and the profile “About” text.
  • Single-instance enforcement — a flock(2) on store/.lock prevents two serve processes racing on the same SQLite files.

Setup

Prerequisites

  • Go 1.26+ (build-time only; runtime needs just the compiled binary).
在 GitHub 查看完整 README

安装

npx -y mcp-remote http://127.0.0.1:8765/mcp
新手?先看 mcpskill.org 教程 →

配置

// Claude Code (.claude/mcp.json or ~/.claude/mcp.json) and Cursor (~/.cursor/mcp.json) { "mcpServers": { "whatsapp": { "type": "http", "url": "http://127.0.0.1:8765/mcp" } } } // Claude Desktop only launches stdio servers, so bridge with mcp-remote // (~/Library/Application Support/Claude/claude_desktop_config.json) { "mcpServers": { "whatsapp": { "command": "npx", "args": ["-y", "mcp-remote", "http://127.0.0.1:8765/mcp"] } } }