> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pilotstatus.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Build AI-Powered WhatsApp Agents with Pilot Status

> Connect LLMs and AI workflows to WhatsApp using Pilot Status webhooks, MCP server, and REST API. Build chatbots that respond in real time, 24/7.

Pilot Status is built to be driven by AI. There are three complementary ways to connect LLMs and agents to WhatsApp: the hosted **MCP server**, the plain **REST API** with the `x-api-key` header, and **webhook-driven bots** that react to inbound messages in real time.

## MCP server (hosted connector)

Pilot Status ships an official Model Context Protocol server that exposes the public `/v1` API as **54 MCP tools** — send messages, read conversations and unread messages, manage numbers, templates, webhooks, groups, voice calls, and more.

The hosted connector runs at:

```text theme={null}
https://mcp.pilotstatus.com.br/mcp
```

Add it in claude.ai under **Settings → Connectors → Add custom connector**. claude.ai runs the OAuth 2.1 login (Pilot Status SSO) — no API key is shared with the client. During login you see a **consent screen** where you approve access at the **tenant level** or grant only **specific numbers** (a per-number grant restricts every tool to those numbers).

Clients configured by file can skip OAuth and send a `ps_*` key in the `x-api-key` header instead:

```json theme={null}
{
  "mcpServers": {
    "pilot-status": {
      "type": "http",
      "url": "https://mcp.pilotstatus.com.br/mcp",
      "headers": { "x-api-key": "ps_your_key_here" }
    }
  }
}
```

See the [MCP Server integration page](/integrations/mcp-server) for the full tool list and self-hosting.

## Teach any LLM about Pilot Status

Point your model or coding agent at the canonical machine-readable reference:

```text theme={null}
https://pilotstatus.com.br/llms.txt
```

It links endpoints, webhook schemas, concepts, and error codes — everything an AI needs to write a correct integration.

## Webhook-driven bots

The classic pattern: subscribe a webhook to `message.received`, run the payload through your LLM, and reply via the API.

```javascript theme={null}
app.post("/hooks/whatsapp", async (req, res) => {
  res.sendStatus(200); // acknowledge first
  const { event, data } = req.body;
  if (event !== "message.received") return;

  const reply = await llm.complete(data.content); // your model call

  await fetch("https://pilotstatus.com.br/v1/messages/send", {
    method: "POST",
    headers: {
      "x-api-key": process.env.PILOT_STATUS_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ text: reply, destinationNumber: data.from }),
  });
});
```

<Tip>
  Pilot Status fires webhooks within milliseconds of each event, so agents can respond nearly instantly. Deduplicate by `data.id` and keep your handler fast — do the LLM call asynchronously.
</Tip>

Setup details are in the [Receive Messages guide](/guides/receive-messages).

## Direct REST API

Any framework that can make HTTP requests (LangChain, n8n, Make, custom backends) can use the API directly. Authentication is always the `x-api-key: ps_...` header; the base URL is `https://pilotstatus.com.br/v1`, and the only send endpoint is `POST /v1/messages/send` (template, text, or media mode). The official [SDKs](/integrations/sdks) wrap this for Node.js, Python, and n8n.

## Related

* [MCP Server](/integrations/mcp-server)
* [SDKs & n8n](/integrations/sdks)
* [Using AI/LLMs with Pilot Status](/trust/llms)
