> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Elastic Email MCP server

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.

**Authentication:** OAuth 2.1/DCR
**Categories:** Marketing, Communication
**Tools:** 11: 11 read, 0 write, 0 destructive
**Users sign in with:** OAuth
**OAuth app:** Your own Elastic Email MCP server app
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=ELASTICEMAILMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".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](/agentkit/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

   **Node.js** (`quickstart.mts`)

   ```typescript
   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)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "elasticemailmcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Elastic Email MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="elasticemailmcp_get_domains",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'elasticemailmcp_fetch_template',
  toolInput: {
    name: '<name>',
  },
  connector: 'elasticemailmcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="elasticemailmcp_fetch_template",
    tool_input={
        "name": "<name>",
    },
    connection_name="elasticemailmcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `elasticemailmcp_fetch_template`

Fetch Template · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Exact name of the template. Use FetchTemplates to list the names on this account.

Example input: `{"name":"<name>"}`

### `elasticemailmcp_fetch_templates`

Fetch Templates · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `scopes` (`array`, required): Which template scopes to list. Allowed values: Personal: this account's own templates; Global: templates shared across accounts.
- `templateTypes` (`array`, optional): Optional filter on template type. Allowed values: RawHTML: editable HTML; DragDropEditor: drag-and-drop editor; TemplateEditor: block-based editor. Defaults to all three types.

Example input: `{"scopes":[]}`

### `elasticemailmcp_get_domain`

Get Domain · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `domain` (`string`, required): Name of the domain, e.g. yourdomain.com. Use GetDomains to list them.

Example input: `{"domain":"<domain>"}`

### `elasticemailmcp_get_domains`

Get Domains · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `limit` (`integer`, optional): Maximum number of domains to return. Use the page data and next_steps to request every page. Default: `50`.
- `offset` (`integer`, optional): Number of domains to skip. Start at 0, then use the offset in the page.next operation. Default: `0`.

Example input: `{}`

### `elasticemailmcp_get_email_event_history`

Get Email Event History · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `msgId` (`string`, required): Msg ID, as returned by SendTransactionalEmail or GetEmailEvents.

Example input: `{"msgId":"<msgId>"}`

### `elasticemailmcp_get_email_events`

Get Email Events · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `eventTypes` (`array`, optional): Optional v4 event types to include. Omit to return every available event type.
- `from` (`string`, optional): Start of the range, inclusive. Converted to UTC before the query is made.
- `limit` (`integer`, optional): Maximum event records to return, from 1 to 1000. Omit for the API default.
- `offset` (`integer`, optional): Number of matching event records to skip before returning results. Default: `0`.
- `orderBy` (`string`, optional): Sort order for event timestamps. One of: `DateDescending`, `DateAscending`. Default: `DateDescending`.
- `to` (`string`, optional): End of the range, inclusive. Converted to UTC before the query is made.

Example input: `{}`

### `elasticemailmcp_get_sent_emails`

Get Sent Emails · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `from` (`string`, optional): Start of the range, inclusive. Converted to UTC before the query is made.
- `to` (`string`, optional): End of the range, inclusive. Converted to UTC before the query is made.

Example input: `{}`

### `elasticemailmcp_get_sent_emails_by_transaction_id`

Get Sent Emails By Transaction Id · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `transactionId` (`string`, required): Transaction ID returned when the email was sent.
- `from` (`string`, optional): Start of the range, inclusive. Converted to UTC before the query is made.
- `limit` (`integer`, optional): Maximum event records to return. Omit for the API default.
- `offset` (`integer`, optional): Number of matching event records to skip before returning results. Default: `0`.
- `to` (`string`, optional): End of the range, inclusive. Converted to UTC before the query is made.

Example input: `{"transactionId":"<transactionId>"}`

### `elasticemailmcp_get_suppression_list`

Get Suppression List · Read-only

Use to list existing contact suppressions; do not use it to inspect, add or remove one. Returns the API v5 envelope unchanged: page states whether more results exist and how to request them. It has no side effects. To decide whether a suppression may be removed, inspect that recipient instead. If the request fails, resolve the API error and retry.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `limit` (`integer`, optional): Maximum number of suppressions to return. Use the page data to request every page. Default: `50`.
- `offset` (`integer`, optional): Number of suppressions to skip. Start at 0, then use the next page offset. Default: `0`.

Example input: `{}`

### `elasticemailmcp_is_ready`

Is Ready · Read-only

Use to check whether this MCP server can reach the Elastic Email API; do not use it to validate credentials, send email, or inspect account data. Returns healthy, an API connectivity status, or not healthy. It has no side effects; retry after resolving the reported service or network issue.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `elasticemailmcp_view_email`

View Email · Read-only

Use to inspect the rendered content of one sent email by MsgID; do not use it to send, edit, or search emails. Returns the email, including its body. It has no side effects. Use the MsgID returned by SendTransactionalEmail or GetSentEmails; if it is missing or not found, obtain a valid ID and retry.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `msgId` (`string`, required): MsgID of the sent email, as returned by SendTransactionalEmail or GetSentEmails.

Example input: `{"msgId":"<msgId>"}`

## Related

Other Marketing connectors ([all 190](/agentkit/connectors/?category=marketing)):

- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twitter / X](/agentkit/connectors/twitteroauth/): Scalekit connector, OAuth, 92 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
