# Set up with an AI agent

> Copy-paste prompts for Claude Code and Cursor that add monitoring to your app: through the StatusTick MCP server, or as a statustick.yml file you sync with the CLI.

Your coding agent already knows your app: its URL, its health route and its scheduled jobs. Give it access to StatusTick and one prompt, and it sets up the monitors for you. There are two ways:

| Way | Best when |
| --- | --- |
| [MCP server](#set-up-through-the-mcp-server) | You want monitors now, without new files in your repository. The agent creates them in StatusTick for you. |
| [statustick.yml and the CLI](#set-up-with-statustick-yml-and-the-cli) | You want your monitors in code, reviewed in pull requests and synced from CI. |

Both prompts ask the agent to show you the plan first and wait for your OK before it creates anything.

## Set up through the MCP server

The StatusTick MCP server is at `https://mcp.statustick.com`. It lets an agent list, create, pause and resume monitors, and read incidents and status pages. It cannot delete anything.

### 1. Add the server

**Claude Code:** run this in your project folder:

```bash
claude mcp add --transport http statustick https://mcp.statustick.com
```

**Cursor:** add the server to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for all projects):

```json
{
  "mcpServers": {
    "statustick": {
      "url": "https://mcp.statustick.com"
    }
  }
}
```

### 2. Sign in

**Claude Code:** start `claude`, run `/mcp`, pick `statustick` and choose to authenticate. **Cursor:** open Cursor Settings, find `statustick` in the MCP list and sign in when Cursor asks.

Your browser opens the StatusTick sign-in page. Sign in, pick the organization, and choose **read and write** so the agent can create monitors. Only owners and admins can give write access; read only is enough to ask about monitors and incidents.

No account yet? Choose **Continue with your email** on the sign-in page. StatusTick creates an account for you and emails a link to finish it. Open the link within 14 days to keep the account and to start receiving alerts.

If your MCP client cannot sign in through the browser, use an organization API key (Settings → API keys, read and write) instead:

```bash
claude mcp add --transport http statustick https://mcp.statustick.com \
  --header "Authorization: Bearer $STATUSTICK_API_KEY"
```

In Cursor, add `"headers": { "Authorization": "Bearer stk_live_…" }` next to `url`, and keep that file out of git.

### 3. Ask the agent to add monitoring

Paste this prompt into Claude Code or Cursor (agent mode):

```text
Use the StatusTick MCP server to add monitoring to this app.

1. Find the production URL of the app (check the README, environment files,
   vercel.json and deploy config; ask me if you cannot find it).
2. Find a health route, for example app/api/health/route.ts in a Next.js app.
   If there is none, propose a small one that returns 200 when the app and its
   database work, and wait for my OK before adding it.
3. Find every scheduled job: crons in vercel.json, scheduled GitHub Actions
   workflows, node-cron or similar schedulers, and background workers.

Then show me a table of the monitors you plan to create and wait for my OK:
- an HTTP monitor for the home page, every 60 seconds
- an HTTP monitor for the health route, every 60 seconds
- a HEARTBEAT monitor for each scheduled job, with an interval that matches
  its schedule

After I agree, create them with create_monitor. Each heartbeat answer has a
ping URL. For each job, add code that calls its ping URL when the job ends
successfully, reading the URL from an environment variable such as
STATUSTICK_PING_URL_NIGHTLY_REPORT. Never write a ping URL into the code. At
the end, list the monitors you created and the environment variables I need
to set, with their values.
```

New monitors use your organization's default regions. Choose where alerts go and which status pages show the monitors in the dashboard; see [Alert channels](https://statustick.com/docs/alert-channels) and [Heartbeat monitors](https://statustick.com/docs/heartbeat-monitors).

### More things to ask

The same server answers questions about what you monitor:

```text
Is anything down in StatusTick right now? If there is an open incident,
show me its timeline and the last failed checks.
```

```text
Start a 30-minute StatusTick maintenance window for the API monitors while
I deploy, and end it when the deploy is done.
```

## Set up with statustick.yml and the CLI

With the `statustick` CLI, your monitors live in a `statustick.yml` file next to your code. A sync makes StatusTick match the file: it creates new monitors, changes the ones that differ and deletes the ones you removed from the file. Monitors made in the dashboard are never touched.

The `statustick` command comes with the launch. Until then, use the [MCP server](#set-up-through-the-mcp-server). A `statustick.yml` your agent writes today works with the CLI as it is.

### 1. Give the CLI an API key

Create an organization API key in Settings → API keys and set it in your shell, not in a file in the repository:

```bash
export STATUSTICK_API_KEY=stk_live_…   # read and write to sync; read is enough for a dry run
```

### 2. Ask the agent to write the file

Paste this prompt into Claude Code or Cursor (agent mode):

```text
Add StatusTick monitoring to this app as code. Read
https://statustick.com/docs/set-up-with-an-ai-agent.md for the statustick.yml
format.

1. Find the production URL, the health route and every scheduled job (crons
   in vercel.json, scheduled GitHub Actions workflows, node-cron or similar).
   Ask me if you cannot find the production URL.
2. Write statustick.yml in the repository root with version: 1 and:
   - an http monitor for the home page and one for the health route,
     interval 1m
   - a heartbeat monitor for each scheduled job, with a cron and timeZone
     that match its schedule
   Use short, stable keys; renaming a key later deletes the monitor and
   creates a new one. Put secret header values in ${ENV_VAR} references.
3. Run `statustick validate` and fix every problem it reports.
4. Run `statustick sync --dry-run` and show me the plan. Run `statustick sync`
   only after I agree.
5. The sync prints a ping URL for each new heartbeat. For each job, add code
   that calls its ping URL when the job ends successfully, reading it from an
   environment variable such as STATUSTICK_PING_URL_NIGHTLY_REPORT, and tell
   me which variables to set.
```

### The file format

A `statustick.yml` for a Next.js app with one Vercel cron job:

```yaml
version: 1

defaults:
  interval: 1m
  timeout: 10s
  tags: [web]

monitors:
  - key: home
    name: Home page
    type: http
    target: https://app.example.com

  - key: health
    name: Health route
    type: http
    target: https://app.example.com/api/health
    http:
      expectedStatusCodes: [200]
      keyword: '"status":"ok"'
    degradedThresholdMs: 1500

  - key: nightly-report
    name: Nightly report
    type: heartbeat
    heartbeat:
      cron: "0 3 * * *"
      timeZone: UTC
      grace: 10m
```

The fields:

| Field | What it sets |
| --- | --- |
| `version` | Always `1`. Required. |
| `defaults` | Values for every monitor that leaves the field out: `interval`, `timeout`, `locations`, `alertPolicy`, `tags`, `group`. |
| `key` | Required. 1 to 64 of `a-z`, `0-9`, `-` and `_`, unique in the file. StatusTick tracks the monitor by its key. |
| `name` | The name in StatusTick, at most 64 characters. Default: the key. |
| `type` | `http`, `tcp`, `ping`, `dns` or `heartbeat`. |
| `target` | A URL for `http`, `host:port` for `tcp`, a host for `ping` and `dns`. Heartbeats have no target. |
| `interval` | Seconds, or `30s`, `5m`, `1h`, `1d`. From 30 seconds to 1 day. Default `5m`. |
| `timeout` | 1 to 60 seconds. Default `10s`. |
| `locations` | Region codes, region names or private location names. Left out, the monitor keeps its locations. |
| `http` | `method`, `headers`, `expectedStatusCodes` (default 200 to 206) and `keyword`, text the response must contain. |
| `dns` | `recordType`: `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `NS` or `SOA`. Default `A`. |
| `heartbeat` | `grace` (default `5m`), and `cron` with `timeZone` (an IANA name, default UTC) instead of an interval. |
| `degradedThresholdMs` | Checks slower than this count as degraded. |
| `tags`, `group` | Up to 10 tags of at most 32 characters, and a group name. |
| `paused` | `true` to stop checks and alerts. |
| `alertPolicy` | An alert policy by name, or `Default`. Left out, set it in the dashboard. |
| `statusPageComponents` | A list of `page` and `component` names the monitor shows on. Left out, set it in the dashboard. |

`${NAME}` in a value is read from the environment when the CLI runs, and values never show in plans. A field you remove goes back to the default on the next sync.

### The commands

| Command | What it does |
| --- | --- |
| `statustick validate` | Checks the file without calling StatusTick. Each problem names the line and the field. |
| `statustick sync --dry-run` | Shows what a sync would create, change and delete, field by field. |
| `statustick sync` | Makes StatusTick match the file. If StatusTick refuses one monitor, nothing is saved. |
| `statustick export -o statustick.yml` | Writes the monitors you already have as a file, to start from. |
| `statustick adopt` | Takes over monitors made in the dashboard that the file names by `id`. |

Monitors the file manages refuse edits in the dashboard and the API, except alert settings, muting and deleting, so the file stays the source of truth. A monitor deleted by hand comes back on the next sync.

## Other agents and tools

- **Any MCP client** (ChatGPT, Windsurf, VS Code and others): add `https://mcp.statustick.com` as a remote MCP server over Streamable HTTP, and sign in or send an API key as `Authorization: Bearer`.
- **REST API:** the same monitors, incidents and status pages, with organization API keys. The reference is at [api.statustick.com/docs](https://api.statustick.com/docs) and the OpenAPI file at `https://api.statustick.com/docs/openapi.yaml`.
- **These docs for agents:** [statustick.com/llms.txt](https://statustick.com/llms.txt) lists every docs page, [llms-full.txt](https://statustick.com/llms-full.txt) has all of them in one Markdown file, and every page is also Markdown when you add `.md` to its URL.
