Skip to content
View as Markdown

MCP server for AI agents ​

MarleyFetch runs an MCP server at https://api.marleyfetch.com/mcp. Connect an agent to it and it can check your plan and limits, send email, manage templates and audiences, and run batches itself instead of writing API calls. Email goes out through your own SMTP connection, from your own address.

Connect by signing in ​

In Claude Code, add the server, then run /mcp inside Claude Code and authenticate:

bash
claude mcp add --transport http marleyfetch https://api.marleyfetch.com/mcp

In Claude on the web or desktop, and other MCP clients that support OAuth, add a custom connector with the URL https://api.marleyfetch.com/mcp.

A browser window opens. Sign in with the Google account you use for the dashboard, pick the connection the agent may send from, and choose Allow. You need at least one active SMTP connection first.

Allowing creates an API key named MCP: <app name>, locked to that connection. It lasts 90 days, after which the agent asks you to sign in again.

Connect with an API key ​

For CI and other places without a browser, send an API key in a header instead:

bash
claude mcp add --transport http marleyfetch https://api.marleyfetch.com/mcp \
  --header "Authorization: Bearer $MARLEYFETCH_API_KEY"

To share it with a project, commit a .mcp.json. The key stays in each person's environment:

json
{
  "mcpServers": {
    "marleyfetch": {
      "type": "http",
      "url": "https://api.marleyfetch.com/mcp",
      "headers": { "Authorization": "Bearer ${MARLEYFETCH_API_KEY}" }
    }
  }
}

Give the agent its own key locked to one connection, so it can only send as that address.

Tools ​

Each tool calls the matching REST endpoint with your key, so the same plan gates, quotas and error codes apply. Pro-only tools return FEATURE_NOT_AVAILABLE on the Free plan.

ToolDoesEndpointPlan
get_accountPlan, limits, and the connections the agent can send from with their quotasGET /v1/accountAll
send_emailSend one email to up to 10 recipientsPOST /v1/sendAll
send_template_emailSend a saved template by name, passing only its variablesPOST /v1/send/templateAll (enqueue: Pro)
enqueue_emailQueue an email; if the connection's quota is used up, it's sent when the quota resetsPOST /v1/enqueuePro
list_templates, get_templateRead saved templatesGET /v1/templatesAll
create_templateSave a template with {{placeholders}}POST /v1/templatesAll (Free: 3)
list_audiences, create_audienceRead and create recipient lists/v1/audiencesPro
add_audience_membersAdd members with per-member variablesPOST /v1/audiences/{id}/membersPro
send_batchSend a template or content to an audience or up to 1,000 addressesPOST /v1/send/batchPro
get_batchFollow a batch's progressGET /v1/batches/{id}Pro

When the agent connects, the server tells it to call get_account first, so it knows your limits before it plans a send. On Pro it's also told to queue non-urgent or many emails with enqueue_email, and anything send_email couldn't send because of a quota or rate limit, and to use send_email when it needs to confirm delivery.

What the agent can and can't do ​

With its key, an agent can:

  • send from the one connection the key is locked to, including batches to your audiences on Pro
  • see your plan, usage, templates and audiences, and create templates and audiences.

It can't read your inbox, because MarleyFetch only sends. It can't send from your other connections, and every email counts against your plan and the connection's quota. Everything it sends appears in your delivery log.

Claude Code asks your permission before each tool call unless you allow the tool permanently. If you allow a sending tool, the agent can send without asking, including from /loop and scheduled runs.

Disconnecting an agent ​

Delete its MCP: <app name> key on the API keys page. Its next call fails, and the agent has to be connected again.

Example prompts ​

  • "What's my MarleyFetch plan and how much quota is left?"
  • "Run the tests. If anything fails, email me the failing tests and the errors."
  • "Summarize what we changed today and email it to the team."
  • "Save a template called Welcome that greets {{first_name}}, then send it to the Beta testers audience."
  • "Draft a follow-up to alice@example.com about the migration. Show me before sending."