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

# MCP for AI Assistants

> Connect AI assistants to Lettr with the Model Context Protocol to send email, manage templates, and monitor delivery in plain language.

The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open standard that enables AI assistants to securely connect with external services. Lettr provides two MCP servers so AI agents can interact with your email infrastructure — sending messages, managing templates, configuring domains, and monitoring delivery — all through natural language.

## Why Use MCP?

MCP transforms how you interact with your email infrastructure. Instead of switching between dashboards, writing code, or memorizing API calls, you can ask your AI assistant to handle email tasks directly.

| Traditional Workflow                                           | With MCP                                                                                |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Open dashboard, navigate to domains, check verification status | "Check if my domain example.com is verified"                                            |
| Write code to send an email via API                            | "Send a test email to [john@example.com](mailto:john@example.com)"                      |
| Query API logs, parse response, identify issues                | "Why didn't my email to [jane@example.com](mailto:jane@example.com) deliver yesterday?" |
| Browse events, filter by recipient, analyze patterns           | "Show me recent bounces for the last 24 hours"                                          |

## Two Ways to Connect

Lettr offers two MCP servers for different workflows. Both give AI assistants access to your email infrastructure, but they differ in how they authenticate and where they run.

<CardGroup cols={2}>
  <Card title="Remote Server" icon="cloud" href="/learn/mcp/setup">
    Hosted at `https://app.lettr.com/mcp`. Authenticates via OAuth — no API key needed. Connect directly from Claude.ai, ChatGPT, Cursor, Claude Desktop, and GitHub Copilot.
  </Card>

  <Card title="Local Server" icon="terminal" href="/learn/mcp/local-setup">
    The `lettr-mcp` npm package runs on your machine. Authenticates with an API key. Ideal for Claude Code, Cursor, and Claude Desktop during development.
  </Card>
</CardGroup>

### Comparison

|                       | Remote Server                                              | Local Server                                            |
| --------------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
| **How it runs**       | Hosted by Lettr                                            | Runs on your machine via `npx`                          |
| **Authentication**    | OAuth 2.1 (your Lettr session)                             | API key (`LETTR_API_KEY`)                               |
| **Transport**         | HTTP/SSE                                                   | stdio                                                   |
| **Supported clients** | Claude.ai, ChatGPT, Cursor, Claude Desktop, GitHub Copilot | Claude Code, Cursor, Claude Desktop                     |
| **Best for**          | Chat-based account management, monitoring, analytics       | Developer workflows, coding assistants, CI environments |
| **Unique tools**      | Analytics, email events, API logs                          | Domain CRUD, template delete, domain verification       |
| **Open source**       | No                                                         | [Yes](https://github.com/lettr-com/lettr-mcp)           |

### Which Should I Use?

**Use the remote server** if you want to manage your Lettr account from a web-based AI chat like Claude.ai or ChatGPT, or if you need analytics and event monitoring tools. The remote server authenticates through OAuth so you don't need to manage API keys.

**Use the local server** if you want email capabilities inside your IDE or CLI during development. The local server is ideal for Claude Code and Cursor workflows where you need to send emails, manage templates, or configure domains as part of your coding process.

<Tip>
  Cursor and Claude Desktop work with both servers. The remote server uses OAuth (no API key needed), while the local server uses an API key and runs as a local process. You can use both simultaneously.
</Tip>

## What Can You Do?

Both MCP servers give AI assistants tools to work with your email infrastructure. The exact tools vary — see the [tools reference](/learn/mcp/tools-reference) for the full list.

| Capability                               | Remote | Local |
| ---------------------------------------- | ------ | ----- |
| Send emails (direct and template-based)  | Yes    | Yes   |
| List, view, create, and update templates | Yes    | Yes   |
| Delete templates and inspect merge tags  | No     | Yes   |
| List sending domains                     | Yes    | Yes   |
| Create, verify, and delete domains       | No     | Yes   |
| View analytics and template statistics   | Yes    | No    |
| Browse email events and API logs         | Yes    | No    |
| List API keys and webhooks               | Yes    | Yes   |
| Inspect webhook details                  | No     | Yes   |

## Example Conversations

Once connected, you can interact with your email infrastructure using natural language:

**Sending emails:**

> "Send an email to [john@example.com](mailto:john@example.com) from [hello@mycompany.com](mailto:hello@mycompany.com) about tomorrow's 3pm meeting"

**Using templates:**

> "Send the 'order-confirmation' template to [buyer@example.com](mailto:buyer@example.com) with order\_id '12345' and customer\_name 'Sarah'"

**Debugging delivery:**

> "Why didn't my message to [jane@example.com](mailto:jane@example.com) deliver yesterday?"

**Checking domains:**

> "Is my domain notifications.example.com verified and ready to send?"

**Reviewing events:**

> "Show me all bounces from the last week"

## Security

Both MCP servers are designed with security in mind:

* **Remote server** — Authenticates through OAuth 2.1. Access is tied to your Lettr session and team permissions. When you sign out, the AI loses access. API keys are never exposed to the AI assistant.
* **Local server** — Authenticates with an API key stored in your local environment. The key never leaves your machine. Use [restricted API keys](/learn/api-keys/permissions) to limit what the AI can do.

<Warning>
  MCP allows AI assistants to send emails on your behalf. Only connect trusted AI clients and review actions before confirming sensitive operations.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Remote Server Setup" icon="cloud" href="/learn/mcp/setup">
    Connect via OAuth from Claude.ai, ChatGPT, and other AI clients
  </Card>

  <Card title="Local Server Setup" icon="terminal" href="/learn/mcp/local-setup">
    Install the lettr-mcp package for your IDE or CLI
  </Card>

  <Card title="Tools Reference" icon="wrench" href="/learn/mcp/tools-reference">
    Full reference for all MCP tools across both servers
  </Card>

  <Card title="API Keys" icon="key" href="/learn/api-keys/introduction">
    Create an API key for the local MCP server
  </Card>
</CardGroup>
