# MCP server

Drive the platform from Claude or another agent.

The MCP (Model Context Protocol) server lets an AI agent, such as Claude, use the platform directly: list your numbers, write to contacts, prepare and follow campaigns. It relies on the same API key as the API.

## Connect

The server address is:

```text
https://hira.localtechstudio.com/mcp
```

Authentication uses the `Authorization: Bearer pk_live_...` header, as for the API.

```bash title="Claude Code"
claude mcp add --transport http whatsapp https://hira.localtechstudio.com/mcp \
  --header "Authorization: Bearer pk_live_..."
```
```json title="JSON configuration"
{
  "mcpServers": {
    "whatsapp": {
      "type": "http",
      "url": "https://hira.localtechstudio.com/mcp",
      "headers": { "Authorization": "Bearer pk_live_..." }
    }
  }
}
```

> **Tip**

> Give the agent a **company** key, not a partner key: it will only see and touch one company. Revoke the key when the agent no longer needs it.

## Tools

| Tool | What it does |
|---|---|
| `list_connections` | Lists connected numbers and their quality. |
| `disconnect_connection` | Disconnects a number from the platform. |
| `send_message` | Sends a text or a template to a number. |
| `get_message` | Gives a message's status. |
| `list_messages` | Conversation history. |
| `list_conversations` | Lists the inbox. |
| `list_templates` | Lists templates and their approval state. |
| `list_contacts` | Searches contacts by tag or text. |
| `upsert_contact` | Creates or updates a contact. |
| `opt_out_contact` | Opts a contact out. |
| `list_canned_replies` | Lists canned replies. |
| `list_automations` | Lists automations. |
| `list_flows` | Lists Flows. |
| `get_calling_settings` | Reads calling settings for a number. |
| `create_campaign` | Prepares a draft campaign. |
| `preview_campaign` | Checks a draft: recipients, set aside, duration, quota. |
| `launch_campaign` | Launches or schedules a campaign, after explicit confirmation. |
| `pause_campaign`, `resume_campaign`, `cancel_campaign` | Stay in control while sending. |
| `campaign_report` | Gives delivery, read, reply and STOP rates. |
| `search_docs` | Searches this documentation. |

## Safeguards

- The key's rights apply: a company key never leaves its company.
- Launching a campaign requires the `confirm: true` parameter. Without it, the tool refuses and returns the preview to show the person.
- The same quotas, sending tiers and opt-outs as in the API apply.
- Every action is recorded like any other API call.

> **Warning**

> An agent can make mistakes or be influenced by text it reads (a customer message, a web page). Keep human confirmation before any campaign launch, and test on a small list first.

## Example requests

- "Show me the approved templates on my main number."
- "Prepare a campaign with the december_promo template for contacts tagged VIP, and tell me how many will be set aside."
- "Pause this morning's campaign."
- "What is the read rate of the last campaign?"
