BatZap with Grok
Bring WhatsApp to Grok
BatZap's MCP server works with the xAI API. Grok reads your conversations, drafts replies, tags and resolves, and only sends after you approve.
MCP server URL
https://api.batzap.com/v1/mcpimport os
from openai import OpenAI
client = OpenAI(
base_url="https://api.x.ai/v1",
api_key=os.environ["XAI_API_KEY"],
)
response = client.responses.create(
model="YOUR_GROK_MODEL",
tools=[{
"type": "mcp",
"server_label": "batzap",
"server_url": "https://api.batzap.com/v1/mcp",
"headers": {"Authorization": "bzp_live_YOUR_KEY"},
}],
input="List my 10 most recent open conversations in BatZap.",
)
print(response.output_text)How to connect BatZap to Grok
Grok uses remote MCP servers through the xAI API. You pass BatZap's URL and the API key in a header.
01
Create an API key
In the BatZap dashboard, go to Settings → API Keys, create a key and pick its permissions. Only admins create keys, and the key is shown only once.
02
Add the MCP tool
In the xAI API, add a tool of type mcp with BatZap's URL and, under headers, Authorization with your key.
03
Ask Grok
Ask about your conversations in plain language. Before any send, the assistant has to show the text and the recipient and wait for your ok.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.x.ai/v1",
api_key=os.environ["XAI_API_KEY"],
)
response = client.responses.create(
model="YOUR_GROK_MODEL",
tools=[{
"type": "mcp",
"server_label": "batzap",
"server_url": "https://api.batzap.com/v1/mcp",
"headers": {"Authorization": "bzp_live_YOUR_KEY"},
}],
input="List my 10 most recent open conversations in BatZap.",
)
print(response.output_text)The key goes raw in the Authorization header, with no "Bearer". In xAI's own SDK, the parameter is called extra_headers. API documentation
What the assistant can do in BatZap
BatZap is a WhatsApp inbox for the whole team. Through the MCP server, the assistant uses that same inbox, within the permissions of its key.
- List and read conversations, messages, contacts and tags
- Reply to a customer in an existing conversation
- Start a conversation with a phone number
- Create a tag and tag a conversation
- Assign a conversation to an agent, resolve it and leave a private note
- Create a group and invite people, with the invite link as a fallback
Built so the assistant can't go on a sending spree
A WhatsApp message can't be unsent. So the server has rules the assistant can't get around.
- Every send that reaches a person needs confirmation: the assistant shows you the text and the recipient and only sends after you approve
- There is a cap on recipients per call and a send limit of 10 per minute and 300 per day, so the number isn't flagged as spam
- The assistant only sees the tools its key allows: a read only key exposes nothing that sends a message
- Connecting or disconnecting a number, reading the QR code and syncing history are not in the MCP: they stay in the dashboard
- Conversations the assistant reads are sent to the model provider. Weigh that before using it with customer data
Ask in plain language
A few requests the assistant can handle with BatZap's tools.
“List the 10 most recent open conversations in BatZap and sum up what each customer asked for.”
“Check what the customer John asked and draft a reply. Don't send it before I approve.”
“Tag the open conversations where the customer asks about price as "quote".”
“Resolve the open conversations where the customer only said thanks.”
“Create a group called "VIP Customers" and invite these numbers.”
Questions about BatZap with Grok
No. It connects as a remote MCP server: you give BatZap's URL and your API key in the call to the xAI API.
Your WhatsApp, ready for Grok.
Connect WhatsApp to BatZap and use the conversations in your Grok workflows.
