Lettr MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Lettr MCP or direct API to send transactional emails, manage templates, update audiences, and track campaigns through natural language.

Lettr logoLettr
Api Key

Lettr is an email and messaging platform for transactional delivery, templates, audiences, campaigns, domains, and webhooks. Use it to send reliable product emails and manage customer messaging from one place.

60 Tools

Try Lettr now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Lettr
Try asking
TOOLS

Supported Tools

Every Lettr action and event your agent gets out of the box.

Attach Contacts to Lists

Attach every combination of 1-1000 contacts and 1-50 audience lists, processing up to 50,000 contact-list pairs and reporting new and existing memberships.

Bulk Create Audience Contacts

Create or recognize up to 1000 normalized, deduplicated contacts.

Cancel Scheduled Email

Cancel a scheduled email before its delivery time; cancellation is unavailable once processing has begun.

Create Audience Contact

Create one audience contact with optional properties and list membership.

Create Audience Contact With Double Opt-In

Create an unverified audience contact and irreversibly send an external confirmation email; the contact becomes subscribed only after confirming.

Create Audience List

Create a uniquely named audience list for grouping contacts.

Create Audience Property

Define a custom contact property with an immutable name and value type.

Create Audience Segment

Create a dynamic audience segment whose condition groups are ANDed while conditions inside each group are ORed.

Create Audience Topic

Create a public or private subscription topic with an immutable opt-in or opt-out default.

Create Domain

Register a sending domain and return the DNS configuration needed to verify it.

Create Template

Create and publish an email template from either custom HTML or Topol editor JSON, extracting its merge tags.

Create Webhook

Create an active event webhook using no authentication, HTTP Basic credentials, or OAuth 2 client credentials.

Delete Audience Contact

Permanently delete one audience contact and its associated memberships.

Delete Audience Lists

Permanently delete between 1 and 50 audience lists in one request.

Delete Audience Property

Permanently delete a custom contact-property definition.

Delete Audience Segment

Permanently delete one dynamic audience segment.

Delete Audience Topic

Permanently delete one audience subscription topic.

Delete Domain

Permanently remove a sending domain from Lettr and SparkPost so it can no longer send email.

Delete Template

Permanently delete an email template and all of its versions.

Delete Webhook

Permanently remove a webhook so Lettr stops delivering events to it.

Detach Contacts from Lists

Detach every combination of 1-1000 contacts and 1-50 audience lists, reporting removed and absent memberships.

Get Audience Contact

Retrieve one contact's email, status, custom properties, list memberships, and topic subscriptions by ID.

Get Audience List

Retrieve one audience list and its current contact count by ID.

Get Audience Property

Retrieve one custom contact-property definition and its fallback value.

Get Audience Segment

Retrieve one dynamic segment's list restriction, complete AND-of-OR condition definition, and cached contact count.

Get Audience Topic

Retrieve one subscription topic's defaults, visibility, and current contact count.

Get Campaign

Retrieve one campaign's name, subject, sender and reply-to configuration, schedule, rendered HTML, lifecycle state, recipient counts, and engagement statistics.

Get Domain

Retrieve one sending domain's send readiness, DNS records, provider detection, and verification status.

Get Email

Retrieve a sent email's delivery state, recipients, schedule metadata, and events by request ID.

Get Scheduled Email

Retrieve a scheduled email's current state and events by transmission ID, including after it has been processed.

Get Template

Retrieve an email template's metadata, active HTML or editor JSON content, and version counts by slug.

Get Template Merge Tags

Return required and optional merge tags for a template's active or specified version before sending with substitution data.

Get Webhook

Retrieve one webhook's target, enabled state, event selection, authentication mode, and latest delivery status.

List Audience Contacts

Return one cursor-controlled page of contacts, optionally filtered by search text, status, list, or segment.

List Audience Lists

Return one cursor-controlled page of audience lists with each list's contact count.

List Audience Properties

Return one cursor-controlled page of custom contact-property definitions and fallback values.

List Audience Segments

Return one cursor-controlled page of dynamic audience segments, including their complete AND-of-OR condition definitions, optionally filtered by list.

List Audience Topics

Return one cursor-controlled page of subscription topics with defaults, visibility, and contact counts.

List Campaign Events

Return one cursor-controlled page of a campaign's delivery and engagement events, with event, recipient, and time filters.

List Campaigns

Return one cursor-controlled page of campaigns with complete delivery and engagement statistics, optionally filtered by lifecycle status.

List Domains

Return all sending domains with approval, DNS verification, and send-readiness status.

List Email Events

Return one cursor-controlled page of delivery and engagement events across sent emails, with event, recipient, transmission, bounce, and date filters.

List Sent Emails

Return one cursor-controlled page of sent emails, optionally filtered by recipient and date range.

List Projects

Return one cursor-controlled page of Lettr projects and their IDs for use with template operations.

List Templates

Return one cursor-controlled page of email templates for a project or the team's default project.

List Webhooks

Return all event webhooks with target, enabled state, event selection, authentication mode, and latest delivery status.

Publish Template Version

Create and activate a new version of an existing email template from exactly one of HTML or Topol editor JSON, optionally renaming the template atomically.

Schedule Campaign

Schedule a campaign for future delivery or reschedule it.

Schedule Email

Create a transactional email scheduled 5 minutes to 3 days in the future; it remains cancellable until processed.

Send Campaign

Immediately and irreversibly start sending a sendable draft campaign to its resolved audience.

Send Email

Immediately queue a transactional email to up to 50 recipients using inline content or a Lettr template.

Unschedule Campaign

Cancel a scheduled campaign send and return the campaign to draft.

Update Audience Contact

Change a contact's email, subscribed or unsubscribed status, or selected custom property values.

Update Audience List

Rename an audience list while preserving its contacts.

Update Audience Property

Set or clear a custom contact property's fallback value.

Update Audience Segment

Change a dynamic segment's name, optional audience-list restriction, or complete AND-of-OR condition definition.

Update Audience Topic

Change a subscription topic's name, description, or public/private visibility.

Update Template

Rename an email template's metadata without publishing a new version.

Update Webhook

Partially update a webhook's name, callback URL, authentication, selected events, or active state.

Verify Domain

Run Lettr's DNS verification for a registered domain and return DKIM, CNAME, DMARC, SPF, and ownership results.

SETUP GUIDE

Connect Lettr MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Lettr
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'List recent Lettr campaigns and summarize delivery status'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Lettr API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Lettr Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'Create a Lettr transactional email template for a password reset message'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Lettr actions with your Agent

Why Use Composio?

AI Native Lettr Integration

  • Supports both Lettr MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable email, template, audience, campaign, domain, and webhook actions
  • Rich coverage for reading, writing, and querying your Lettr messaging data

Managed Auth

  • Secure API key handling without hard-coding Lettr credentials in agent code
  • Central place to manage, scope, and revoke Lettr access
  • Per user and per environment credentials so staging and production stay cleanly separated

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf
  • Clear schemas help agents choose the right Lettr action instead of guessing

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Lettr
  • Scoped, least privilege access to Lettr resources like campaigns, templates, audiences, domains, and webhooks
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

Yes, Lettr requires you to configure your own API key. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Lettr.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Lettr tool your agent needs.Free to start.

Start building