Connect your AI agent

Connect Claude, Codex, Cursor or any MCP client to Maillayer, then just ask: send email, add contacts, write templates and run campaigns.

Maillayer has a built-in MCP (Model Context Protocol) server. Connect it to Claude, Codex, Cursor or any MCP client and your agent can send email, manage contacts, write templates and draft campaigns, using your own words.

Server URLhttps://agent.maillayer.com/api/mcp
TransportStreamable HTTP
AuthenticationAuthorization: Bearer ml_… with an API key from the dashboard

Connect your client#

Claude Code

Terminal
claude mcp add --transport http maillayer https://agent.maillayer.com/api/mcp \
  --header "Authorization: Bearer YOUR_MAILLAYER_API_KEY"

Codex (OpenAI)

Works in the Codex CLI, IDE extension and Codex app. Add the server to your Codex config:

~/.codex/config.toml
[mcp_servers.maillayer]
url = "https://agent.maillayer.com/api/mcp"
bearer_token_env_var = "MAILLAYER_API_KEY"

Codex reads the key from that environment variable, so set it in your shell profile and restart Codex:

~/.zshrc
export MAILLAYER_API_KEY="YOUR_MAILLAYER_API_KEY"

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "maillayer": {
      "url": "https://agent.maillayer.com/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_MAILLAYER_API_KEY"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json
{
  "mcpServers": {
    "maillayer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://agent.maillayer.com/api/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer YOUR_MAILLAYER_API_KEY"
      }
    }
  }
}

Needs Node.js. Restart Claude Desktop after saving.

Other clients

Windsurf, GitHub Copilot and other MCP clients work the same way: add a remote (HTTP) server with the URL above and the Authorization header. ChatGPT on the web only connects to MCP servers through its own plugins, so use Codex for OpenAI models today.

Tools#

ToolWhat it does
send_emailSend one transactional email, with HTML or a template.
get_emailDelivery status and events of a sent email.
list_domainsDomains you can send from.
list_templatesSaved templates with id, alias and subject.
get_templateA template's HTML, subject and preview text.
save_templateCreate a template, or update the one with the same alias.
upsert_contactCreate or update a contact, add it to lists, set location.
list_listsContact lists with their sizes.
create_campaignCreate a draft for one or more lists. Sends nothing.
send_campaignSend or schedule a draft, optionally with warmup.
get_campaignStatus and results of a campaign.
list_campaignsRecent campaigns with their stats.
send_campaign emails real people and can't be undone, so it is marked as destructive. Good clients ask you before running it.

Things to ask#

Prompts
Send a welcome email from [email protected] to [email protected] using the "welcome" template.

Add these 3 people to my Beta list: …

Draft a campaign to Newsletter and Customers about our new pricing. Show me before sending.

How did last week's campaign do? Which links got the most clicks?

Prefer code? Everything the agent can do is also in the REST API. Point any AI tool at /llms.txt for a plain-text map of these docs.