MCP server
Ozi speaks the Model Context Protocol, so an agent - Claude, Cursor, or anything else that speaks MCP - can send mail and check what happened to it, read and answer the mail in your mailboxes, and run your contacts, campaigns, templates, automations and signup forms, without any glue code of yours. The server runs inside your deployment; there is nothing extra to host. The endpoint isPOST /api/v1/mcp, using streamable HTTP.
Connect Ozi to Claude
In Claude (claude.ai or Claude Desktop), open Settings → Connectors, choose Add custom connector, and paste:- Team, if you are on more than one.
- What it can do: Full access (only team admins can give this) or Sending only.
- Which domains: all of them, or just one.
/.well-known/oauth-protected-resource and
/.well-known/oauth-authorization-server, and clients register themselves.
Connect with an API key
Claude Code, and clients that can send a header, can use an API key instead. Point the client at the endpoint with a Bearer key:Tools
The server covers the whole account, not just sending. Each area’s tools:
Every tool’s description takes room in the agent’s context, so connect only
the areas it needs by naming them in
tools, separated by commas: email,
domains, contacts, segments, campaigns, templates, automations,
forms and mail. Without tools the agent gets them all.
{{firstName}} or {{firstName,fallback=there}} for values filled in
for each person, or as the editor’s own document. Either way it opens in the
template editor like one made there.
Each tool runs as the key that called it, and can do nothing that key could
not already do through the REST API or the dashboard: a key restricted to one
domain is restricted here too, and every call appears in Logs
with the rest of the API traffic.
- A Sending key sees only
send_email,send_batch,get_email,reschedule_emailandcancel_email. - A key limited to one domain can’t add domains, doesn’t see automations, and
can’t change templates or change or delete segments: each of those reaches
mail sent from every domain. When it writes a contact book’s confirmation
email,
doubleOptInFrommust be an address on its own domain; the same holds for the REST API. - Tools that delete, or that email many people (sending or scheduling a campaign, turning an automation on, adding existing contacts to one), are marked as destructive, so a client asks you before running them. Nothing here deletes mail.
Giving an agent one inbox
Create a key and choose Only the mailboxes I choose under Mailbox access. An agent with that key sees just the mailbox tools, and only those mailboxes: any other reads as if it did not exist. See the Mailbox API for what such a key can reach.Mail is untrusted
Anyone can email a mailbox, so anyone can write text your agent will read, including text that tries to tell it what to do. Every tool result holding mail carries anotice saying its contents are data rather than instructions, but a
notice can’t guarantee how a model behaves. Keep a person in the loop for what
matters. reply_to_thread requires expected_recipient, so that a reply never
goes to an address other than the one you approved.
To keep results small, get_thread returns text without HTML, cuts a long
message at 20 KB (text_truncated says so), returns up to 20 messages at a
time, and lists attachments without their contents. Use
Download an attachment for those.
Pass an idempotency_key to send_message and reply_to_thread, so that
retrying a call can’t send twice.
Supabase
Supabase Auth’s built-in email is rate limited and sends from Supabase’s own address. Point it at Ozi’s SMTP and confirmations, magic links and password resets go out from your domain and show up in your logs. In your Supabase project, open Project Settings → Authentication → SMTP Settings, enable custom SMTP, and fill in the host, port, username and sender address the integration page shows. The password is the API key.The sender address must be on a domain that is verified in Ozi. Supabase
accepts anything you type, and auth emails then fail silently.
Vercel
ozi-js reads its settings from the
environment, so on Vercel the integration is two variables:
OZI_BASE_URL is optional: the SDK sends to https://app.getozi.com unless it
is set.