Connect an AI agent to NevarMail
Give an AI agent scoped access to your domains, senders, templates, lists, use cases, suppressions and analytics through NevarMail's MCP server.
An AI agent can work in your NevarMail account through NevarMail's MCP server: a Model Context Protocol endpoint that exposes your domains, senders, templates, lists, use cases, suppressions and analytics as tools. The agent sees only the tools your credential's scopes allow, and every tool calls the same code as the matching REST endpoint.
What is the NevarMail MCP server?
It is one HTTPS endpoint that any MCP client (Claude, Cursor, your own agent framework) can connect to:
POST https://app.nevarmail.com/api/mcp- Stateless streamable HTTP. Each request is a JSON-RPC call; there are no sessions to keep alive.
GETopens a keepalive stream for clients that expect one, andDELETEanswers405. - Same rules as the API. A tool call runs the same validation, scope, test-mode and suppression checks as the REST endpoint it mirrors, and returns the same
{ "data": ... }shape. - Read-only until you say otherwise. Give the credential only read scopes and the agent cannot change anything.
How do I give an agent access?
There are two ways. Pick one per agent.
| MCP key | OAuth connection | |
|---|---|---|
| Best for | Your own agent, a script, a framework you run | A hosted assistant with a connector UI (for example Claude) |
| Where | Settings → API Keys | Settings → Connected Apps |
| Test mode | A Test key always sends in test mode | Follows your organization, project and use case settings; there is no test-mode variant |
| Revoke | Delete the key | Disconnect |
Option 1: create an MCP key
- Open Settings → API Keys and create a key.
- Set the key type to MCP. API-type keys are refused on the MCP endpoint (
403 KEY_TYPE_MISMATCH), and MCP keys are refused on/api/v1/*. - Choose Test while you are trying things out. A test key sends only in test mode, whatever the project's mode is.
- Pick the scopes the agent needs. The table below says which scope unlocks each tool.
- Copy the key once. It starts with
nvm_mcp_live_ornvm_mcp_test_, and NevarMail never shows it again.
Give the key to your MCP client as a bearer token:
Authorization: Bearer <your MCP key>Option 2: connect through OAuth
Open Settings → Connected Apps, find the Connect an AI agent card, and copy the discovery URL. Give it to your assistant as the server URL. A connection made this way reaches every project you can open; there is no per-project connection. The agent registers itself, sends you to NevarMail's consent screen, and receives a token limited to the scopes you approve and your role allows. Authenticate API requests explains the consent screen and how a role change narrows the grant.
One OAuth token works on both the MCP endpoint and the REST API. OAuth connections have no test-mode variant: sends follow the send mode of the organization, project and use case the agent sends from.
The Connected Apps page lists every active connection with its scopes and when it was last used. An organization administrator can Disconnect a connection, which revokes it for everyone in the organization who used it.
What should the agent call first?
whoami. It needs only org:read and tells the agent which organization and environment it is in, how it authenticated, whether the credential is a test key, which scopes it holds, and the organization's default send mode for new projects. That default is not the mode a send uses: each send resolves its use case's mode, else its project's, floored to test when the credential is a test key. The only way to rule out live mail is a Test key (Test mode and safe send).
{
"organization": { "id": "...", "name": "Example Co" },
"environment": "production",
"app_url": "https://app.nevarmail.com",
"auth": {
"method": "api_key",
"key_type": "mcp",
"credential_is_test": true,
"scopes": ["org:read", "domains:read", "templates:read"]
},
"default_send_mode_for_new_projects": "test"
}Which tools does the agent get?
The MCP server only lists the tools your credential's scopes and your role allow, so an agent with a read-only key never sees create_template. Each tool mirrors one REST endpoint; parameters and responses are documented once, in the API Reference.
Find your footing
| Tool | Scope | Mirrors |
|---|---|---|
whoami | org:read | No REST equivalent |
list_providers | providers:read | GET /api/v1/providers |
Set up a sending domain
| Tool | Scope | Mirrors |
|---|---|---|
list_domains | domains:read | GET /api/v1/domains |
get_domain | domains:read | GET /api/v1/domains/{id} |
get_domain_dns_records | domains:read | GET /api/v1/domains/{id}/dns-records |
create_domain | domains:write | POST /api/v1/domains |
verify_domain | domains:write | POST /api/v1/domains/{id}/verify |
See Connect your sending domain for the records the agent will ask you to publish.
Manage senders and templates
| Tool | Scope | Mirrors |
|---|---|---|
list_senders | senders:read | GET /api/v1/senders |
create_sender | senders:write | POST /api/v1/senders |
update_sender | senders:write | PATCH /api/v1/senders/{id} |
delete_sender | senders:write | DELETE /api/v1/senders/{id} |
list_templates | templates:read | GET /api/v1/templates |
get_template | templates:read | GET /api/v1/templates/{id} |
create_template | templates:write | POST /api/v1/templates |
update_template | templates:write | PATCH /api/v1/templates/{id} |
render_template | templates:read | POST /api/v1/templates/{id}/render |
render_template returns the subject, HTML and text for a set of variables without sending anything, which is the safe way for an agent to preview mail. Background: Senders and Templates.
Work with lists and contacts
| Tool | Scope | Mirrors |
|---|---|---|
list_lists | lists:read | GET /api/v1/lists |
get_list | lists:read | GET /api/v1/lists/{id} |
There is no tool for adding contacts; use the REST API or an import for that, as described in Sync contacts and lists from your own system.
Organize sending by use case
| Tool | Scope | Mirrors |
|---|---|---|
list_use_cases | use-cases:read | GET /api/v1/use-cases |
get_use_case | use-cases:read | GET /api/v1/use-cases/{id} |
create_use_case | use-cases:write | POST /api/v1/use-cases |
update_use_case | use-cases:write | PATCH /api/v1/use-cases/{id} |
archive_use_case | use-cases:write | DELETE /api/v1/use-cases/{id} |
restore_use_case | use-cases:write | POST /api/v1/use-cases/{id}/restore |
Archiving deletes nothing; restore_use_case undoes it. A project's default use case cannot be archived. What a use case is: Your first use case.
Send and measure
| Tool | Scope | Mirrors |
|---|---|---|
send_email_to_list | email:send | POST /api/v1/email/send-to-list |
get_analytics_summary | analytics:read | GET /api/v1/analytics/summary |
send_email_to_list is the only sending tool: it runs the same list sync, suppression and test-mode checks as the REST endpoint, and a test key sends in test mode. There is no single-recipient send tool; for that, call POST /api/v1/email/send with an API key (Send email).
Honor opt-outs
| Tool | Scope | Mirrors |
|---|---|---|
check_suppression | org:read | GET /api/v1/suppressions/check |
list_suppressions | org:read | GET /api/v1/suppressions |
add_suppressions | org:write | POST /api/v1/suppressions |
No tool removes a suppression. Removal is dashboard-only and asks for a written reason, as described in Bounces and suppressions.
What happens when a call is refused?
A refused call comes back as a tool error whose text starts with a code, so the agent can act on it:
| Code | Meaning |
|---|---|
SCOPE_DENIED | The credential does not hold the scope the tool needs |
PERMISSION_DENIED | Your role does not back that scope |
TOOL_NOT_FOUND | The tool name does not exist or is hidden from this credential |
VALIDATION_ERROR | The arguments did not match the tool's schema |
Every other code is the same as the REST API's, for example NOT_FOUND and RATE_LIMITED; see Error codes. An MCP key has the same per-key rate limit as an API key; an OAuth connection counts against the connecting user's limit instead (Rate limits). List tools page like the REST API: page starts at 1 and perPage is 1 to 100, 25 by default.
- Can an AI agent send email through NevarMail?
- Yes, to a list, with the email:send scope, through the send_email_to_list tool. It runs the same suppression and test-mode checks as the REST API. There is no single-recipient send tool; use POST /api/v1/email/send for that.
- How do I stop an agent from sending real mail while I test it?
- Create the MCP key as a Test key. A test key always sends in test mode, so mail only reaches your test recipients. OAuth connections have no test variant; they follow the send mode of the organization, project and use case.
- Why does the agent not see a tool that is in the table?
- The server lists only tools your credential's scopes and your role allow. Add the scope to the key, or ask an administrator for the permission behind it, and reconnect.
- Can I use my REST API key with the MCP server?
- No. The MCP endpoint accepts MCP-type keys (nvm_mcp_...) and OAuth tokens only; an API-type key gets 403 KEY_TYPE_MISMATCH. Create a second key with the MCP type.
Authenticate API requests
Create an API key, pick the right scopes, and read the responses the API sends back.
What recipient data does NevarMail actually store?
NevarMail is built to minimize recipient data on its systems and keep it in your own accounts wherever possible — here's exactly what is and isn't stored, by feature.