# Agent setup

Instructions a coding agent follows to authenticate with Notifiable, connect MCP, and continue product setup without pasting secrets into chat.

Paste this prompt into Claude Code, Cursor, Codex, or another coding agent:

```text
Read https://notifiable.sh/auth.md and follow https://notifiable.sh/agent.md to set up Notifiable in this project. Connect its MCP server, help me sign up or sign in, reuse or create the appropriate app, install and configure the SDK, and verify the integration with a test notification. Propose relevant lifecycle segments and workflows, and create them as drafts. Keep credentials out of chat and source control.
```

(Use the absolute `/agent.md` URL for the environment you are on when local or staging.)

## Rules

- Ask only what you cannot determine yourself.
- Never display, log, or commit `ntf_key_` or other secrets.
- Never run commands that dump environments (`env`, `printenv`, `ps e`).
- Default to project-local MCP config when the client supports it.
- Keep tool approvals enabled for sends, deletes, and production changes.
- If you cannot configure the client, give the exact manual step and wait.

## Step 1: Authenticate

Follow https://notifiable.sh/auth.md. Reuse `NOTIFIABLE_API_KEY` when it is already set and a request with it succeeds. Otherwise register, deliver the claim link and code, poll, and store the key in an ignored env file as `NOTIFIABLE_API_KEY`.

## Step 2: Connect MCP

Hosted MCP: `https://mcp.notifiable.sh/mcp`

Use Streamable HTTP. Authenticate with the server API key as a Bearer header. Never put the key in the URL.

### Claude Code

```bash
claude mcp add --transport http notifiable https://mcp.notifiable.sh/mcp --header "Authorization: Bearer ${NOTIFIABLE_API_KEY}"
```

Reload or start a new session if tools do not appear. Prefer reading the key from the environment rather than pasting it into the command history when your client supports env substitution.

### Cursor

Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (user), keeping other servers:

```json
{
  "mcpServers": {
    "notifiable": {
      "url": "https://mcp.notifiable.sh/mcp",
      "headers": {
        "Authorization": "Bearer ${NOTIFIABLE_API_KEY}"
      }
    }
  }
}
```

If the client does not expand `${NOTIFIABLE_API_KEY}`, write the header from the env value in a user-level config that is not committed, or ask the user to paste into Cursor MCP settings without sharing it in chat. Reload MCP from Cursor settings if required.

### Codex

```bash
codex mcp add notifiable --url https://mcp.notifiable.sh/mcp --header "Authorization: Bearer $NOTIFIABLE_API_KEY"
```

Or project `.codex/config.toml` with the same URL and header. Start a new session after adding.

### Other clients

Configure a remote Streamable HTTP server named `notifiable` at `https://mcp.notifiable.sh/mcp` with `Authorization: Bearer <NOTIFIABLE_API_KEY>`.

### Without MCP

You may call `https://notifiable.sh/api/v1/public` with the same Bearer key. OpenAPI lives at `/docs/api` in local environments. Prefer MCP tools when connected.

## Step 3: Continue setup

1. Detect the project framework and platforms.
2. Reuse or create the matching Notifiable app; keep public keys for the SDK.
3. Install and configure the SDK, identify, permissions, device registration, and events. Guides: https://docs.notifiable.sh/llms.txt
4. Send a test notification only with approval; report the verified result.
5. Draft segments and lifecycle workflows from instrumented events; leave production messaging as drafts unless the user explicitly authorizes activation.
6. Make retries idempotent: do not create duplicate apps, keys, segments, or workflows.
7. Explain remaining manual steps (Apple connection, provider credentials, device builds).

## Verify

- Confirm `NOTIFIABLE_API_KEY` is present in a fresh process without printing it.
- Confirm an MCP tool or public API call succeeds.
- Distinguish local/mocked checks from a live test notification.