Integrations/OpenCode
OpenCode logo

OpenCode + Courier

Ship production-ready notifications with OpenCode

Install the Courier skill and OpenCode builds your notification system the way Courier's own team would: fallback routing, preferences, idempotency, and delivery you can verify, across email, SMS, push, and in-app. Add MCP to test it against your account.

Overview

How OpenCode and Courier fit together

OpenCode is an open-source coding agent for the terminal. With the Courier skill installed, it builds your notification system in your codebase, templates with fallback routing, journeys, preferences, and an in-app inbox, following Courier's patterns for each channel. Courier then makes sure those messages reach people: it picks the channel, falls back when one fails, respects the user's preferences, and shows you what happened.

The skill does the building. Add the hosted MCP server when you want to test against your account from the editor. OpenCode reads the key from your environment with {env:COURIER_API_KEY}, so opencode.json stays safe to commit.

You need a Courier account. The skill needs nothing else; the MCP server needs a test-environment API key, which is separate from production.

What you can build

What you get with OpenCode + Courier

Use cases

What to build in your first session

Add password-reset notifications to this app with Courier: SMS first, email fallback
Add Courier Inbox to this Next.js app with a server-issued JWT
Build a three-step onboarding journey with a two-day delay between steps
Add a Product updates preference topic users can opt out of, and make onboarding respect it

Setup

Set up OpenCode with Courier

Two steps to build. Two more if you want to test against your account from the editor.

1
Install the Courier skill
Works in any tool that reads a skills directory. Discovery comes from the SKILL.md frontmatter; there is nothing else to configure.
npx skills add trycourier/courier-skills
2
Kick off a build
OpenCode reads the skill's router, loads the guides for the task, and writes the code and templates in your repo.
› Add password-reset notifications to this app with Courier:
  SMS first, email fallback
3
Add the MCP server to test and prototype
Optional. Needs your test-environment API key from app.courier.com/settings/api-keys. To confirm the key works, ask it to list your notification templates; a wrong key returns a 403. Add this to opencode.json in your project. The {env:COURIER_API_KEY} form reads the key from your environment so it never lands in the file.
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "courier": {
      "type": "remote",
      "url": "https://mcp.courier.com",
      "enabled": true,
      "headers": { "api_key": "{env:COURIER_API_KEY}" }
    }
  }
}
4
Send yourself a test
Over MCP, OpenCode publishes the template to your test workspace, sends to your test user, and reads back the delivery events.
› Publish the password-reset template and send me a test

FAQ

Frequently asked questions

What does the Courier skill add?

A routing file plus about 40 reference guides covering seven channels, transactional and growth patterns, routing, reliability, and Inbox. OpenCode reads the router first and loads only the one or two guides a task needs. It is plain Markdown on the open agent-skills convention, so the same skill works in every tool that reads a SKILL.md.

Do I need the MCP server?

Not to build. The skill is enough for OpenCode to write templates, routing, journeys, and Inbox code in your repo. Add the MCP server when you want to test and prototype against your Courier account from the editor: publish to your test workspace, send yourself a test, read the delivery events.

What can OpenCode do through the Courier MCP server?

The hosted server exposes 144 tools covering the full Courier API: create and publish templates, define routing strategies, build and run journeys, set up preference topics and brands, manage users and lists, send test messages, and read message logs. It authenticates with your API key passed as a header; nothing runs locally.

Do I have to put the API key in opencode.json?

No. OpenCode substitutes {env:VARIABLE} in config values, so {env:COURIER_API_KEY} reads the key from your environment at startup and the file stays safe to commit.

Is it safe to let it work against my account?

Use the test-environment API key. Test and production keys are separate, so templates, journeys, and test sends stay in the test environment and never reach real users. Switch to the production key when you ship.

How is this different from the Claude and ChatGPT integrations?

Those cover AI assistants: Claude the model inside Courier (AI agent node, AI Translation) and connecting a ChatGPT agent to Courier. This page is OpenCode, the coding tool, building your notification system in your codebase with the Courier skill.

More

Other AI coding tools