Connect your AI agent (MCP)
Neike ships a built-in MCP server. Point Claude Code, claude.ai or any MCP client at it and your agent gets tools to send messages, read conversations and manage WhatsApp templates over your own channels — no glue code, no SDK.
The server lives at:
https://api.neike.dev/mcpIt speaks Streamable HTTP and authenticates with OAuth 2.1 (interactive, per user) or with an API key (headless, for backends).
Quick connect with Claude Code
Section titled “Quick connect with Claude Code”-
Add the server
Section titled “Add the server”Terminal window claude mcp add --transport http neike https://api.neike.dev/mcp -
Authorize in the browser
Section titled “Authorize in the browser”The first time the agent uses a Neike tool, Claude Code opens your browser to start the OAuth flow. Log in with your Neike console account.
-
Choose what the agent may touch
Section titled “Choose what the agent may touch”On the consent screen you pick the workspace (if you belong to several) and the channel selection for this connection:
Selection Meaning All channels Every channel, including ones you connect in the future. By platform All current and future channels of the platforms you tick (e.g. only WhatsApp). Specific channels Exactly the channels you list — nothing else, ever. Approve, and the agent is connected.
On claude.ai, go to Settings → Connectors → Add custom connector and
paste https://api.neike.dev/mcp as the URL. The same browser consent flow
kicks in.
You can revoke a connection at any time from the console under API Keys → Connections. Revocation is immediate — every token of that connection dies with it.
Alternative: API key
Section titled “Alternative: API key”For backends, CI or MCP clients that cannot run a browser flow, skip OAuth and send your API key on every request instead:
claude mcp add --transport http neike https://api.neike.dev/mcp \ --header "x-neike-api-key: whk_live_…"An API key connection has access to all channels of the workspace, limited only by the scopes of the key itself.
Tool reference
Section titled “Tool reference”The server exposes eight tools. All of them respect the channel selection of the connection.
| Tool | What it does | Main inputs |
|---|---|---|
list_channels | Lists the channels this connection can use, with channel_id (nk_*), platform, name and status. The agent’s starting point. | — |
send_message | Sends a message through a channel. Async: returns a job_id, not Meta’s message id. | channel_id, to, type (text|image|video|audio|document|interactive|reaction), content |
broadcast_message | Sends the same message through several channels at once. Returns a per-channel result. | channel_ids (list or "all"), to or recipients (map channel → recipient), type, content |
get_messages | Reads the latest inbound and outbound messages of a channel from Neike’s event log, optionally filtered by direction or contact. | channel_id, direction?, contact?, limit? (max 100, default 30) |
open_conversation | Starts a conversation with a contact. Outside WhatsApp’s 24-hour window it requires an approved template. | channel_id, to, template_name?, language?, components?, text? |
send_template | Sends an approved WhatsApp template — mandatory to start conversations outside the 24-hour window. | channel_id, to, template_name, language, components? |
create_template | Submits a WhatsApp template to Meta for approval (Business Management API format). Approval is asynchronous. | channel_id, template_data |
list_templates | Lists the channel’s WhatsApp templates with their approval status (APPROVED/PENDING/REJECTED), language and components. | channel_id |
In practice you never call these yourself — you just talk to your agent:
You: Send a WhatsApp message to +54 9 11 1234-5678 saying their order shipped.
Agent: calls
list_channels, picks your WhatsApp channelnk_dvzobn7m4h4y, then callssend_messagewithto: "5491112345678",type: "text"andcontent: { "text": "Good news — your order shipped! 📦" }.Agent: Done — the message is queued (job
outbound_nk_dvzobn7m4h4y_…).
Good to know
Section titled “Good to know”- Sends are asynchronous.
send_message,broadcast_message,open_conversationandsend_templatereturn ajob_idwhen the message is queued, not when it is delivered. Delivery status arrives on your backend’s webhook as usual. - The 24-hour window still applies. Outside 24 hours since the customer’s
last WhatsApp message, free-form sends fail at Meta — the agent has to use
send_templateoropen_conversationwith an approved template. See Sending messages. - Scopes. A connection can hold
messages:send,messages:read,templates:manageandusage:read. Administrative scopes (keys, team, billing) are never available over MCP.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause and fix |
|---|---|
401 on every call | The connection’s grant was revoked or its token expired beyond refresh. Re-authorize: remove and re-add the server, or just retry and let the client restart the OAuth flow. |
| A channel is “not authorized for this connection” | The channel exists but is outside the channel selection of this connection. Revoke the connection in API Keys → Connections and connect again with a broader selection. |