Skip to main content
Skip to article

#Connect WhatsApp to Claude and ChatGPT with MCP Server

What If Your AI Assistant Could Send WhatsApp Messages?

Imagine telling Claude: "Send a WhatsApp message to my last 10 leads asking if they're still interested." And it just does it. No switching tabs, no API calls, no copy-pasting phone numbers.

That's what MCP (Model Context Protocol) enables. MCP is Anthropic's open standard for connecting AI models to external tools and data sources. Instead of the AI just generating text, it can call real tools — query databases, send messages, check analytics, manage campaigns.

MoltFlow ships a production-ready MCP server with 26 tools that give your AI assistant full control over WhatsApp automation. Sessions, messaging, groups, leads, outreach campaigns, usage tracking, and delivery analytics — all accessible through natural language.

Here's how to set it up.

What Is MCP (30-Second Version)

MCP is a protocol that lets AI clients (like Claude Desktop) talk to tool servers. Think of it like USB for AI — a standard interface that any AI client can use to connect to any tool server.

The architecture is simple:

text
AI Client (Claude Desktop, Claude Code, etc.)
    ↓ MCP Streamable HTTP protocol
MoltFlow MCP Endpoint (apiv2.waiflow.app/mcp)
    ↓ Internal API calls
MoltFlow API
    ↓ WAHA protocol
WhatsApp

The AI client connects to MoltFlow's native MCP endpoint over HTTP, discovers available tools, shows them to the model, and the model decides when to call them based on your prompts. You never write API calls — you just ask for what you want in plain English.

Available Tools (25 Total)

MoltFlow's MCP server exposes 26 tools across 7 categories:

Sessions (5 tools)

  • moltflow_list_sessions — List all connected WhatsApp accounts
  • moltflow_get_session — Get details for a specific session
  • moltflow_create_session — Create a new WhatsApp session
  • moltflow_start_session — Start a stopped session
  • moltflow_get_qr_code — Get QR code for phone pairing

Messages (3 tools)

  • moltflow_send_message — Send a WhatsApp message (text, to any chat ID)
  • moltflow_list_chats — List recent conversations
  • moltflow_get_chat_messages — Read message history for a chat

Groups (7 tools)

  • moltflow_list_monitored_groups — List groups you're tracking for leads
  • moltflow_list_available_groups — List all WhatsApp groups your session belongs to
  • moltflow_add_monitored_group — Start monitoring a group for keywords
  • moltflow_get_group_messages — Get messages from a monitored group with AI analysis (intent, lead score, confidence)
  • moltflow_list_custom_groups — List your custom contact groups
  • moltflow_create_custom_group — Create a new custom group for targeting
  • moltflow_add_custom_group_members — Add contacts to a custom group

Leads (2 tools)

  • moltflow_list_leads — List captured leads with filtering
  • moltflow_update_lead_status — Update a lead's qualification status

Outreach (4 tools)

  • moltflow_create_bulk_send — Launch a bulk messaging campaign
  • moltflow_list_bulk_sends — List all campaigns
  • moltflow_get_bulk_send_status — Check campaign progress and delivery stats
  • moltflow_create_schedule — Schedule a message for future delivery

Usage (2 tools)

  • moltflow_get_current_usage — Check message usage against plan limits
  • moltflow_get_plan_limits — View your plan's feature limits

Analytics (3 tools)

  • moltflow_get_campaign_analytics — Get delivery and engagement metrics for campaigns
  • moltflow_get_contact_engagement — See engagement stats for a specific contact
  • moltflow_get_contact_history — Pull full interaction history for a contact

Every tool includes input validation, structured error handling, and response formatting in either Markdown or JSON.

Setup: Claude Desktop

Claude Desktop has native MCP support. MoltFlow provides a hosted MCP endpoint with OAuth 2.1 -- no npm packages to install, no local servers to run, no API key to manage.

Step 1: Configure Claude Desktop

Open Claude Desktop settings and add the MCP server configuration. On macOS, edit ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, edit %APPDATA%\Claude\claude_desktop_config.json.

json
{
  "mcpServers": {
    "moltflow": {
      "url": "https://apiv2.waiflow.app/mcp"
    }
  }
}

That's it -- just the URL. No API key needed.

Step 2: Restart and Connect

After saving the config, restart Claude Desktop. Claude will prompt you to sign in via your browser. Sign in (or create a free account), approve the connection, and you're done. The MoltFlow tools appear in the tools menu (the hammer icon).

You can now ask Claude things like "List my WhatsApp sessions" or "Send a message to +1234567890 saying hello" and it will use the MoltFlow tools automatically.

Setup: Claude Code (CLI)

If you use Claude Code (Anthropic's CLI tool), add MoltFlow with a single command:

bash
claude mcp add moltflow --transport http --url https://apiv2.waiflow.app/mcp

No API key needed -- OAuth handles authentication via browser sign-in on first use. This registers the MoltFlow MCP endpoint globally. All 26 tools are immediately available in every Claude Code session.

Setup: Any MCP-Compatible Client

Any client that supports MCP Streamable HTTP can connect to MoltFlow's hosted endpoint:

  • Endpoint: https://apiv2.waiflow.app/mcp
  • Protocol: MCP Streamable HTTP
  • Auth: OAuth 2.1 with PKCE (automatic) or X-API-Key header (manual)
  • OAuth Discovery: https://apiv2.waiflow.app/.well-known/oauth-authorization-server

No local servers, no npm packages, no Node.js required. The endpoint handles CORS, rate limiting (120 requests/minute per key), and HTTPS automatically. OAuth-capable clients just need the URL.

For detailed setup instructions, visit the MCP setup page in your dashboard.

Example Prompts and Workflows

Here are real prompts you can use once MoltFlow's MCP server is connected. These aren't hypothetical — they work today.

Check Your WhatsApp Status

"Show me all my WhatsApp sessions and their connection status."

Claude will call moltflow_list_sessions and display a formatted table of your sessions with their status (working, stopped, qr_code, etc.).

Send a Quick Message

"Send a WhatsApp message to 16505551234 on my 'main-account' session saying: Hey, just following up on our conversation yesterday. Do you still need the pricing doc?"

Claude calls moltflow_send_message with the session ID, chat ID ([email protected]), and your message text. All anti-spam safeguards (typing simulation, rate limiting) are applied server-side.

Review Your Leads

"Show me all leads captured this week, sorted by score. Which ones should I follow up with?"

Claude calls moltflow_list_leads, gets the results, and gives you a prioritized analysis based on the lead data. You get AI-powered lead prioritization for free.

Launch a Campaign

"Create a bulk send to my 'warm-leads' custom group. The message should say: Hi! We're running a 20% discount this week on all plans. Reply YES if you want the details. Schedule it for tomorrow at 9 AM EST."

Claude calls moltflow_create_bulk_send with the custom group ID, message text, and scheduled time. The campaign will execute with all anti-spam delays automatically applied.

Check Campaign Performance

"How did my last bulk send perform? Show me delivery rate, read rate, and any failures."

Claude calls moltflow_get_bulk_send_status and moltflow_get_campaign_analytics to pull delivery metrics, then summarizes the results with actionable insights.

Monitor Usage

"Am I close to hitting my plan limits this month?"

Claude calls moltflow_get_current_usage and moltflow_get_plan_limits, then tells you exactly where you stand — messages sent vs. limit, sessions used, and whether you need to upgrade.

Building Automations with MCP

The real power comes from chaining tools together. Here's an example workflow you could trigger with a single prompt:

"Check my leads from the last 3 days. For any lead scored 7 or above that I haven't contacted yet, send them a personalized follow-up message on my 'sales' session."

Claude will:

  1. Call moltflow_list_leads to get recent leads
  2. Filter for score >= 7
  3. Call moltflow_get_contact_history for each to check if you've already reached out
  4. Call moltflow_send_message for each uncontacted lead with a contextual message
  5. Report back what it did

That's a lead follow-up workflow that would normally require a CRM integration, custom code, and a scheduler. With MCP, it's one prompt.

Security Notes

A few important things about using the MCP endpoint:

  • OAuth is recommended — OAuth 2.1 with PKCE handles authentication automatically. No keys to manage, rotate, or accidentally leak.
  • API key scopes matter — If using manual API keys, generate keys with only the scopes you need. Don't use a full-access key if you only need read access. MoltFlow returns 403 with an X-Required-Scopes header if a scope is missing.
  • Keep keys out of version control — If using API keys, never commit them to git. Use environment variables or a secrets manager.
  • Rate limiting is server-side — The MCP endpoint enforces 120 requests/minute per API key. The underlying MoltFlow API has its own rate limits too. You can't bypass anti-spam safeguards through MCP.
  • Prompt injection protection — MoltFlow's MCP endpoint wraps all user-generated content (message text, contact names) in [user_data] boundaries and defangs tool name references. This prevents prompt injection attacks where malicious WhatsApp messages could trick the AI into calling unintended tools.

Troubleshooting

"401 Unauthorized" — If using OAuth, remove and re-add the MoltFlow server to re-authenticate. If using an API key, verify it's still active at Sessions > API Keys in the dashboard.

"403 Forbidden" — Your API key does not have the required scopes for the tool you are trying to use. Check the X-Required-Scopes response header to see what is needed, then generate a new key with the correct scopes.

"Rate limit exceeded" — You're hitting the 120 req/min limit on the MCP endpoint. This usually happens when asking Claude to process large batches. Break your request into smaller chunks.

Messages not sending — The most common cause is the reciprocity rule. MoltFlow only allows sending to contacts who messaged you within the last 24 hours. Check with moltflow_get_chat_messages to verify the contact has recent inbound messages.

What's Next

MoltFlow's MCP server turns your AI assistant into a WhatsApp automation operator. Instead of switching between dashboards and terminals, you stay in one conversation and let the AI handle the API calls.

Start with the basics — list sessions, send a test message, check your usage. Once you're comfortable, build more complex workflows by chaining tools together.

Useful resources:

Get started in 5 minutes. Sign up for free, generate an API key, and visit the MCP setup page for connection instructions.

> Try MoltFlow Free — 100 messages/month

$ curl https://molt.waiflow.app/pricing

bash-5.2$ echo "End of post."_