Lettr MCP

MCP สำหรับ API อีเมลธุรกรรมของ Lettr

GitHubลองใช้ MCP นี้ผู้สนับสนุน

เอกสาร

Lettr MCP Server

[!IMPORTANT] This package is no longer being updated. Use Lettr's hosted MCP server instead: https://app.lettr.com/mcp

The hosted server is maintained alongside the Lettr API, so new tools and fixes land there and not here. This package keeps working, but it will not gain anything further.

Switching, with the Lettr account you sign into (OAuth):

claude mcp add --transport http lettr https://app.lettr.com/mcp

Then authenticate when your client prompts — no API key to manage.

Switching, with an API key for CI, cron jobs and other places with no browser:

claude mcp add --transport http lettr https://app.lettr.com/mcp \
  --header "Authorization: Bearer lttr_xxxxxxxxx"

See Connect with an API Key and the remote server setup guide for Cursor, Claude Desktop and other clients.

A few differences worth knowing before you move: tool names use snake_case there (send_email, not send-email), some parameters are named differently (contact_id rather than contactId), and the hosted server has tools this package never had — analytics, email events and API logs.

The official Model Context Protocol (MCP) server for Lettr — the email API for developers. Send transactional emails, manage templates with merge tags, configure domains, and monitor webhooks — directly from any MCP client like Claude Desktop, Cursor, or Claude Code.

Why Lettr?

Lettr is a modern email sending platform built for developers. It offers a clean REST API, a powerful drag-and-drop template editor, merge tag personalization, open and click tracking, and best-in-class deliverability. Whether you're sending password resets, order confirmations, or onboarding sequences, Lettr makes it simple and reliable.

Features

  • Send Emails — Send transactional emails with HTML, plain text, CC/BCC, attachments, tracking options, metadata, and tags. Supports template-based sending with merge tag substitution, scheduled delivery, and inspecting sent messages and events.
  • Templates — List, create, get, update, and delete email templates, transactional or campaign. Retrieve rendered HTML and merge tags to discover which variables a template expects before sending.
  • Domains — List, create, get, delete, and verify sending domains. View DNS records required for SPF, DKIM, and DMARC authentication.
  • Webhooks — List, create, get, update, and delete webhook configurations for real-time email event notifications.
  • Projects — List the projects available to your team so you can target template and email tools at a specific project.
  • Audience — Manage contacts, lists, subscription topics, custom properties, and segments. Create and update contacts (with double opt-in), attach contacts to lists and topics, bulk import, and build segments from match conditions.
  • System — Health check and API key validation for client setup and diagnostics.

Setup

  1. Create a free Lettr account
  2. Create an API key in your dashboard
  3. Verify your domain to send emails to any recipient

Usage

Claude Code

claude mcp add lettr -e LETTR_API_KEY=lttr_xxxxxxxxx -- npx -y lettr-mcp

Cursor

Open the command palette and choose "Cursor Settings" > "MCP" > "Add new global MCP server".

{
  "mcpServers": {
    "lettr": {
      "command": "npx",
      "args": ["-y", "lettr-mcp"],
      "env": {
        "LETTR_API_KEY": "lttr_xxxxxxxxx"
      }
    }
  }
}

Claude Desktop

Open Claude Desktop settings > "Developer" tab > "Edit Config".

{
  "mcpServers": {
    "lettr": {
      "command": "npx",
      "args": ["-y", "lettr-mcp"],
      "env": {
        "LETTR_API_KEY": "lttr_xxxxxxxxx"
      }
    }
  }
}

Options

You can pass additional arguments to configure the server:

  • --key: Your Lettr API key (alternative to LETTR_API_KEY env var)
  • --sender: Default sender email address from a verified domain
  • --reply-to: Default reply-to email address

Environment variables:

  • LETTR_API_KEY: Your Lettr API key (required)
  • SENDER_EMAIL_ADDRESS: Default sender email address from a verified domain (optional)
  • REPLY_TO_EMAIL_ADDRESS: Default reply-to email address (optional)

Note: If you don't provide a sender email address, the MCP server will ask for one each time you send an email.

Available Tools

Emails

ToolDescription
send-emailSend a transactional email with HTML, plain text, templates, attachments, tracking, and personalization
list-emailsList recently sent emails (cursor-paginated, with recipient and date filters)
list-email-eventsList email events (delivery, bounce, click, open, …) with filters by type, recipient, transmission, and date range
get-email-detailRetrieve the full delivery timeline for a single transmission by request ID
schedule-emailSchedule a transactional email for future delivery (5+ minutes ahead, within 30 days)
list-scheduled-emailsList emails waiting to be sent, with a state filter
get-scheduled-emailGet the state and events of a scheduled email
cancel-scheduled-emailCancel a scheduled email before it is sent

Templates

ToolDescription
list-templatesList email templates, filterable by purpose and folder
get-templateGet full template details including HTML content
create-templateCreate a new template with HTML or visual editor JSON, transactional or campaign
update-templateUpdate template name and/or content (creates new version)
delete-templatePermanently delete a template and all versions
get-merge-tagsDiscover merge tag variables a template expects
get-template-htmlRetrieve a template's rendered HTML, subject, and merge tags by project ID and slug

Template purpose. A template is either transactional (the default — receipts, password resets, alerts) or campaign (marketing sent to an audience list). A campaign can only send a template whose purpose is campaign, and the purpose cannot be changed after creation, so a newsletter created with the default has to be rebuilt. Pass purpose to create-template whenever the message is going to an audience rather than to one person.

Preparation status. Imported templates render asynchronously, so a template can exist before it is sendable. list-templates and get-template report pending, ready or failed. After an update the previous render keeps serving until the new one settles, so a pending template still sends — just not yet the new content.

Folders

ToolDescription
list-foldersList the folders templates are filed into, with purpose and template count

Folders are the only way to discover a folder_id. Without this tool the choice is to omit folder_id and accept whichever folder the API picks, or to guess an integer read out of an app URL. A folder's purpose is independent of its templates' — filing a template in a campaign folder does not make it a campaign template.

Domains

ToolDescription
list-domainsList all sending domains and their verification status
create-domainRegister a new sending domain
get-domainGet domain details with DNS records
delete-domainRemove a sending domain
verify-domainTrigger DNS verification for a domain

Webhooks

ToolDescription
list-webhooksList all webhook configurations
get-webhookGet webhook details and delivery status
create-webhookCreate a new webhook subscription with auth and event-type selection
update-webhookUpdate an existing webhook (name, URL, auth, events, active flag)
delete-webhookDelete a webhook subscription

Projects

ToolDescription
list-projectsList projects owned by the team — useful for discovering project IDs

Audience

ToolDescription
list-audience-listsList audience (contact) lists with pagination
create-audience-listCreate a new audience list
get-audience-listGet a single list and its contact count
update-audience-listRename an audience list
delete-audience-listDelete an audience list
bulk-delete-audience-listsDelete up to 50 lists in one call
list-audience-contactsList contacts with search, status, list, and segment filters
get-audience-contactGet a contact with its properties, lists, and topics
create-audience-contactCreate a contact, optionally with double opt-in
bulk-create-audience-contactsCreate many contacts, either from a flat list of emails or one row per contact
update-audience-contactUpdate a contact's email, status, or properties
delete-audience-contactDelete a contact
attach-contact-to-listAdd a contact to a list
detach-contact-from-listRemove a contact from a list
subscribe-contact-to-topicSubscribe a contact to a topic
unsubscribe-contact-from-topicUnsubscribe a contact from a topic
bulk-attach-contacts-to-listsAttach many contacts to many lists at once
bulk-detach-contacts-from-listsDetach many contacts from many lists at once
bulk-subscribe-contacts-to-topicsSubscribe many contacts to many topics at once
bulk-unsubscribe-contacts-from-topicsUnsubscribe many contacts from many topics at once
list-audience-topicsList subscription topics with pagination
create-audience-topicCreate a subscription topic
get-audience-topicGet a single topic
update-audience-topicUpdate a topic's name, description, or visibility
delete-audience-topicDelete a subscription topic
list-audience-propertiesList custom contact properties
create-audience-propertyDefine a new custom property
get-audience-propertyGet a single property
update-audience-propertyUpdate a property's fallback value
delete-audience-propertyDelete a custom property
list-audience-segmentsList segments, optionally filtered by list
create-audience-segmentCreate a segment from match conditions
get-audience-segmentGet a single segment and its conditions
update-audience-segmentUpdate a segment's name, list, or conditions
delete-audience-segmentDelete a segment

System

ToolDescription
health-checkCheck the Lettr API health status
auth-checkValidate the configured API key and return the team ID

Local Development

  1. Clone and build:
git clone https://github.com/nicholasgriffintn/lettr-mcp.git
cd lettr-mcp
pnpm install
pnpm run build
  1. Use the local build in your MCP client:
{
  "mcpServers": {
    "lettr": {
      "command": "node",
      "args": ["ABSOLUTE_PATH_TO_PROJECT/dist/index.js"],
      "env": {
        "LETTR_API_KEY": "lttr_xxxxxxxxx"
      }
    }
  }
}

Testing with MCP Inspector

Make sure you've built the project first (see Local Development above).

  1. Set your API key:

    export LETTR_API_KEY=lttr_your_key_here
    
  2. Start the inspector:

    pnpm inspector
    
  3. In the browser (Inspector UI):

    • Choose stdio (launch a process).
    • Command: node
    • Args: dist/index.js
    • Env: LETTR_API_KEY=lttr_your_key_here
    • Click Connect, then use "List tools" to verify the server is working.

Resources

License

MIT