DEV Community

WAzion
WAzion

Posted on • Originally published at developers.wazion.com

How to Manage WhatsApp Business with AI Using WAzion MCP Server

If you've been using Claude, Cursor, or any other MCP-compatible AI assistant, you already know how powerful it is to give your AI tools access to real systems. Today I'll show you how to connect your WhatsApp Business account to your AI assistant in under two minutes using WAzion's MCP server — and what you can actually do once it's connected.


1. What is MCP and Why It Matters

The Model Context Protocol (MCP) is an open standard that lets AI assistants call external tools over a structured interface. Instead of copying and pasting data in and out of chat windows, your AI can directly query APIs, read databases, and take actions — with you staying in control.

Think of it as giving Claude or Cursor a set of function calls it can use autonomously when you ask it to do something. The AI decides which tools to use and in what order. You see the result.

MCP supports two transports:

  • stdio — the AI client spawns a local process
  • Streamable HTTP — the AI client connects to a remote HTTP endpoint directly (no local install)

WAzion uses Streamable HTTP, which means most clients can connect with a single URL and an API key. No npm install, no local server.


2. What WAzion Does

WAzion is a WhatsApp Business SaaS platform. It connects to WhatsApp Business via the official API, and sits on top of it with:

  • An AI copilot that helps agents reply, summarize, and tag conversations
  • Workflow automation (triggers, conditions, AI replies, scheduled messages)
  • Mass marketing campaigns with contact lists
  • CRM — customer notes, tags, tasks, calendar
  • Shopify integration
  • Knowledge base (upload PDFs/documents for AI-powered answers)
  • Multi-agent management with permissions

The MCP server exposes 244 tools across 24 categories. These are not toy examples — they're the actual production API powering real stores.


3. Setup in 2 Minutes

Step 1: Get your API key

  1. Sign up at wazion.com
  2. Connect your WhatsApp number by scanning the QR code
  3. Go to Settings > Developer and copy your API key

Step 2: Connect your AI client

Claude Code (recommended — one-liner):

claude mcp add --transport http wazion https://www.wazion.com/api/mcp/ \
  --header "Authorization: Bearer YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "wazion": {
      "type": "url",
      "url": "https://www.wazion.com/api/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor — add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "wazion": {
      "type": "url",
      "url": "https://www.wazion.com/api/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

stdio-only clients (Windsurf, older clients):

WAZION_API_KEY=your_key npx -y wazion-mcp-server
Enter fullscreen mode Exit fullscreen mode

Or in config:

{
  "mcpServers": {
    "wazion": {
      "command": "npx",
      "args": ["-y", "wazion-mcp-server"],
      "env": {
        "WAZION_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

That's it. Restart your client and the tools are available.


4. Five Things You Can Do Right Now

1. Send a WhatsApp message

Ask Claude:

"Send a WhatsApp to +34612345678 saying: Your order has been shipped and is on its way!"

Claude will call send_whatsapp_message with the right parameters and report back whether it succeeded.

2. Create an automation workflow

"Create a workflow that auto-replies with AI when a customer messages outside business hours (9 PM to 9 AM)"

Claude will use the automation tools to create a workflow with a time-based condition and an AI reply action.

3. Analyze conversation sentiment

"Analyze the last 10 conversations and give me a sentiment summary. Any customers showing purchase intent that we haven't followed up with?"

Claude will use get_conversation_list, analyze_sentiment, and get_smart_followup_status to give you an actual answer.

4. Run a mass marketing campaign

"Start a campaign to my VIP contact list with the message: Exclusive weekend deal — 20% off everything. Use session 2."

Claude will look up your lists, verify the session, and launch the campaign.

5. Pull weekly activity stats

"Give me this week's stats: messages sent and received, average response time, top agents by volume"

Claude pulls from get_weekly_summary and get_agent_performance and formats it for you.


5. Code Examples

Python — send a message

import os
import requests

def call_tool(token: str, tool_name: str, arguments: dict) -> dict:
    response = requests.post(
        "https://www.wazion.com/api/mcp/",
        headers={
            "Content-Type": "application/json",
            "Authorization": f"Bearer {token}",
        },
        json={
            "jsonrpc": "2.0",
            "method": "tools/call",
            "params": {
                "name": tool_name,
                "arguments": arguments,
            },
            "id": 1,
        },
        timeout=60,
    )
    response.raise_for_status()
    return response.json()

token = os.environ["WAZION_API_KEY"]

result = call_tool(token, "send_whatsapp_message", {
    "phone": "+34612345678",
    "message": "Hello from Python!",
    "session_id": 1,
})

print(result["result"]["content"][0]["text"])
Enter fullscreen mode Exit fullscreen mode

Python — list available tools

response = requests.post(
    "https://www.wazion.com/api/mcp/",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {token}",
    },
    json={
        "jsonrpc": "2.0",
        "method": "tools/list",
        "params": {},
        "id": 1,
    },
    timeout=30,
)

tools = response.json()["result"]["tools"]
print(f"Available tools: {len(tools)}")
for tool in tools[:5]:
    print(f"  - {tool['name']}: {tool['description'][:60]}")
Enter fullscreen mode Exit fullscreen mode

curl — check shop status

curl -s -X POST https://www.wazion.com/api/mcp/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $WAZION_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_shop_status",
      "arguments": {}
    },
    "id": 1
  }' | python3 -m json.tool
Enter fullscreen mode Exit fullscreen mode

curl — send a WhatsApp message

curl -s -X POST https://www.wazion.com/api/mcp/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $WAZION_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "send_whatsapp_message",
      "arguments": {
        "phone": "+34612345678",
        "message": "Hello from curl!",
        "session_id": 1
      }
    },
    "id": 1
  }'
Enter fullscreen mode Exit fullscreen mode

6. A Note on Confirmations

Actions that modify or delete data use a two-step confirmation flow. The first call returns a warning. A second call with "confirm": true executes the action. Your AI client handles this automatically — you'll see a message like "This will delete the workflow 'After Hours'. Confirm?" before anything destructive happens.


Links


Questions or issues? Open an issue on GitHub or leave a comment below.

Top comments (0)