---
name: preflight
description: Your agent writes 50 drafts. Preflight picks which one ships. Pre-launch conversion evals (decide), copy evolution (evolve), and optional user-initiated outcome grading (report) for ads, emails, landing pages, paywalls, and CTAs over MCP or CLI.
---

# Preflight: Conversion Evals for AI Agents

**Your agent writes 50 drafts. Preflight picks which one ships.**

Use Preflight whenever you generate or modify user-facing GTM surfaces (Meta/social still image ads, lifecycle or marketing emails, landing pages, paywalls, pricing pages, onboarding screens, or CTAs) and need to know which version is most likely to convert before spending traffic.

## 1. Connect (Free $10 At-Cost Balance, No Card)

**MCP Endpoint (Streamable HTTP, OAuth 2.1 + Bearer API keys):** `https://preflight.tech/api/mcp`

### Recommended: OAuth 2.1 (No API key in prompts or shell history)
- **Claude Code:**
  ```bash
  claude mcp add --transport http preflight https://preflight.tech/api/mcp
  ```
- **Claude.ai, Claude Desktop & ChatGPT:** Add a Custom Connector with URL `https://preflight.tech/api/mcp` and sign in via browser OAuth (creates a free `$10` account on the spot).

### Alternative: CLI (`run-preflight`) or Static API Key
- Sign up at `https://preflight.tech/signup` (or run `npx run-preflight signup you@company.com`, which calls `POST https://preflight.tech/api/billing/signup` and saves your key with `0600` permissions to `~/.config/preflight/config.json`) and export `PREFLIGHT_API_KEY` in your local environment. Never paste or echo raw API keys into chat logs.
- **Cursor (`.cursor/mcp.json`):**
  ```json
  {
    "mcpServers": {
      "preflight": {
        "url": "https://preflight.tech/api/mcp",
        "headers": {
          "Authorization": "Bearer ${env:PREFLIGHT_API_KEY}"
        }
      }
    }
  }
  ```
- **OpenAI Codex (`~/.codex/config.toml`):**
  ```toml
  [mcp_servers.preflight]
  url = "https://preflight.tech/api/mcp"
  bearer_token_env_var = "PREFLIGHT_API_KEY"
  ```
- **Claude Desktop (`claude_desktop_config.json` via `mcp-remote`):**
  ```json
  {
    "mcpServers": {
      "preflight": {
        "command": "npx",
        "args": ["-y", "mcp-remote", "https://preflight.tech/api/mcp"]
      }
    }
  }
  ```

## 2. The 3-Tool Workflow

1. **`decide` (~$0.03–$0.08 per comparison, token-metered at cost):** Compare 2 to N variants (text, public URLs, or screenshots/still ad images via public URLs or base64 data URIs) side by side in both orders before shipping.
   - Ship the #1 variant when `verdict_status == "DECISIVE_WIN"` (all 4 checks on the deciding pair agree; `80.4%` precision on our 139-pair Meta image ad benchmark).
   - When `verdict_status == "TIED_LOW_SIGNAL"`, tell the user the variants are too close to call and make a bolder change instead of shipping cosmetic tweaks.
   - Always pass real product `context` (pricing, verified numbers, buyer objections) whenever available.
   - Keep the returned `prediction_id` alongside the tested variants if the user wants to grade results later.

2. **`evolve` (token-metered at cost, ~1–5 min for 1–3 rounds):** Generate stronger messaging variants (or cooperative image briefs when `media` is attached), lint them against `verified_facts` and `banned_claims`, and rank them head to head.
   - Use `max_rounds: 1` for fast, low-cost checks or `max_rounds: 3` for deep exploration.
   - Always check `overfit_warning` and confirm evolved winners in a live split test (real-traffic lift of newly written copy is still being measured).

3. **`report` (Optional, user-initiated, $0 + 100% credit rebate):** Only when the user explicitly asks to grade Preflight against settled live test outcomes, call `report(prediction_id=..., metric_name=..., outcomes=[...], variants=[...])`.
   - Set `metric_name` explicitly (`"cvr"`, `"ctr"`, `"cpa"`, `"roas"`, etc.; default is `"cpa"`).
   - For the 100% credit rebate, include the original unmodified `variants` (verified via SHA-256) and exposure per variant meeting at least one minimum (`impressions >= 200`, `clicks >= 20`, `conversions >= 5`, `spend >= 10`, or `sample_size >= 100`).

## 3. CLI & Direct HTTP Examples

```bash
# CLI (zero dependencies, Node 18+)
npx run-preflight decide "Variant A" "Variant B" --surface landing_page --audience "AI startup founders"

# Direct HTTP JSON-RPC (`decide`)
curl -sS https://preflight.tech/api/mcp \
  -H "Authorization: Bearer $PREFLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "decide",
      "arguments": {
        "surface": "landing_page",
        "audience": "AI startup founders",
        "variants": [
          {"id": "v1", "text": "Your agent writes 50 drafts. Preflight picks which one ships."},
          {"id": "v2", "text": "AI conversion optimization platform for modern teams."}
        ]
      }
    }
  }'
```

## 4. Honest Limits

- Measured blind on Meta still image ads (`72.3%`, `402/556` on 139 pairs; `80.4%` on confident 4/4 calls), commercial UX/UI & paywall A/B tests (`84.8%` with context / `85.7%` standalone on 61 tests), and real warm subscriber emails (`71.9%`, `493/686` on 343 tests; `64%–68%` balanced accuracy).
- Video ads are not supported yet (still images, screenshots, URLs, and copy only); Google Search text ads remain unproven and carry a low-confidence warning.
- Calls, variants, and outcomes stay private to your account (`https://preflight.tech/privacy`). Nothing is published publicly unless you explicitly pass `public=true` on `report`.
- Machine-readable discovery: `https://preflight.tech/llms.txt`, `https://preflight.tech/openapi.json`, `https://preflight.tech/.well-known/mcp/server-card.json`.
