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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> To translate a template, write one locale at a time with `PUT /notifications/{id}/locales/{localeId}`, which merges into the existing translations. `PUT /notifications/{id}/content` and `PUT /notifications/{id}/elements/{elementId}` overwrite translations along with the content, so send each element's `id` and `locales` back, and first remove every `checksum` and any `locales` key that starts with an underscore.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Send from an AI agent

> Let an AI agent in Claude Code, Cursor, or Codex send notifications through the Courier MCP server with your API key and a published template.

Let an AI agent send notifications for you, deciding who to tell and when.

The agent calls `send_message_template` over the MCP server. The template holds the content, and Courier handles channel selection, failover, and delivery.

Building your own AI agent? Send from the [Claude Agent SDK](https://www.courier.com/docs/guides/send-from-the-claude-agent-sdk.md), the [OpenAI Agents SDK](https://www.courier.com/docs/guides/send-from-the-openai-agents-sdk.md), or the [Vercel AI SDK](https://www.courier.com/docs/guides/send-from-the-vercel-ai-sdk.md).

## What to use it for

* **Test a send while you build.** Fire a real notification from your editor, with no script to write and no console to open. It is the fastest way to watch a template render against real data.
* **Alert on your own work.** A deploy lands or a nightly job fails, and the agent tells whoever owns it.
* **Let the agent choose.** An agent triaging tickets or watching a queue decides who to notify, and when.
* **Send a one-off.** Reach one customer without building a screen for it.

> [!TIP]
>
> For testing, connect the agent with a **Test** environment key. Test's built-in email provider only delivers to the address you signed up with, so until you connect your own provider, an agent can't reach a real customer by mistake.

## Prerequisites

* An MCP-capable agent (Claude Code, Cursor, or Codex)
* [A Courier account](https://app.courier.com/signup)
* [A Courier API key](https://app.courier.com/settings/api-keys)
* [A user profile with contact info, or the inbox channel](https://www.courier.com/docs/guides/import-your-users.md)
* [A published template](https://www.courier.com/docs/design/templates/overview.md)

## Connect and send

**1. Connect the Courier MCP server**

Add the Courier MCP server to your agent with your environment API key. Connect once, and the agent can call every Courier tool.

```bash Claude Code theme={null}
claude mcp add --transport http courier https://mcp.courier.com --header api_key:YOUR_COURIER_API_KEY
```

```json Cursor theme={null}
{
  "mcpServers": {
    "courier": {
      "url": "https://mcp.courier.com",
      "headers": { "api_key": "YOUR_COURIER_API_KEY" }
    }
  }
}
```

```toml Codex theme={null}
[mcp_servers.courier]
url = "https://mcp.courier.com"
http_headers = { "api_key" = "YOUR_COURIER_API_KEY" }
```

See the [full list of tools and supported agents](https://www.courier.com/docs/resources/mcp.md).

**2. Ask the agent to send**

Prompt the agent in plain language. It calls `send_message_template` to do it:

```text theme={null}
With Courier MCP, send my nt_01kx4h2jdafq8bk9aftxak4b40 template to user_123 for build 1.4.2.
```

The agent resolves the recipient, looks up the template, and sends. The content stays in the template, so the agent decides *when* and *who* without composing the message.

Once providers are configured, ask for email or push. Courier picks the channel and fails over as needed.

## Verify

**1. Read back the requestId**

The agent returns a `requestId`. Open [Logs](https://app.courier.com/logs) and find that request.

**2. Confirm it delivered**

Expand the message timeline and confirm the provider accepted it.

**3. Try a second channel**

Ask the agent to send on another channel. A channel with no configured provider shows as `UNROUTABLE` and Courier skips it, so start with the inbox channel, which needs no setup.
