Prerequisites Before you begin, create an account and get your API Key.

Getting started

Connect to WhatsApp to send messages and manage conversations through the WhatsApp Business API via AI agents.
1

Install the SDKs (optional)

pip install klavis
2

Create a server instance

from klavis import Klavis
from klavis.types import McpServerName

klavis_client = Klavis(api_key="YOUR_API_KEY")

# Create a WhatsApp MCP server instance
whatsapp_server = klavis_client.mcp_server.create_server_instance(
    server_name=McpServerName.WHATSAPP,
    user_id="user123"
)
Response Information: The API returns:
  • serverUrl: The URL for connecting your MCP client to WhatsApp
  • instanceId: Unique identifier for your server instance
3

Configure API Key

# Set the WhatsApp API key for your instance
response = klavis_client.mcp_server.set_instance_auth(
    instance_id=whatsapp_server.instance_id,
    auth_data={
        "token": "YOUR_WHATSAPP_API_KEY"
    }
)
🎉 Your WhatsApp MCP Server is ready! You can now use your MCP server URL with any MCP-compatible client.

Available Tools

Tool NameDescription
whatsapp_send_textSend a text message to a WhatsApp user using the WhatsApp Business API.
For more details about tool input schema, use the get_tools API.

Next Steps