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 URL | https://agent.maillayer.com/api/mcp |
| Transport | Streamable HTTP |
| Authentication | Authorization: Bearer ml_… with an API key from the dashboard |
Connect your client#
Claude Code
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:
[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:
export MAILLAYER_API_KEY="YOUR_MAILLAYER_API_KEY"
Cursor
{
"mcpServers": {
"maillayer": {
"url": "https://agent.maillayer.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_MAILLAYER_API_KEY"
}
}
}
}Claude Desktop
{
"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#
| Tool | What it does |
|---|---|
send_email | Send one transactional email, with HTML or a template. |
get_email | Delivery status and events of a sent email. |
list_domains | Domains you can send from. |
list_templates | Saved templates with id, alias and subject. |
get_template | A template's HTML, subject and preview text. |
save_template | Create a template, or update the one with the same alias. |
upsert_contact | Create or update a contact, add it to lists, set location. |
list_lists | Contact lists with their sizes. |
create_campaign | Create a draft for one or more lists. Sends nothing. |
send_campaign | Send or schedule a draft, optionally with warmup. |
get_campaign | Status and results of a campaign. |
list_campaigns | Recent 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#
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.