Recipe: Let your AI agent set up email (agent bootstrap)

Have Cursor, Claude Code, or another coding agent create a Notify account via email OTP, configure notifycx-mcp, verify a domain, and send the first transactional email — no dashboard required.

Short answer: Point your IDE agent at notifycx-mcp (registry id io.github.notifycx/notifycx-mcp) or call POST /api/agent/bootstrap/start and /confirm with the user’s email and a pasted 6-digit OTP. Store the returned api_key once as NOTIFY_API_KEY, add a domain, publish the dnsRecords at your DNS host, then POST /api/email/send. New accounts stay sandbox_only until the domain verifies — use send_test_email / POST /api/email/send/test to rehearse first.

Full reference: Agent bootstrap — no dashboard. Vibe-coded apps: Transactional email for Lovable, Bolt, v0, Cursor.

Prerequisites

  • Human email inbox for the OTP (signup or recover)
  • Cursor, Claude Desktop, Claude Code, or any agent that can run MCP or HTTPS
  • DNS access when you want production from on your domain

Step 1 — MCP config (Cursor / Claude Desktop)

Official package: notifycx-mcp · MCP registry: io.github.notifycx/notifycx-mcp.

{
  "mcpServers": {
    "notify": {
      "command": "npx",
      "args": ["-y", "notifycx-mcp"],
      "env": {}
    }
  }
}

Leave NOTIFY_API_KEY empty until after bootstrap. Install details: /mcp · Official MCP guide.

Step 2 — Bootstrap (no API key yet)

MCP tools: bootstrap_start → user pastes code → bootstrap_confirm.

HTTPS (same contract as OpenAPI):

curl -sS -X POST https://notify.cx/api/agent/bootstrap/start \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","intent":"signup","acceptTerms":true}'

User pastes the 6-digit code from email, then:

curl -sS -X POST https://notify.cx/api/agent/bootstrap/confirm \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","code":"123456","intent":"signup"}'

Response includes data.api_key (shown once). Put it in MCP env.NOTIFY_API_KEY or a server secret — not in chat logs.

intent: "recover" for an existing account (Free rotates the single key; paid plans add an Agent key). Terms: acceptTerms: true required.

Step 3 — Domain + first production send

After the key is set:

  1. add_domain (MCP) or POST /api/email/domains — copy structured dnsRecords for the user
  2. User publishes TXT/CNAME at Cloudflare, Vercel, Route 53, etc. (Cloudflare · Route 53)
  3. check_domain / POST /api/email/domains/{domain}/check
  4. send_email or:
await fetch('https://notify.cx/api/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.NOTIFY_API_KEY!
  },
  body: JSON.stringify({
    from: 'Your App <noreply@your-verified-domain.com>',
    to: 'user@example.com',
    subject: 'Password reset',
    html: '<p><a href="https://app.example/reset">Reset password</a></p>'
  })
});

Before verification: send_test_email or POST /api/email/send/test — Sandbox vs production.

SDK equivalent (notifycx)

import Notify from 'notifycx';

await Notify.bootstrapStart({
  email: 'you@example.com',
  intent: 'signup',
  acceptTerms: true
});

const { data } = await Notify.bootstrapConfirm({
  email: 'you@example.com',
  code: '123456',
  intent: 'signup'
});

const notify = new Notify({ apiKey: data.api_key });
await notify.addDomain({ domain: 'example.com', dnsProvider: 'cloudflare' });
// User publishes dnsRecords, then:
await notify.checkDomain('example.com');
await notify.send({ to: '...', from: '...', subject: '...', html: '...' });

Related

FAQ

Can an AI agent sign up for Notify without a browser?

Yes. Call bootstrap start / confirm (or MCP bootstrap_start / bootstrap_confirm). The human only pastes the email OTP. DNS still requires publishing records at your host.

Where does the API key go after bootstrap?

Server env or MCP NOTIFY_API_KEY — never client bundles, public env vars, or permanent chat transcripts. The confirm response warns it is shown only once.

Does bootstrap skip domain verification?

No. Accounts start sandbox_only. Production custom from needs a verified domain. Rehearse with POST /api/email/send/test.

Which MCP server is official?

notifycx-mcp on npm — MCP registry io.github.notifycx/notifycx-mcp. Use that package only; ignore archived third-party MCP repos.

What if bootstrap returns BOOTSTRAP_DISABLED?

The operator turned off agent bootstrap (AGENT_BOOTSTRAP_ENABLED=false). Use dashboard signup or wait until it is re-enabled.

How does this differ from putting send in my app code?

Bootstrap + MCP are for setup (key, domain, DNS, test send). Production sends belong in your codebase via notifycx or fetch, not only in the IDE agent session.