> ## 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.

# Build with AI

> Connect an AI coding agent to Courier through MCP, the CLI, or agent skills.

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 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>;
};

Courier offers four ways to connect an AI agent. Pick by how you want the agent to work.

<CardGroup cols={2}>
  <Card title="MCP server" icon="microchip-ai" href="/docs/resources/mcp">
    Structured tool calls inside an agent session.
  </Card>

  <Card title="Courier CLI" icon="terminal" href="/docs/resources/cli">
    Shell access for scripting and CI/CD.
  </Card>

  <Card title="Courier Skills" icon="graduation-cap" href="/docs/resources/skills">
    Best-practice packs that guide your assistant.
  </Card>

  <Card title="Docs for agents" icon="file-code" href="#docs-for-agents">
    Machine-readable indexes agents can fetch.
  </Card>
</CardGroup>

## Which one to use

| Reach for                                          | When                                                                                                                           |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| <Doc href="/docs/resources/mcp">MCP server</Doc>        | Your agent works in a session and should discover Courier's tools on its own, with typed parameters instead of shell commands. |
| <Doc href="/docs/resources/cli">Courier CLI</Doc>       | You are scripting, running in CI, or want the agent to compose shell commands and read `--format json` output.                 |
| <Doc href="/docs/resources/skills">Courier Skills</Doc> | The agent already has API access and needs to know the right way to use it: which endpoint, which shape, which conventions.    |

They combine. A common setup is the MCP server for tool calls plus Skills for the conventions, with the CLI reserved for CI.

## Prerequisite: create an API key

All four need a Courier API key. <AppLink href="https://app.courier.com/settings/api-keys">Create one in Settings → API Keys</AppLink>, then replace `YOUR_COURIER_API_KEY` wherever the setup pages ask for it.

Keys belong to a single <Doc href="/docs/workspaces/overview#environments-and-api-keys">environment</Doc>. Use a **Test** key while you build. Every new workspace has a Test environment with a testing Provider, so your agent can send before you configure anything.

## Docs for agents

Give your agent the docs in a machine-readable form:

| URL                                                           | Description                         |
| ------------------------------------------------------------- | ----------------------------------- |
| [`llms.txt`](https://www.courier.com/docs/llms.txt)           | Index of every documentation page   |
| [`llms-full.txt`](https://www.courier.com/docs/llms-full.txt) | Full documentation in a single file |

Both follow the [llms.txt standard](https://llmstxt.org/) and are generated from these docs.
