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

# AI agent quickstart: set up Courier in three steps

> Set up Courier in Claude Code, Cursor, Codex, or any coding agent in three steps: save your API key, install Courier Skills, and connect the MCP server.

**1. Save your key to your local environment**

Copy your API key from [Settings → API Keys](https://app.courier.com/settings/api-keys). In your project folder, run this in your terminal with your key in place of `YOUR_COURIER_API_KEY`. Running it in your terminal keeps the key out of your agent's chat.

```bash macOS / Linux theme={null}
printf '\nCOURIER_API_KEY=YOUR_COURIER_API_KEY\n' >> .env
```

```powershell Windows theme={null}
Add-Content .env "`nCOURIER_API_KEY=YOUR_COURIER_API_KEY`n" -NoNewline
```

**2. Install Courier Skills and send a test email**

[Courier Skills
DOC](/docs/resources/skills.md) gives your agent Courier's own guidance on the API and each channel, so it writes working Courier code on the first try instead of guessing.

Paste this into your agent. It keeps `.env` out of git, installs the skill, and emails you a test from a new template. Approve the install command when your agent asks, then look for "Courier is set up" in your inbox.

```text Your agent wrap theme={null}
Set up Courier in this project.

1. Make sure .env is in .gitignore.
2. Run: npx skills add trycourier/courier-skills -y
3. Read .agents/skills/courier/SKILL.md. Using COURIER_API_KEY from .env, create and publish a Courier email template named "Welcome to Courier" with the subject "Courier is set up" and a haiku based on the user's name and domain. Then ask me for my email address and send that template to it with routing method "single" on the "email" channel and "agent-setup" in metadata.tags.
```

**3. Connect to the Courier MCP server**

The [Courier MCP server
DOC](/docs/resources/mcp.md) lets your agent work in your Courier workspace from the chat: send test notifications, check what was delivered, and read the logs when something fails.

Paste this into your agent. It connects the server with the key in `.env`. Restart your agent when it asks, then ask it to list your Courier templates to check the connection.

```text Your agent wrap theme={null}
Connect the Courier MCP server.

1. Run: npx add-mcp@2 https://mcp.courier.com -n courier -t http -h "api_key: KEY" -a AGENT -g -y
   - KEY is the COURIER_API_KEY value in .env. Read it in your shell so it never appears in this chat.
   - AGENT is your add-mcp agent name, for example claude-code, cursor, or codex.
2. Tell me to restart you so the Courier tools load.
```

[Build with AI
DOC](/docs/get-started/build-with-ai.md) covers what each tool does, the Courier CLI, and docs built for agents.
