> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reallyquickemails.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Connect your ReallyQuickEmails account to Claude, Cursor or another AI client and operate your project by chatting.

The ReallyQuickEmails **MCP server** exposes your project through the [Model Context Protocol](https://modelcontextprotocol.io). Connect it to claude.ai, Claude Desktop, Cursor or Claude Code and your assistant can query your contacts, campaigns, metrics and automations, answering in natural language.

<Info>
  Your assistant can **query** data, **modify** contacts and segments, **create draft campaigns** (which you review and send from the app), **enroll contacts into automations**, and even **send email** — each capability behind its own permission, granted by you when creating the key. **Building complete automations by chat is coming soon.**
</Info>

The connection is secure by design:

* **The server holds no database credentials.** It authenticates each call with your MCP key and forwards it to the API; the project is resolved from the key, never from what the assistant asks for. A key from one project cannot read another.
* **Each key carries its own permissions.** The assistant only sees, and can only use, the tools its permissions enable.
* **You can revoke it any time** and access is cut on the next call.

***

## From claude.ai (fastest)

On claude.ai you don't need to create a key by hand or edit any config file:

<Steps>
  <Step title="Add the connector">
    Open **Settings → Connectors → Add custom connector** and paste the URL:

    ```
    https://mcp.reallyquickemails.com/mcp
    ```
  </Step>

  <Step title="Authorize">
    Claude takes you to a ReallyQuickEmails screen. Sign in if you weren't already, pick the
    **project** you want to connect, check whether you also want to allow **creating and editing**,
    and click **Authorize**.

    That's it: the app issues the key for you and the connector is ready.
  </Step>
</Steps>

<Info>
  The issued key shows up under **Integrations → API Keys → MCP Keys**, named after the client you
  connected. To disconnect the connector, revoke it there.
</Info>

<Warning>
  This path **never grants `sends:execute`** (sending real email). If you want your assistant to
  send on your behalf, create the key by hand with that permission and connect using the method
  below.
</Warning>

***

## With a key (Claude Desktop, Cursor, Claude Code)

Clients that accept headers in their config use your MCP key directly.

<Steps>
  <Step title="Create an MCP key">
    1. Open the [dashboard](https://app.reallyquickemails.com) and select your project.
    2. In the sidebar go to **Integrations → API Keys**.
    3. Scroll to the **MCP Keys** section and click **Create key**.
    4. Give it a name and check the **permissions** you want to grant (see [Permissions](#permissions)). Grant only what the assistant needs.
    5. Copy the key (`rqe_mcp_...`).

    <Warning>
      The full key is shown **only once**. If you lose it, revoke it and create a new one. Never paste it into client-side code or repositories.
    </Warning>

    <Warning>
      **REST API keys** (`sk_proj_...`) **do not work on the MCP** — they return 401. The MCP uses its own key type (`rqe_mcp_...`), with granular permissions, created in this same section.
    </Warning>
  </Step>

  <Step title="Connect your AI client">
    Use the endpoint `https://mcp.reallyquickemails.com/mcp` with your key in the `X-API-Key` header.

    <Tabs>
      <Tab title="Claude Desktop">
        Open **Settings → Developer → Edit Config** and add your server. You can also edit `claude_desktop_config.json` directly:

        ```json theme={null}
        {
          "mcpServers": {
            "reallyquickemails": {
              "url": "https://mcp.reallyquickemails.com/mcp",
              "headers": { "X-API-Key": "rqe_mcp_your_key" }
            }
          }
        }
        ```

        Restart Claude Desktop. The server shows up in the tools picker.
      </Tab>

      <Tab title="Cursor">
        Edit `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per project):

        ```json theme={null}
        {
          "mcpServers": {
            "reallyquickemails": {
              "url": "https://mcp.reallyquickemails.com/mcp",
              "headers": { "X-API-Key": "rqe_mcp_your_key" }
            }
          }
        }
        ```

        Enable it under **Settings → MCP**.
      </Tab>

      <Tab title="Claude Code">
        Add it with one command:

        ```bash theme={null}
        claude mcp add reallyquickemails \
          --transport http \
          https://mcp.reallyquickemails.com/mcp \
          --header "X-API-Key: rqe_mcp_your_key"
        ```

        Verify with `claude mcp list`.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Verify the connection">
    Ask your assistant something simple, for example:

    > Which ReallyQuickEmails project am I connected to?

    It will call the `whoami` tool and answer with your project name and the key's permissions. If you see an authorization error instead, check that you copied the full key and that it is not revoked.
  </Step>
</Steps>

***

## Permissions

Each key grants one or more permissions. The assistant **does not see** the tools it wasn't authorized for, and if it tries to use them anyway, the call is rejected.

| Permission          | Enables                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `contacts:read`     | Contacts, their activity, events, senders, domains and the suppression list                                         |
| `contacts:write`    | Create/update contacts, tags, attributes, events and suppression                                                    |
| `campaigns:read`    | Campaigns and their metric reports                                                                                  |
| `campaigns:write`   | Create campaigns **as drafts** (never sends them)                                                                   |
| `reports:read`      | Aggregated project metrics over a date range                                                                        |
| `segments:read`     | Segments and their rules                                                                                            |
| `segments:write`    | Create segments                                                                                                     |
| `templates:read`    | Templates (metadata, not the email body)                                                                            |
| `templates:write`   | Create email templates from HTML                                                                                    |
| `automations:read`  | Automations and their reports                                                                                       |
| `automations:write` | Enroll contacts into active automations                                                                             |
| `sends:execute`     | **Send real email.** The most sensitive permission — grant it only if you want the assistant to send on your behalf |

<Tip>
  Start with the minimum. If you only want the assistant to analyze campaign performance, `campaigns:read` and `reports:read` are enough. Grant write permissions (`:write`) only if you want the assistant to modify your data.
</Tip>

<Warning>
  Write permissions modify your real data. Only `sends:execute` sends email directly, but keep in mind that **adding a tag, tracking an event or enrolling into an active automation can result in a send** if you have flows configured with those triggers. Grant them intentionally.
</Warning>

***

## Available tools

<AccordionGroup>
  <Accordion title="Contacts — contacts:read">
    | Tool                   | What it does                                             |
    | ---------------------- | -------------------------------------------------------- |
    | `list_contacts`        | Lists contacts with search by email or name              |
    | `get_contact`          | A single contact by its UUID, with its data and segments |
    | `get_contact_activity` | What happened to a contact: emails received and events   |
    | `list_events`          | Custom events tracked for the project                    |
    | `get_suppression_list` | Suppressed addresses that will not receive email         |
    | `list_senders`         | Verified sender identities of the project                |
    | `list_domains`         | Sending domains and their authentication status          |
  </Accordion>

  <Accordion title="Campaigns — campaigns:read">
    | Tool                  | What it does                                                     |
    | --------------------- | ---------------------------------------------------------------- |
    | `list_campaigns`      | Campaigns with their status and counters                         |
    | `get_campaign_report` | Metrics of one campaign: sent, delivered, opens, clicks, bounces |
  </Accordion>

  <Accordion title="Metrics, segments, templates and automations">
    | Tool                    | Permission         | What it does                                                                                                                      |
    | ----------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
    | `get_metrics`           | `reports:read`     | Aggregated project metrics over a range                                                                                           |
    | `list_segments`         | `segments:read`    | Segments with their size and rule                                                                                                 |
    | `list_templates`        | `templates:read`   | Project templates (metadata)                                                                                                      |
    | `get_template`          | `templates:read`   | One template WITH its content: final HTML and editable source — to verify subject, preheader, links and body against the database |
    | `list_automations`      | `automations:read` | Automations with their status and real trigger                                                                                    |
    | `get_automation`        | `automations:read` | One automation WITH its node graph and connections — to audit a flow before activating it                                         |
    | `get_automation_report` | `automations:read` | Performance of one automation: sent, opened, clicked                                                                              |
    | `get_automation_runs`   | `automations:read` | The runs of one automation: who it fired for, when and how it ended                                                               |
  </Accordion>

  <Accordion title="Diagnostics — integrations:read">
    To answer "why didn't my flow trigger?" without waiting for support.

    | Tool                             | What it does                                                                                             |
    | -------------------------------- | -------------------------------------------------------------------------------------------------------- |
    | `get_shopify_integration_status` | Health of the Shopify integration: subscribed vs expected webhooks, events received, rejected deliveries |
    | `list_checkout_events`           | Shopify checkouts that reached the platform, with their processing state                                 |
    | `diagnose_automation`            | Walks the full abandoned-cart chain and names the first broken link                                      |
  </Accordion>

  <Accordion title="Writing — contacts:write / segments:write / campaigns:write / automations:write">
    These modify real data. None of them send email directly, but the ones marked can trigger active automations that do send.

    | Tool                   | Permission          | What it does                                                                                                  |
    | ---------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------- |
    | `upsert_contacts`      | `contacts:write`    | Creates or updates up to 1000 contacts by email, with attributes and segments. May trigger new-contact flows  |
    | `add_tags`             | `contacts:write`    | Adds tags to an existing contact (merged, no duplicates). May trigger tag-based flows                         |
    | `set_attributes`       | `contacts:write`    | Adds or updates attributes on an existing contact (the rest are kept)                                         |
    | `track_event`          | `contacts:write`    | Tracks a custom event (purchase, signup…). May trigger event-based flows                                      |
    | `suppress_email`       | `contacts:write`    | Adds addresses to the suppression list (they stop receiving email)                                            |
    | `create_segment`       | `segments:write`    | Creates an empty segment; you fill it from the app afterwards                                                 |
    | `create_template`      | `templates:write`   | Creates an email template from HTML and returns the link to open it in the editor. Images must be public URLs |
    | `create_campaign`      | `campaigns:write`   | Creates a campaign **always as a draft** — you review, complete and send it from the app                      |
    | `enroll_in_automation` | `automations:write` | Enrolls a contact into an **active** automation — the flow runs immediately and may email them                |
  </Accordion>

  <Accordion title="Sending — sends:execute">
    | Tool         | What it does                                                                                                                                                                                              |
    | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `send_email` | **Sends a real email immediately** (up to 50 recipients), from a verified sender of the project. Supports `idempotency_key`: the same key within 24h returns the previous result instead of sending again |

    <Warning>
      `send_email` is not a draft and cannot be undone. Grant `sends:execute` only to keys whose assistant should send on your behalf, and revoke it when no longer needed.
    </Warning>
  </Accordion>

  <Accordion title="Identity — no permission">
    | Tool     | What it does                                                                  |
    | -------- | ----------------------------------------------------------------------------- |
    | `whoami` | The project the key belongs to and its permissions. Any valid key can call it |
  </Accordion>
</AccordionGroup>

***

## Partner mode (manage your client portfolio)

If you're a **partner** managing several clients (each one an RQE project), you can connect the MCP with your **partner key** (`sk_partner_...`) instead of a project key. In that mode, **a single connection** operates at the organization level and exposes 3 tools to manage your portfolio:

| Tool               | What it does                                                                       |
| ------------------ | ---------------------------------------------------------------------------------- |
| `list_clients`     | Lists your client projects (id, name, slug, status).                               |
| `create_client`    | Creates a new client project and returns its `api_key` (`sk_proj_`) to operate it. |
| `get_client_stats` | 30-day metrics (sent, delivered, opens, clicks) for one client.                    |

```json theme={null}
{
  "mcpServers": {
    "reallyquickemails-partner": {
      "url": "https://mcp.reallyquickemails.com/mcp",
      "headers": { "Authorization": "Bearer sk_partner_xxxxxxxxxxxx" }
    }
  }
}
```

<Info>
  Partner mode operates **per organization**: `list_clients`/`get_client_stats` only see projects in your org, and `create_client` creates them inside it. To operate a client in detail (send, contacts, campaigns), use its project `api_key` with the regular MCP. Endpoint details in [Partner / Provisioning](/en/api-reference/partner).
</Info>

## Revoke a key

Under **Integrations → API Keys → MCP Keys**, click **Revoke** on the key. Access is cut on the next call; an assistant using it will get an authorization error. The revoked key stays listed for your records and cannot be reactivated.

## FAQ

<AccordionGroup>
  <Accordion title="How is this different from my regular API Key?">
    Your API Key (`sk_...`) gives full access to the API, including sending email, and is meant for your own backend. The MCP key (`rqe_mcp_...`) has granular permissions and is meant to connect a third-party AI assistant with exactly the access you decide. Never paste your `sk_...` into an AI client.
  </Accordion>

  <Accordion title="Can the assistant send email or delete data?">
    It can send email **only** if you granted `sends:execute` — without that permission it does not even see the send tool. Campaigns it creates are always drafts, and you send them from the app. It does not delete contacts or data: there are no delete tools. Each capability is a separate permission you grant explicitly when creating the key.
  </Accordion>

  <Accordion title="Can it build complete automations (flows)?">
    Not yet — that is **coming soon**. Today it can enroll contacts into automations you already built (with `automations:write`) and check their performance, but designing the flow itself (nodes, triggers, conditions) happens in the app.
  </Accordion>

  <Accordion title="Can I have multiple keys?">
    Yes. One key per client or per use, each with the minimum permissions, is good practice so you can revoke one without affecting the rest.
  </Accordion>

  <Accordion title="Why won't claude.ai let me paste the key?">
    Because it doesn't need one. claude.ai connectors have no field for headers: they connect over OAuth, so instead of asking for a key they take you to a ReallyQuickEmails screen where you pick the project and permissions, and the app issues the key for you. It's the same key type (`rqe_mcp_...`), listed and revoked in the same place.
  </Accordion>
</AccordionGroup>
