Build with AI agents
Two ways to make Claude Code, Cursor, Windsurf, and Claude Desktop send WhatsApp messages: point them at our markdown docs, or install the Chatmaid MCP server.
There are two ways to give an AI agent the ability to send WhatsApp through Chatmaid. Pick whichever fits your tooling — they're complementary.
1. Point your agent at the docs (recommended start)
Every agent that can read a URL can use Chatmaid in seconds. We publish the entire developer site as plain markdown following the llms.txt standard, so you don't have to copy-paste examples.
curl https://developers.chatmaid.net/llms-full.txtThe complete concatenated documentation in one file. Pipe it into your agent's context, attach it to a Claude Project, or stream it via stdin. This is what most agents need.
curl https://developers.chatmaid.net/llms.txtA lightweight index linking to every page's markdown source. Ideal for agents that fetch selectively rather than loading everything at once.
curl https://developers.chatmaid.net/raw-docs/getting-startedPrefix any docs slug with /raw-docs/ to get the raw markdown source for that page.
Why this works
Chatmaid's REST API is small and orthogonal — eight endpoints under /v1. Once an
agent has the docs, it can compose any flow you describe in natural language.
Example prompt
"Read https://developers.chatmaid.net/llms-full.txt, then send a WhatsApp from my business number to +14155551234 saying the order shipped. Use my key in
CHATMAID_API_KEY."
2. Install the Chatmaid MCP server
If you'd rather give the agent first-class tool calls (structured arguments, autocomplete in some clients, no parsing of curl output), install the MCP server. It's a thin wrapper around the same REST API.
What is MCP?
MCP is the open standard Anthropic introduced for AI agents to call external tools. It's supported by Claude Code, Claude Desktop, Cursor, Windsurf, Zed, and many other clients.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"chatmaid": {
"command": "npx",
"args": ["-y", "@chatmaid/mcp"],
"env": {
"CHATMAID_API_KEY": "sk_test_xxx_or_sk_live_xxx"
}
}
}
}Restart Claude Desktop. You should see "chatmaid" in the connected-MCP list.
Cursor
Edit ~/.cursor/mcp.json (create the file if missing):
{
"mcpServers": {
"chatmaid": {
"command": "npx",
"args": ["-y", "@chatmaid/mcp"],
"env": { "CHATMAID_API_KEY": "sk_test_xxx_or_sk_live_xxx" }
}
}
}Claude Code
From any terminal inside your project:
claude mcp add chatmaid \
--env CHATMAID_API_KEY=sk_test_xxx \
-- npx -y @chatmaid/mcpWindsurf, Zed, other clients
Any MCP-compatible client can use the same npx -y @chatmaid/mcp command. Set CHATMAID_API_KEY in the client's environment configuration.
Available tools
Once connected, the agent can call these tools automatically:
| Tool | What it does |
|---|---|
send_message | Send a WhatsApp message — fromPhoneId (discovered via list_phone_numbers), to in E.164, plus content and/or mediaUrls, optional idempotencyKey. |
list_messages | List recent messages with optional status / phoneNumberId filter and page / limit pagination. |
get_message | Fetch a single message and its final delivery status. |
list_phone_numbers | Show all phone numbers registered to the current account. |
get_phone_number | Get details for one phone number (accepts internal ID or E.164). |
get_phone_status | Check whether a phone number is currently connected to WhatsApp (accepts internal ID or E.164). |
get_account | Account profile (accountId, name, email, subscription status). |
get_usage | Usage stats for period = day | week | month (defaults to month). |
The MCP server is open-source at github.com/chatmaid/mcp. PRs welcome.
Get an API key
- Sign in at developers.chatmaid.net/dashboard.
- Go to API Keys and generate a
sk_test_*key. - Paste it into your agent's environment.
Start in sandbox
While an agent is learning, use a sk_test_* key. Messages sent with test
keys run through Chatmaid's sandbox — nothing reaches real WhatsApp numbers.
Promote to sk_live_* only after you've confirmed behavior.
Why the API is agent-friendly
Chatmaid's HTTP surface is built for autonomous use, regardless of which approach above you pick:
- Idempotency keys — safe retries after a timeout or tool-call interruption.
- Structured error envelopes — errors return a consistent
{ success, error, message[], statusCode }shape, so agents know whether to retry, swap inputs, or escalate. - Sandbox keys —
sk_test_*simulates the full delivery lifecycle without touching WhatsApp. - Predictable status lifecycle — messages go
pending → sent | failed, so an agent can poll confidently.
See the API Reference for the full contract and the Cookbook for end-to-end agent integration patterns.