JW

jlucaso1/whatsapp-mcp-ts

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

75 stars 46 forks Качество 64 Тренд 14

jlucaso1/whatsapp-mcp-ts - кандидат на сервер MCP, импортированный из https://github.com/jlucaso1/whatsapp-mcp-ts.

Обзор

jlucaso1/whatsapp-mcp-ts - кандидат на сервер MCP, импортированный из https://github.com/jlucaso1/whatsapp-mcp-ts.

Обзор (машинный перевод)

Это сервер Model Context Protocol (MCP) для WhatsApp, построенный с помощью TypeScript и использующий библиотеку T0.

Он позволяет подключить вашу личную учетную запись WhatsApp к агенту ИИ (например, Anthropic Claude через приложение для настольных компьютеров или курсор), что позволяет ему:

  • Поиск личных сообщений WhatsApp. Поиск ваших контактов (физических лиц, а не групп).
  • Перечислите свои последние чаты.
  • Восстановите историю сообщений для конкретных чатов. Отправляйте сообщения отдельным лицам или группам.

Он подключается непосредственно к вашей учетной записи WhatsApp** с помощью API-интерфейса WhatsApp Web. Все ваши сообщения и данные аутентификации хранятся ** локально** в базе данных SQLite ./data/ и кэше аутентификации ./auth_info/. Данные отправляются подключенному агенту ИИ только тогда, когда он явно использует предоставленные инструменты MCP (которые вы контролируете через интерфейс агента).

(Необязательно: Рассмотрите возможность добавления скриншота или GIF, аналогичного приведенному здесь примеру)

Пример

Пользователь: Отправьте сообщение WhatsApp на «Meu amor» в WhatsApp с надписью «Te amo»

Помощник: Ладно, сначала мне нужно найти контакт. *Использование инструмента: whatsapp.search_contacts

Результат инструмента:

Помощник:

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

WhatsApp MCP Server (TypeScript/Baileys)

This is a Model Context Protocol (MCP) server for WhatsApp, built with TypeScript and using the @whiskeysockets/baileys library.

It allows you to connect your personal WhatsApp account to an AI agent (like Anthropic Claude via its desktop app or Cursor) enabling it to:

  • Search your personal WhatsApp messages.
  • Search your contacts (individuals, not groups).
  • List your recent chats.
  • Retrieve message history for specific chats.
  • Send messages to individuals or groups.

It connects directly to your personal WhatsApp account using the WhatsApp Web multi-device API. All your messages and authentication details are stored locally in a SQLite database (./data/) and authentication cache (./auth_info/). Data is only sent to the connected AI agent when it explicitly uses the provided MCP tools (which you control via the agent’s interface).

(Optional: Consider adding a screenshot or GIF similar to the reference example here)

Example

User: Send a whatsapp message to “Meu amor” in whatsapp saying “Te amo”


Assistant: Okay, I need to find the contact first. Using tool: whatsapp.search_contacts

{
  "query": "Meu amor"
}

Tool Result:

[
  {
    "jid": "[email protected]",
    "name": "Meu Amor"
  }
]

Assistant: Found the contact. Now sending the message. Using tool: whatsapp.send_message

{
  "recipient": "[email protected]",
  "message": "Te amo"
}

Tool Result:

Message sent successfully to [email protected] (ID: XXXXXXXXXXX).

Key Features (MCP Tools)

The server exposes the following tools to the connected AI agent:

  • search_contacts: Search for contacts by name or phone number part (JID).
  • list_messages: Retrieve message history for a specific chat, with pagination.
  • list_chats: List your chats, sortable by activity or name, filterable, paginated, optionally includes last message details.
  • get_chat: Get detailed information about a specific chat.
  • get_message_context: Retrieve messages sent immediately before and after a specific message ID for context.
  • send_message: Send a text message to a specified recipient JID (user or group).

Installation

Installing via Smithery

To install WhatsApp MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @jlucaso1/whatsapp-mcp-ts --client claude

Prerequisites

  • Node.js: Version 23.10.0 or higher (as specified in package.json). You can check your version with node -v. (Has initial typescript and sqlite builtin support)
  • npm (or yarn/pnpm): Usually comes with Node.js.
Открыть полный README на GitHub

Установка

npx -y @smithery/cli install @jlucaso1/whatsapp-mcp-ts --client claude
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "whatsapp": { "command": "node", "args": [ "{{PATH_TO_REPO}}/src/main.ts" ], "timeout": 15, // Optional: Adjust startup timeout if needed "disabled": false } } }