MCP ExplorerExplorer

Wa Mcp

@operation-hpon a year ago
1 Apache-2.0
FreeCommunity
AI Systems
#mcp-client
MCP client for Whatsapp

Overview

What is Wa Mcp

WA-MCP is a client for WhatsApp that allows users to start an MCP server and interact through chat messages. It utilizes the whatsapp-web.js library for its functionality.

Use cases

Use cases for WA-MCP include creating automated responses for customer inquiries, integrating with third-party services like Spotify, and developing interactive chatbots that can perform specific tasks.

How to use

To use WA-MCP, first clone the repository, configure your WhatsApp client, install the necessary dependencies, and build the project. You can then configure the MCP servers in the mcp-server.conf file and start the client using npm start.

Key features

Key features of WA-MCP include integration with WhatsApp for messaging, support for multiple MCP servers, and the ability to run scripts in various programming languages like Python and Node.js.

Where to use

WA-MCP can be used in various fields such as customer support automation, chatbot development, and integration of external APIs with WhatsApp for enhanced user interaction.

Content

MCP-WhatsApp Client

This project lets you start an MCP server from WhatsApp and interact via chat messages. It builds on whatsapp-web.js — follow its installation guide first.

Prerequisites

  • Node.js v18 or higher (node -v)
  • Follow whatsapp-web.js to get a whatsapp web client ready to use
  • npm (with Node.js; verify with npm -v)
  • OpenAI or Anthropic API key exported as environment variable:
    export ANTHROPIC_API_KEY=sk-...
    
  • Git (for cloning the repo)

Installation

  1. Clone the repository

    git clone [https://github.com/<you>/mcp-whatsapp.git](https://github.com/operation-hp/WA-MCP.git) 
    cd WA-MCP
    
  2. Edit the whatsapp-client.ts and add your phone number

    const pairingCode = await this.whatsapp.requestPairingCode('+1234567890'); // enter the target phone number
    
  3. Install dependencies

    nvm use 20 
    npm install
    
  4. Build the project

    npm run build
    

Everything, including the compatible Chromium bundle for Puppeteer, will be downloaded automatically.

Configure MCP servers

Edit mcp-server.conf in the project /build directory. This config file is same as Claude Desktop:

{
  "mcpServers": {
    "python-bot": {
      "command": "python",
      "args": [
        "my_mcp_script.py"
      ],
      "env": {
        "TOKEN": "123"
      },
      "cwd": "./bots"
    },
    "node-demo": {
      "command": "node",
      "args": [
        "--max-old-space-size=256",
        "demo.js"
      ]
    }
  }
}

one example can be found at https://github.com/operation-hp/spotify-mcp-wa ( which supports Oauth and let you login to Spotify)

Running the bridge

Start the client:

npm start

Troubleshooting

  • TimeoutError:
    If Puppeteer fails to launch Chromium, ensure you haven’t modified src/lib/whatsapp-client.ts launch options.

  • ENOENT mcp-server.conf:
    Keep the file next to build/index.js or update the configPath constant.

  • QR not shown:
    Delete the session cache directory and restart:

    rm -rf .wwebjs_auth
    

Updating

git pull
npm install
npm run build

Enjoy chatting with your MCP servers directly from WhatsApp!

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers