> ## 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`, the default import of the v7 Node SDK. 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.
> 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 send notifications through the Courier MCP server with a scoped API key.

export const Tags = ({items}) => {
  const routes = {
    Email: "/integrations/email/overview",
    SMS: "/integrations/sms/overview",
    Push: "/integrations/push/overview",
    Inbox: "/in-app/overview",
    Chat: "/integrations/direct-message/overview",
    Templates: "/design/templates/overview",
    Variables: "/design/templates/variables",
    Elemental: "/design/elemental/overview",
    Brands: "/design/brands",
    Translations: "/design/elemental/locales",
    Routing: "/send/routing",
    Preferences: "/recipients/preferences/overview",
    Journeys: "/journeys/overview",
    Broadcasts: "/broadcasts/overview",
    Tenants: "/tenants/overview",
    Logs: "/monitor/overview",
    Webhooks: "/monitor/webhooks/outbound",
    Lists: "/recipients/lists-and-audiences/overview",
    Users: "/recipients/overview",
    Digests: "/journeys/nodes/digest",
    Environments: "/workspaces/overview",
    MCP: "/resources/mcp"
  };
  const icons = {
    Email: "envelope",
    SMS: "comment",
    Push: "mobile",
    Inbox: "inbox",
    Chat: "comments",
    Templates: "pen-ruler",
    Variables: "pen-ruler",
    Elemental: "pen-ruler",
    Brands: "pen-ruler",
    Translations: "pen-ruler",
    Routing: "paper-plane",
    Preferences: "users",
    Journeys: "route",
    Broadcasts: "bullhorn",
    Tenants: "building",
    Logs: "chart-simple",
    Webhooks: "chart-simple",
    Lists: "users",
    Users: "users",
    Digests: "route",
    Environments: "briefcase",
    MCP: "toolbox"
  };
  const base = "https://d3gk2c5xim1je2.cloudfront.net/fontawesome/v7.2.0/regular/";
  const names = String(items || "").split(",").map(entry => entry.trim()).filter(Boolean);
  return <div className="cx-tags">
      {names.map(name => {
    const href = routes[name];
    const icon = icons[name];
    const url = icon ? "url(" + base + icon + ".svg)" : null;
    const style = url ? {
      "--cx-tag-icon": url
    } : null;
    if (!href) {
      return <span className="cx-tag" data-icon={icon} style={style} key={name}>
              {name}
            </span>;
    }
    return <a className="cx-tag" data-icon={icon} style={style} href={href} key={name}>
            {name}
          </a>;
  })}
    </div>;
};

export const AppLink = ({href, children, name, bare}) => {
  const label = children || name || "Open in Courier";
  if (bare) {
    return <a href={href} target="_blank" rel="noreferrer">{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="app" href={href} target="_blank" rel="noreferrer">
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method" aria-hidden="true">↗</span>
    </a>;
};

export const Guide = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="guide" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">GUIDE</span>
    </a>;
};

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

<Tags items="MCP" />

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.

## 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. In Test, email only delivers to the address you signed up with, so an agent cannot reach a real customer by mistake.
</Tip>

## Prerequisites

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

## Connect and send

<Steps>
  <Step title="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.

    <CodeGroup>
      ```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" }
      ```
    </CodeGroup>

    See the <Doc href="/docs/resources/mcp">full list of tools and supported agents</Doc>.
  </Step>

  <Step title="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.
  </Step>
</Steps>

## Verify

<Steps>
  <Step title="Read back the requestId">
    The agent returns a `requestId`. Open <AppLink href="https://app.courier.com/logs">Logs</AppLink> and find that request.
  </Step>

  <Step title="Confirm it delivered">
    Expand the message timeline and confirm the provider accepted it.
  </Step>

  <Step title="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.
  </Step>
</Steps>
