Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Elastic Email MCP server

Vendor MCP
Open markdown

The Elastic Email MCP connector routes your AI agent's tool calls to Elastic Email's own MCP server through Scalekit. Each user signs in to Elastic Email once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 11 tools.

Tools
11
What they doRead · write · destructive
11 · 0 · 011 read0 write0 destructive
Users sign in with
OAuth app
Your own Elastic Email MCP server app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Elastic Email MCP connection

    In AgentKit > Connections, create an Elastic Email MCP connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Elastic Email MCP server connections use your own OAuth app. Register one with Elastic Email MCP server and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Elastic Email MCP connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'elasticemailmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Elastic Email MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'elasticemailmcp_get_domains',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • elasticemailmcp_fetch_templateUse to retrieve the full definition of a known template; do not use it to list or create templates.Read-only

    Fetch Template

    Use to retrieve the full definition of a known template; do not use it to list or create templates. Returns the template definition and has no side effects. If the name is empty or absent, use FetchTemplates to obtain an exact name, then retry.

    Inputs

    namestringrequired
    Exact name of the template. Use FetchTemplates to list the names on this account.
  • elasticemailmcp_fetch_templatesUse to list available templates by scope and optional editor type; do not use it to retrieve one template's full content.Read-only

    Fetch Templates

    Use to list available templates by scope and optional editor type; do not use it to retrieve one template's full content. Returns matching template records and has no side effects. Provide at least one scope; correct invalid filters or resolve the returned API error and retry.

    Inputs

    scopesarrayrequired
    Which template scopes to list. Allowed values: Personal: this account's own templates; Global: templates shared across accounts.
    templateTypesarray
    Optional filter on template type. Allowed values: RawHTML: editable HTML; DragDropEditor: drag-and-drop editor; TemplateEditor: block-based editor. Defaults to all three types.
  • elasticemailmcp_get_domainUse to inspect one configured domain by name; do not use it to list all domains or verify DNS.Read-only

    Get Domain

    Use to inspect one configured domain by name; do not use it to list all domains or verify DNS. Returns the API v5 agent envelope, with the domain in data and any required DNS work in next_steps. It has no side effects. If the name is unknown, use GetDomains, then retry with its exact name.

    Inputs

    domainstringrequired
    Name of the domain, e.g. yourdomain.com. Use GetDomains to list them.
  • elasticemailmcp_get_domainsUse to list domains configured for the account; do not use it to inspect or verify one known domain.Read-only

    Get Domains

    Use to list domains configured for the account; do not use it to inspect or verify one known domain. Returns the API v5 agent envelope: data contains the domain records, page states whether more results exist, and next_steps gives the next page operation. It has no side effects. If the request is refused, resolve the returned blockers and retry.

    Inputs

    limitinteger
    Maximum number of domains to return. Use the page data and next_steps to request every page.default 50
    offsetinteger
    Number of domains to skip. Start at 0, then use the offset in the page.next operation.default 0
  • elasticemailmcp_get_email_event_historyUse to inspect retained delivery and engagement events for one sent message ID; do not use it to send, edit, or search email messages.Read-only

    Get Email Event History

    Use to inspect retained delivery and engagement events for one sent message ID; do not use it to send, edit, or search email messages. Returns the message event history and EventHorizon retention state, and has no side effects. If no events are available yet, retry shortly; if EventHorizon.HistoryComplete is false, the message log partition has expired.

    Inputs

    msgIdstringrequired
    Msg ID, as returned by SendTransactionalEmail or GetEmailEvents.
  • elasticemailmcp_get_email_eventsUse to list delivery and engagement events for emails on the account; do not use it to inspect rendered message content or send email.Read-only

    Get Email Events

    Use to list delivery and engagement events for emails on the account; do not use it to inspect rendered message content or send email. Returns matching v4 event records, including TransactionID and MsgID, and has no side effects. Filter by v4 event type and UTC time range. If no records match, correct the filters or retry with a broader range.

    Inputs

    eventTypesarray
    Optional v4 event types to include. Omit to return every available event type.
    fromstring
    Start of the range, inclusive. Converted to UTC before the query is made.
    limitinteger
    Maximum event records to return, from 1 to 1000. Omit for the API default.
    offsetinteger
    Number of matching event records to skip before returning results.default 0
    orderBystring
    Sort order for event timestamps.one of DateDescendingDateAscendingdefault DateDescending
    tostring
    End of the range, inclusive. Converted to UTC before the query is made.
  • elasticemailmcp_get_sent_emailsUse to list sent-email events in an optional UTC time range; do not use it to inspect a message body or send email.Read-only

    Get Sent Emails

    Use to list sent-email events in an optional UTC time range; do not use it to inspect a message body or send email. Returns matching sent events and has no side effects. If the request fails, correct the range or resolve the returned API error and retry.

    Inputs

    fromstring
    Start of the range, inclusive. Converted to UTC before the query is made.
    tostring
    End of the range, inclusive. Converted to UTC before the query is made.
  • elasticemailmcp_get_sent_emails_by_transaction_idUse to retrieve send events for one transaction ID; do not use it to search by recipient or inspect a message body.Read-only

    Get Sent Emails By Transaction Id

    Use to retrieve send events for one transaction ID; do not use it to search by recipient or inspect a message body. Returns matching events and has no side effects. If the transaction ID is unknown, obtain it from a send result or GetSentEmails and retry.

    Inputs

    transactionIdstringrequired
    Transaction ID returned when the email was sent.
    fromstring
    Start of the range, inclusive. Converted to UTC before the query is made.
    limitinteger
    Maximum event records to return. Omit for the API default.
    offsetinteger
    Number of matching event records to skip before returning results.default 0
    tostring
    End of the range, inclusive. Converted to UTC before the query is made.