Docs

Set up a domain with an agent

An owner creates a token. An agent uses it to add a domain, save the Resend key, register the webhook, and check that mail sends and arrives.

Connect

In Rmail, open Settings, then Agent access. Create a token and copy it once. It starts with rmail_ and is owner access to one organization. Do not paste it into chat logs.

Put this in the agent client. Replace the token, not the address.

{
  "mcpServers": {
    "rmail": {
      "url": "https://mail.rightal.com/api/mcp",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

The live app is https://mail.rightal.com.

Order

  1. list_domains to see what is already there.
  2. add_domain with the bare domain name.
  3. set_resend_api_key with the Resend key. The tool returns only the last four characters.
  4. configure_webhook. This creates or reuses the domain at Resend with sending and receiving enabled, then registers email.received at https://mail.rightal.com/api/resend/webhook/{domainId}. The signing secret is saved and is not returned.
  5. Publish every DNS record the tool returns, at the DNS host. Rmail cannot do this step.
  6. get_setup_status until sending records are verified and the receiving MX is verified.
  7. add_mailbox with a local part such as info.
  8. send_test to an address you can read. That proves sending only.
  9. Ask for one message from another inbox to the new mailbox. Then check_receiving.

Send and receive

send_test checks outbound mail. check_receiving stays false until a message is delivered to a mailbox on that domain and the webhook stores it. A send test does not count as incoming mail.

Secrets

Do not repeat these in chat:

  • the full Resend API key
  • the webhook signing secret
  • the bearer token

Stop and report

Stop when any of these happen, and say which one:

  • the Resend key is missing
  • the domain name is already registered
  • the plan limit blocks a new domain
  • Resend returns an error
  • DNS is still pending after the records were published
  • the public app address is not https, so the webhook cannot be registered
  • a webhook for this address already exists at Resend and Rmail has no signing secret. Remove that webhook in Resend, then call configure_webhook again

Do not create a second webhook for the same address.