Skip to main content
mailers.io

API and MCP

Using the MCP endpoint with an AI assistant

By mailers.io team Published 5 min read

An AI assistant that can read your lists, add a contact or check a template is useful in a narrow way. It saves you from copying ids and writing a one-off script. The MCP endpoint is how mailers.io lets an assistant do that, using the same API your own code would use. This post shows how to connect one, what it can reach, and the precautions worth taking before you do.

What MCP is, in one paragraph

The Model Context Protocol is a standard way for an AI assistant to discover and call tools that live on a server. The assistant asks the server what tools exist, then calls them with arguments, and gets text back. On mailers.io the server is part of the API, at POST /api/v3/mcp. It answers JSON-RPC 2.0 messages and is a separate thing from the REST endpoints, though it calls them on your behalf.

How the tools are made

You do not get a hand-written list of MCP tools. Every other operation in the /api/v3 OpenAPI description becomes a tool automatically. That has useful consequences.

  • The tools match the API. When the API gains an operation, the tool appears.
  • The list depends on the key. A tool is shown only when the key’s scopes allow it. A key with lists.read and mcp sees the read-only list tools and none of the others.
  • Tools are marked with hints. Reading operations are marked read-only, and operations that change or remove something are marked destructive, so a client can ask you before running them. The hints are guidance for the client. The scopes are the real limit.
  • The scope is written in each tool’s description, so the assistant can see why a tool is missing.

For what the underlying operations are, see the developer docs at https://docs.mailers.io/ and the API overview.

Connecting it

First make a key in the app. Give it the mcp scope and, as a separate decision, the scopes for the tools you want. For a first trial, lists.read, contacts.read and templates.read are a sensible set: the assistant can look around and cannot change anything. Read API key scopes and key hygiene first if you have not worked with scopes before.

Then add the server to your client. In Claude Code, the command takes the endpoint and the key as a header:

claude mcp add --transport http mailers https://app.mailers.io/api/v3/mcp \
  --header "Authorization: Bearer <key>"

Use the host shown in the developer docs. Other clients have a settings screen asking for a URL and a header; the values are the same.

Once connected, ask the assistant to list what it can do. It should list tools that match your scopes, and no more.

What the protocol supports

The server is deliberately simple.

  • Stateless. Every request stands alone. There are no sessions to keep alive or lose.
  • One message per request. Batches are not supported.
  • No event stream. A GET to the endpoint always answers 405. The server does not push anything to the client.
  • Protocol versions. The server supports 2025-11-25 and 2025-06-18. A client that asks for another version is told which ones are supported.
  • Origin check. A request that carries an Origin header the server does not accept is refused. This matters for browser-based clients; ordinary desktop and command-line clients do not send one.

A tool that fails because of a bad argument, a missing record or a rate limit does not break the conversation. The failure comes back as a tool result marked as an error, with the API’s message, so the assistant can read it and correct itself.

What an assistant is good for here

These are tasks where a model that can call the API helps, and where a mistake is cheap.

  • Looking things up. “Which of my lists has the most contacts?” or “Show me the template called Welcome.”
  • Tidying contacts. Updating a field, or unsubscribing a person who wrote to you asking to be removed.
  • Drafting a template. The API has a guide for builder-format templates, which an assistant can read and use to create a template that you then open in the app and edit.
  • Checking delivery. With messages.read, it can read recent messages and their delivery events.

What it cannot do

It can do only what the API does. There is no campaign endpoint, so an assistant cannot create or send a campaign. There is no credits or balance endpoint. It cannot edit a sequence’s steps; it can enrol one contact at a time. It cannot change your servers, domains or plan. Webhooks are not part of current plans and so are not something to build on.

Limits

Each tool call counts twice against your rate limit, once for the MCP request and once for the API call it makes underneath. The default is 600 requests a minute per account, and a key has its own limit too. An assistant that loops over hundreds of contacts will reach it quickly. Ask it to work in small batches, or do bulk work by import in the app instead.

Keeping it safe

An assistant that reads data written by other people can be fooled by it. A contact’s name or a custom field could contain text that looks like an instruction. If the assistant has a powerful key, that text becomes a way to use the key. The defence is the same as for any other credential: give it little.

  • A dedicated key. Make a key for the assistant alone, with its own expiry, so you can revoke it without touching anything else.
  • No send scope unless you have a specific reason. An assistant that can send e-mail can send it to the wrong people. Leaving send off means the worst case is a messy list, not a message to a customer.
  • Think before contacts.write. It includes deletion. Granting it is fine for a supervised session; it is not for an unattended one.
  • Keep a person in the loop for outreach. An assistant can help prepare a list. You decide whom to write to, and you write the steps in the app. See cold email through an API and MCP.
  • Check the log. Messages and changes made through a key are tied to that key, so you can see what it did.

Where to go next

The MCP page gives the short version. The developer docs at https://docs.mailers.io/ have the endpoint details and the OpenAPI description from which the tools are built.

Questions and answers

Which assistants work with it?

Any MCP client that supports a remote server over HTTP with a custom header. The endpoint speaks JSON-RPC 2.0 over Streamable HTTP, in the stateless style.

Can the assistant send a campaign?

No. The API has no campaign endpoint, so there is no tool for it. It can only do what the API can do.

Does the key need a special scope?

Yes. It needs the mcp scope to reach the endpoint, plus the scope of each tool you want the assistant to see.

Written by the mailers.io team. Published .

Keep reading

Related posts

Send cold e-mail from your own servers.

Connect your servers, import a list and write the steps. Replies stop the sequence.

  • 7-day money-back guarantee
  • Bring your own providers
  • Cancel anytime