npm package: @lightyoruichi/enginemailer-mcp
Description: Enginemailer MCP server for sending emails and managing campaigns
Author: Harinder Singh
Latest version: 0.1.3

# Enginemailer MCP Server

An MCP server that provides access to Enginemailer's email marketing and transactional email capabilities.

## Installation

### Quick Start (Recommended)

```bash
npx @lightyoruichi/enginemailer-mcp
```

### With Environment Variables

```bash
ENGINEMAILER_API_KEY=your-api-key-here npx @lightyoruichi/enginemailer-mcp
```

## Tools Available

### 📧 Transactional Emails
- `send_email` - Send transactional emails with attachments, CC/BCC, and substitution tags
- `tx_export_report_v2` - Export delivery reports
- `tx_check_export_status_v2` - Check export status

### 👥 Subscriber Management
- `subscriber_get` - Get subscriber details
- `subscriber_insert` - Add new subscriber
- `subscriber_update` - Update subscriber info
- `subscriber_unsub` - Unsubscribe
- `subscriber_activate` - Reactivate
- `subscriber_get_custom_field` - Get available custom fields
- `subscriber_get_subcategory` - Get categories/subcategories
- `subscriber_update_category` - Create/update categories

### 📊 Batch Operations
- `batch_update_subscribers` - Batch insert/update subscribers
- `batch_update_status` - Check batch job status

### 📈 Campaign Management
- `campaign_create` - Create email campaign
- `campaign_update` - Update campaign
- `campaign_delete` - Delete campaign
- `campaign_assign_recipients` - Assign recipients
- `campaign_delete_recipient_list` - Remove recipients
- `campaign_pause` - Pause campaign
- `campaign_send` - Send campaign
- `campaign_schedule` - Schedule campaign
- `campaign_list` - List campaigns
- `campaign_analytics_summary` - Get campaign analytics
- `campaign_analytics_delivery` - Get delivery stats

### 🔧 System
- `health` - Server health check
- `verify_connection` - Test API connectivity

## Example Queries

- "Send a welcome email to john@example.com"
- "Add a new subscriber with email jane@example.com and first name Jane"
- "Create a welcome campaign for new subscribers"
- "Get all subscribers in the growth operator category"
- "Send a transactional email with attachment"
- "Export delivery reports for last month"
- "Update subscriber categories for marketing team"
- "Schedule a campaign for next week"
- "Get campaign analytics for campaign ID 123"

## MCP Configuration

### For Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "enginemailer": {
      "command": "npx",
      "args": [
        "-y",
        "@lightyoruichi/enginemailer-mcp"
      ],
      "env": {
        "ENGINEMAILER_API_KEY": "your-api-key-here",
        "ENGINEMAILER_API_BASE": "https://api.enginemailer.com/restapi",
        "ENGINEMAILER_HOST": "https://api.enginemailer.com",
        "ENGINEMAILER_TX_SEND_PATH": "/RESTAPI/V2/Submission/SendEmail",
        "ENGINEMAILER_TX_EXPORT_PATH": "/RESTAPI/V2/Submission/Report/Export",
        "ENGINEMAILER_TX_CHECK_EXPORT_PATH": "/RESTAPI/V2/Submission/Report/CheckExport",
        "ENGINEMAILER_BATCH_UPDATE_PATH": "/subscriber/emsubscriber/batchUpdateSubscribers",
        "ENGINEMAILER_BATCH_STATUS_PATH": "/subscriber/emsubscriber/batchUpdateStatus",
        "HTTP_TIMEOUT_MS": "30000"
      }
    }
  }
}
```

### For Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "enginemailer": {
      "command": "npx",
      "args": [
        "-y",
        "@lightyoruichi/enginemailer-mcp"
      ],
      "env": {
        "ENGINEMAILER_API_KEY": "your-api-key-here",
        "ENGINEMAILER_API_BASE": "https://api.enginemailer.com/restapi",
        "ENGINEMAILER_HOST": "https://api.enginemailer.com",
        "ENGINEMAILER_TX_SEND_PATH": "/RESTAPI/V2/Submission/SendEmail",
        "ENGINEMAILER_TX_EXPORT_PATH": "/RESTAPI/V2/Submission/Report/Export",
        "ENGINEMAILER_TX_CHECK_EXPORT_PATH": "/RESTAPI/V2/Submission/Report/CheckExport",
        "ENGINEMAILER_BATCH_UPDATE_PATH": "/subscriber/emsubscriber/batchUpdateSubscribers",
        "ENGINEMAILER_BATCH_STATUS_PATH": "/subscriber/emsubscriber/batchUpdateStatus",
        "HTTP_TIMEOUT_MS": "30000"
      }
    }
  }
}
```

### For Other MCP Clients

```json
{
  "mcpServers": {
    "enginemailer": {
      "command": "npx",
      "args": ["-y", "@lightyoruichi/enginemailer-mcp"],
      "env": {
        "ENGINEMAILER_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `ENGINEMAILER_API_KEY` | Your Enginemailer API key | **Required** |
| `ENGINEMAILER_API_BASE` | API base URL | `https://api.enginemailer.com/restapi` |
| `ENGINEMAILER_HOST` | API host | `https://api.enginemailer.com` |
| `ENGINEMAILER_TX_SEND_PATH` | Transactional send endpoint | `/RESTAPI/V2/Submission/SendEmail` |
| `ENGINEMAILER_TX_EXPORT_PATH` | Export endpoint | `/RESTAPI/V2/Submission/Report/Export` |
| `ENGINEMAILER_TX_CHECK_EXPORT_PATH` | Export status endpoint | `/RESTAPI/V2/Submission/Report/CheckExport` |
| `ENGINEMAILER_BATCH_UPDATE_PATH` | Batch update endpoint | `/subscriber/emsubscriber/batchUpdateSubscribers` |
| `ENGINEMAILER_BATCH_STATUS_PATH` | Batch status endpoint | `/subscriber/emsubscriber/batchUpdateStatus` |
| `HTTP_TIMEOUT_MS` | HTTP timeout in milliseconds | `30000` |

## CLI Usage

```bash
# Show help
npx @lightyoruichi/enginemailer-mcp --help

# Show version
npx @lightyoruichi/enginemailer-mcp --version

# Health check
npx @lightyoruichi/enginemailer-mcp --health

# Run with custom API base
ENGINEMAILER_API_BASE=https://api.enginemailer.com/compass/restapi npx @lightyoruichi/enginemailer-mcp
```

## Get Your API Key

Get your API key from: https://portal.enginemailer.com/Account/UserProfile

⚠️ **Security Warning**: Never expose your API key in client-side code. Use backend services for security. If your key is compromised, regenerate it immediately.

## Requirements
- Node.js 18+
- Enginemailer API key
- Verified sender domain for transactional emails
- **Paid account** required for campaign features, but transactions email works ok.

## Development

If you want to contribute or run from source:

```bash
# Clone the repository
git clone https://github.com/lightyoruichi/enginemailer-mcp.git
cd enginemailer-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev
```