mcp-whatsapp-business-api

mcp-whatsapp-business-api

3.2

If you are the rightful owner of mcp-whatsapp-business-api and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A production-ready Node.js Model Context Protocol (MCP) server that provides seamless integration between Claude and the WhatsApp Business Cloud API.

WhatsApp Business API MCP Integration

A production-ready Node.js Model Context Protocol (MCP) server that provides seamless integration between Claude and the WhatsApp Business Cloud API.

Features

๐Ÿข Business Profile Management

  • View and update business profile information
  • Browse profile details via whatsapp://business_profile

๐Ÿ“ฑ Phone Number Management

  • List all registered phone numbers
  • Get detailed phone number information
  • Browse phone numbers via whatsapp://phone_numbers
  • Request verification codes

๐Ÿ’ฌ Messaging

  • Send text, template, and media messages
  • List and browse message templates via whatsapp://templates
  • Mark messages as read
  • Support for images, audio, documents, video, and stickers

๐Ÿ” Registration & Verification

  • Register and deregister phone numbers
  • Phone number verification
  • Two-step verification management
  • Check registration status

๐Ÿ“Š Analytics & Monitoring

  • Real-time WhatsApp event streaming
  • Message delivery analytics
  • Conversation cost tracking
  • Template performance metrics
  • Browse analytics via whatsapp://analytics/*

๐Ÿ—„๏ธ Database Integration (Optional)

  • PostgreSQL support for data persistence
  • Browse database tables and schemas via resources

๐Ÿ› ๏ธ Developer Experience

  • Dual transport modes: STDIO (for Claude Desktop) and SSE (for web clients)
  • Real-time webhook processing and event broadcasting
  • Comprehensive error handling with detailed WhatsApp API error information
  • Pre-built prompts for common tasks
  • TypeScript with strict type checking
  • Docker containerization
  • CI/CD pipeline with GitHub Actions

Quick Start

  1. Clone and install:

    git clone https://github.com/prakashwagle/mcp-whatsapp-business-api.git
    cd mcp-whatsapp-business-api
    npm install
    
  2. Configure environment:

    cp .env.example .env
    # Edit .env with your WhatsApp API credentials
    
  3. Start development server:

    npm run dev
    
  4. Integrate with Claude:

    npm run build
    npm install -g .
    claude --mcp="mcp-whatsapp-business-api"
    

๐Ÿ“– Complete Setup Guide

For detailed setup instructions including:

  • WhatsApp Business API credential setup
  • Production deployment options
  • Security best practices
  • MCP integration with Claude Desktop
  • Troubleshooting guide

๐Ÿ‘‰

Architecture

Tools vs Resources

This project follows the optimal MCP pattern:

  • ๐Ÿ”ง Tools - For parameterized operations and real-time actions

    • whatsapp_send_text_message
    • whatsapp_get_phone_numbers
    • whatsapp_update_business_profile
  • ๐Ÿ“‹ Resources - For browsable data discovery

    • whatsapp://business_profile
    • whatsapp://phone_numbers
    • whatsapp://templates

Built-in Prompts

  • help_with_business_profile - Business profile management guidance
  • help_with_messaging - Text, template, and media messaging help
  • help_with_registration - Phone registration and verification
  • help_with_two_step_verification - Security setup guidance
  • help_with_whatsapp_api - General API capabilities overview

Development

# Development server
npm run dev

# Build
npm run build

# Lint and format
npm run lint
npm run format

# Production server
npm start

Production Deployment

Multiple deployment options supported:

  • AWS SSM Parameter Store (Recommended)
  • Docker with environment variables
  • Docker Swarm secrets
  • AWS Secrets Manager

See for detailed deployment instructions.

Requirements

  • Node.js 18+
  • WhatsApp Business API account
  • Facebook/Meta developer account
  • Registered phone number for WhatsApp Business

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting: npm test && npm run lint
  5. Submit a pull request

License

MIT License - see for details.

Support