SW

seejux/waha-whatsapp-mcp

开发工具

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

11 stars 3 forks 质量 61 趋势 18

A Model Context Protocol (MCP) server that enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform.

概览

A Model Context Protocol (MCP) server that enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform. - : Get overview of recent WhatsApp chats - : Retrieve, send, and mark messages as read - : Access WhatsApp data as context-aware resources with caching - : Full compatibility with MCP clients (stdio transport) 1. Clone this repository 2. Install dependencies: 3. Configure your WAHA API connection: Then edit .env with your WAHA instance details. - WAHA_BASE_URL: Your WAHA server URL (e.g., http://localhost:3000) - WAHA_API_KEY: Your WAHA API key for authentication - WAHA_SESSION: WhatsApp session name (default: default) The MCP Inspector is a web-based tool to test your MCP server interactively: This will: 1. Start the WAHA MCP server 2. Launch the MCP Inspector web UI 3. Open your browser automatically Use the inspector to: - Test all tools interactively - View tool schemas - See request/response data - Debug tool calls

README

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

WAHA MCP Server

A Model Context Protocol (MCP) server that enables AI assistants to interact with WhatsApp through the WAHA (WhatsApp HTTP API) platform.

Features

  • Chat Management: Get overview of recent WhatsApp chats
  • Message Operations: Retrieve, send, and mark messages as read
  • MCP Resources: Access WhatsApp data as context-aware resources with caching
  • MCP Integration: Full compatibility with MCP clients (stdio transport)

Installation

  1. Clone this repository

  2. Install dependencies:

    npm install
    
  3. Configure your WAHA API connection:

    cp .env.example .env
    

    Then edit .env with your WAHA instance details.

Configuration

Required environment variables in .env:

  • WAHA_BASE_URL: Your WAHA server URL (e.g., http://localhost:3000)
  • WAHA_API_KEY: Your WAHA API key for authentication
  • WAHA_SESSION: WhatsApp session name (default: default)

Development

Build the project

npm run build

Run in development mode with auto-reload

npm run dev

Test with MCP Inspector

The MCP Inspector is a web-based tool to test your MCP server interactively:

npm run inspector

This will:

  1. Start the WAHA MCP server
  2. Launch the MCP Inspector web UI
  3. Open your browser automatically

Use the inspector to:

  • Test all tools interactively
  • View tool schemas
  • See request/response data
  • Debug tool calls

Run in production

npm start

Usage with Claude Desktop

Add this to your Claude Desktop MCP configuration:

Windows:

{
  "mcpServers": {
    "waha": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\path\\to\\waha\\dist\\index.js"],
      "env": {
        "WAHA_BASE_URL": "http://localhost:3000",
        "WAHA_API_KEY": "your-api-key-here",
        "WAHA_SESSION": "default"
      }
    }
  }
}

Mac/Linux:

{
  "mcpServers": {
    "waha": {
      "command": "node",
      "args": ["/absolute/path/to/waha-mcp-server/dist/index.js"],
      "env": {
        "WAHA_BASE_URL": "http://localhost:3000",
        "WAHA_API_KEY": "your-api-key-here",
        "WAHA_SESSION": "default"
      }
    }
  }
}

Note: Windows users should use double backslashes (\\) in paths.

Available Tools

Chat Management

Tool Description
waha_get_chats Get overview of recent WhatsApp chats
waha_get_messages Get messages from a specific chat
waha_mark_chat_read Mark messages in a chat as read
waha_mark_chat_unread Mark a chat as unread
waha_clear_chat_messages Clear all messages from a chat (destructive)
waha_delete_chat Delete a chat completely (destructive)
waha_archive_chat Archive a chat
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "waha": { "command": "node", "args": ["C:\\Users\\YourUsername\\path\\to\\waha\\dist\\index.js"], "env": { "WAHA_BASE_URL": "http://localhost:3000", "WAHA_API_KEY": "your-api-key-here", "WAHA_SESSION": "default" } } } }