Repository avatar
AI Tools
v1.0.1
active

mcp

com.elasticemail/mcp

Send emails and manage contacts, lists, segments, templates and campaigns in Elastic Email.

Documentation

Elastic Email

Elastic Email MCP Server

The official Model Context Protocol server for the Elastic Email REST API v4. Written in C# / .NET.

MCP .NET Tools API Hosted mcptry License: MIT

Latest release Last commit Open issues GitHub stars

Hosted server • Installation • Quick start • Tools • Examples • Contributing


Features

  • Transactional and bulk email. Let your AI assistant send single messages or bulk sends, with plain content or an existing template.
  • Contacts and lists. Add, import, list and delete contacts, and create and manage contact lists.
  • Campaigns. Create, update, pause and list campaigns, including A/X split tests and scheduled sends.
  • Segments and templates. Create and read segments, and look up personal or global templates.
  • Statistics. Read opens, clicks and other numbers for one campaign or all of them.
  • Works with any MCP client. VS Code (GitHub Copilot agent mode), Cursor, Claude Code and other clients that speak MCP over HTTP.
  • Per-request authentication. Each client sends its own Elastic Email API key. The server keeps no credentials of its own.

Hosted server

You don't have to run anything yourself. Elastic Email hosts this server at https://mcp.elasticemail.com (Streamable HTTP). It's listed in the official MCP Registry as com.elasticemail/mcp.

Install in VS Code Install in Cursor

There are two ways to sign in:

  • OAuth (recommended). Add the URL with no headers. Your client opens an Elastic Email sign-in page through oidc.elasticemail.com the first time it connects. The install buttons above use this.
  • API key. Send your key in the X-Auth-Token header. See Requirements for the permissions it needs.
ClientOAuthAPI key
VS Code (.vscode/mcp.json)"elasticemail": { "type": "http", "url": "https://mcp.elasticemail.com" }Add "headers": { "X-Auth-Token": "${input:elasticemail-api-key}" }
Cursor (~/.cursor/mcp.json)"elasticemail": { "url": "https://mcp.elasticemail.com" }Add "headers": { "X-Auth-Token": "YOUR_API_KEY" }
Claude Codeclaude mcp add --transport http elasticemail https://mcp.elasticemail.com, then run /mcp to sign inAppend --header "X-Auth-Token: $ELASTICEMAIL_API_KEY"
Claude (claude.ai / desktop)Settings > Connectors > Add custom connector, URL https://mcp.elasticemail.com. See the Claude guide.Not needed

More detail: hosted MCP guide.

The rest of this README is about running the server yourself.

Requirements

RequirementVersion
.NET SDK10.0 or later
NetworkPort 5001 open for HTTP, outbound HTTPS to api.elasticemail.com
MCP clientAny client that supports MCP over HTTP

You'll also need an Elastic Email API key. You can create one in your API settings. Give it view and modify access to Account, Templates, Campaigns, Contacts, Files and Send HTTP, and at least view access to Access Tokens. The server rejects keys that can't list API keys.

Installation

Clone the repository and build it:

git clone https://github.com/ElasticEmail/elasticemail-mcp-server.git
cd elasticemail-mcp-server
dotnet build src/ElasticEmail.Mcp.Service.sln

The build restores its NuGet dependencies (ModelContextProtocol.AspNetCore, Newtonsoft.Json and Serilog.AspNetCore) for you.

Quick start

[!IMPORTANT] Elastic Email only sends from verified domains. Before your first send, verify your sending domain and use an address on that domain as the sender.

Run the server

dotnet run --project src/ElasticEmail.Mcp.Service.csproj

The server listens on http://0.0.0.0:5001/ and writes daily rolling logs to the working directory.

Connect VS Code (GitHub Copilot)

Add the server to .vscode/mcp.json in your workspace:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "elasticemail-api-key",
      "description": "Elastic Email API key",
      "password": true
    }
  ],
  "servers": {
    "elasticemail": {
      "type": "http",
      "url": "http://localhost:5001/",
      "headers": {
        "X-Auth-Token": "${input:elasticemail-api-key}"
      }
    }
  }
}

Then open Copilot Chat, switch to Agent mode, click Start above the server entry, and check that the Elastic Email tools are selected in the tools picker.

[!TIP] Keep your API key out of files you commit. The inputs prompt above asks for it once and stores it securely in VS Code.

Connect Claude Code

claude mcp add --transport http elasticemail http://localhost:5001/ \
  --header "X-Auth-Token: $ELASTICEMAIL_API_KEY"

Connect Cursor

Add the server to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "elasticemail": {
      "url": "http://localhost:5001/",
      "headers": {
        "X-Auth-Token": "YOUR_API_KEY"
      }
    }
  }
}

Try it

Ask your assistant something like:

The from address must use a domain you've verified in your Elastic Email account. If you leave it out, the server uses your account's default sender.

More examples

More complete, runnable samples are in the Elastic Email examples repository. It covers transactional email, SMTP, webhooks, inbound email, contacts and serverless platforms across 20+ languages and frameworks.

Authentication

HeaderSent byUsed for
X-Auth-TokenYour MCP client, on every requestYour Elastic Email API key. The server checks it against GET /v4/security/apikeys and forwards it on every API call.

Requests without the header, or with a key the API rejects, get 401 Unauthorized.

This repository supports API keys only. OAuth sign-in is available on the hosted server.

[!IMPORTANT] The server speaks plain HTTP, so the API key travels unencrypted. Keep it on localhost or a private network. If you expose it, put it behind a reverse proxy that terminates TLS.

API limits

The server calls the Elastic Email API v4 with your key, so the API's limits apply:

  • Up to 20 concurrent connections per account. The API doesn't return 429; a 5xx under load means slow down and retry with backoff
  • A request with no response for about 50 seconds fails with a gateway error (5xx)
  • Up to 50 recipients per POST /emails/transactional and 1000 contacts or suppressions per upload (413 above that)

Tools

The server exposes 26 tools in 6 groups: EmailSending, ContactsManagement, CampaignManagement, SegmentsManagement, TemplatesManagement and HealthCheck. Most tools return the API's JSON response as a string. Tools marked bool return only true or false.

Show all tools
GroupToolParametersDescription
EmailSendingSendTransactionalEmaildataSend a transactional email, with content or a template
EmailSendingSendBulkEmailsemailDataSend email to many recipients, with content or a template
ContactsManagementFetchContactslimit (default 20)Load contacts
ContactsManagementFetchContactHistoryemailLoad a contact's history
ContactsManagementAddContact (bool)email, firstName?, lastName?Add a contact
ContactsManagementDeleteContacts (bool)contacts? or rule?Delete contacts by email list or rule
ContactsManagementUploadContactsfileName, base64Content, listNameImport contacts from a file, creating the list if needed
ContactsManagementFetchListsLoad all contact lists
ContactsManagementFetchListlistNameLoad a list's details
ContactsManagementFetchListContactslistNameLoad the contacts in a list
ContactsManagementCreateListlistName, emailsCreate a list with the given contacts
ContactsManagementAddContactsToListlistName, emailsAdd contacts to a list
ContactsManagementRemoveContactsFromList (bool)listName, contacts? or rule?Remove contacts from a list
CampaignManagementCreateCampaigncampaignDataCreate and send a campaign
CampaignManagementListCampaignsLoad campaigns
CampaignManagementGetCampaignnameLoad a campaign
CampaignManagementUpdateCampaigncampaignDataUpdate a campaign (change its status to start it again)
CampaignManagementPauseCampaign (bool)namePause a campaign
CampaignManagementGetCampaignStatisticsnameLoad one campaign's statistics
CampaignManagementGetAllCampaignStatisticsLoad statistics for all campaigns
SegmentsManagementCreateSegmentsegmentData (Name, Rule)Create a segment
SegmentsManagementGetSegmentsLoad segments
SegmentsManagementGetSegmentnameLoad a segment
TemplatesManagementFetchTemplatesscopes, templateTypes?Load templates, filtered by scope and type
TemplatesManagementFetchTemplatenameLoad a template
HealthCheckIsReadyCheck the server and its connection to the API

Your MCP client shows each tool's full description and input schema. The source is in src/Tools.

Versioning

The server follows the Elastic Email API v4. Releases and release notes are listed in GitHub Releases.

Build details
  • API version: 4.0.0
  • Target framework: net10.0
  • MCP SDK: ModelContextProtocol.AspNetCore 0.4.0-preview.3
  • Transport: HTTP (Streamable HTTP and SSE), port 5001

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

This project follows the Contributor Covenant Code of Conduct.

Support

[!IMPORTANT] The fastest way to get help is the chat widget on elasticemail.com. Our support team can help with your account, sending, deliverability and API questions.

License

Released under the MIT License. Copyright © 2025–2026 Elastic Email.

No installation packages available.

Remote