MCP Hub
Back to servers

mailchimp-mcp-server

Mailchimp via MCP: draft, test, and send campaigns; manage audiences and subscribers; pull reports.

Registry
Updated
Apr 21, 2026

Quick Install

npx -y @cyanheads/mailchimp-mcp-server

@cyanheads/mailchimp-mcp-server

Draft, test, and send Mailchimp campaigns straight from your MCP client — with audience management, subscriber CRUD, and post-send analytics behind safe-by-default send gates. STDIO or Streamable HTTP.

17 Tools • 4 Resources • 1 Prompt

npm Version Framework MCP SDK

License TypeScript Bun


Tools

Seventeen tools grouped by shape — workflow helpers orchestrate common flows end-to-end, primitive tools expose fine-grained CRUD, and the instruction tool returns procedural guidance merged with live account state.

Tool NameDescription
mailchimp_accountAccount profile, plan, data center, total subscribers, and the Chimp Chatter activity feed.
mailchimp_audiencesManage audiences (lists) — read, create/update, per-audience analytics, signup-form config. No delete.
mailchimp_audience_overviewOne-call audience health digest: info, stats, growth history, top email clients, merge-field schema.
mailchimp_subscribersSubscriber CRUD + tags/notes/activity. archive is the strongest delete available.
mailchimp_upsert_subscriberAdd or update a subscriber idempotently with status, merge fields, tags, and optional note.
mailchimp_find_subscriberLocate a subscriber by email in one audience or across the account.
mailchimp_import_subscribersBatch add/update subscribers (capped at 500/call). Status defaults to pending (double-opt-in).
mailchimp_segmentsCRUD for audience segments (saved, static, fuzzy) plus member listing and batch add/remove.
mailchimp_merge_fieldsRead + create/update custom subscriber attributes. No delete — drops data across all subscribers.
mailchimp_campaignsCampaign record management: list/get/create/update, replicate, content, checklist, RSS/resend controls.
mailchimp_send_campaignCompose and send (or schedule/test) a campaign in one call. Elicits human confirmation on send/schedule.
mailchimp_replicate_campaignDuplicate a campaign with optional overrides, then draft/test/send/schedule. Same elicit + cleanup semantics.
mailchimp_reportsCampaign reports — generic slicer across ten dimensions (clicks, opens, locations, etc.).
mailchimp_campaign_reportPost-send analytics digest — headline metrics + top 5 slices in one response.
mailchimp_templatesEmail template CRUD (base, user; gallery requires a paid plan).
mailchimp_searchGlobal search across members or campaigns. Lightweight discovery — use find_subscriber for detail.
mailchimp_playbookReturns a structured procedural playbook merged with live account state. Advice-only, no writes.

mailchimp_send_campaign

Compose and send (or schedule/test) a campaign in one call.

  • Chains create → content → checklist → optional test → send/schedule
  • Requests human confirmation via ctx.elicit when mode: 'send' | 'schedule' and the client supports elicitation
  • Auto-deletes aborted or failed drafts when cleanupOnError: true (default)
  • Supports html, plaintext, and templateId + mergeData content forms

mailchimp_replicate_campaign

Duplicate an existing campaign with optional overrides, then send/schedule/test or leave as draft.

  • Overrides: subject, from name, reply-to, audience, segment, content
  • Same elicit confirmation + cleanup semantics as mailchimp_send_campaign
  • Tuned for the common "send v2 of last week's newsletter with an updated intro" pattern

mailchimp_upsert_subscriber

Add or update a subscriber in one idempotent call.

  • Declarative tag sync — pass the desired active set and the tool computes the add/remove delta
  • preserveTags protects named segment memberships (Mailchimp stores static-segment membership as tags)
  • status: 'pending' triggers Mailchimp's double-opt-in email; 'subscribed' requires documented consent
  • PUT /members/{hash} for create path, PATCH for update to skip re-validating pre-existing merge fields

mailchimp_import_subscribers

Batch add (and optionally update) subscribers in one call.

  • Capped at 500 rows per call — chunk larger imports client-side
  • Status defaults to pending (double-opt-in) to prevent accidental mass-sends
  • Returns per-row succeeded/failed with error reasons

mailchimp_campaign_report

Aggregated post-send analytics for a campaign.

  • Headline delivery metrics: sent, bounces, abuse reports
  • Engagement: opens, clicks, unsubscribes
  • Top-N clicked links, locations, recent unsubscribes
  • Industry benchmarks when available
  • Use mailchimp_reports with operation: 'slice' for a single dimension in detail

mailchimp_audience_overview

Single-call audience health digest — answers "what does this audience look like?" in one request.

  • Audience info + live stats
  • Configurable months of growth history
  • Top email clients
  • Full merge-field schema
  • Recent activity

mailchimp_playbook

Returns a structured procedural playbook merged with live account state. Advice-only — the agent executes subsequent steps with other tools.

  • Topics: send, post-send-review, deliverability, list-hygiene, onboarding, subscriber-triage, design-campaign
  • Returns markdown instructions + a live-state snapshot
  • nextToolSuggestions pre-fills arguments for the next likely tool call

Resources and prompts

TypeNameDescription
Resourcemailchimp://accountAccount info snapshot — profile, plan, data center, total subscribers.
Resourcemailchimp://audiences/{audienceId}Audience snapshot — name, contact, stats, double-opt-in status.
Resourcemailchimp://campaigns/{campaignId}Campaign snapshot — status, settings, recipients summary.
Resourcemailchimp://campaigns/{campaignId}/reportPost-send campaign report headline metrics.
Promptnewsletter_from_sourceUser-invokable starter — compose a monthly editorial newsletter from a URL or brief. Chains into mailchimp_playbook (topic: design-campaign) and walks the draft → test → send flow.

All resource data is also reachable via tools. Large collections (audiences, campaigns) are not exposed as resources — use the list operation on the corresponding tool instead. Design reference for the prompt: docs/email-design-playbook.md.

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
  • Unified error handling — handlers throw, framework catches, classifies, and formats
  • Pluggable auth: none, jwt, oauth
  • Structured logging with optional OpenTelemetry tracing
  • STDIO and Streamable HTTP transports

Mailchimp-specific:

  • Auto-derives the API base URL from the -dc suffix on the API key
  • Safe-by-default send workflows — elicit confirmation, pending-status imports, no permanent deletes from agent surface
  • Workflow tools parallelize related sub-requests under a configurable concurrency limit
  • Domain normalization shapes sparse upstream payloads into compact, LLM-friendly output without fabricating values

Getting started

Add the following to your MCP client configuration file. See docs/api-key.md for how to generate a Mailchimp API key.

{
  "mcpServers": {
    "mailchimp": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/mailchimp-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "MAILCHIMP_API_KEY": "your-key-with-dc-suffix-e.g.-us22"
      }
    }
  }
}

Or with npx (no Bun required):

{
  "mcpServers": {
    "mailchimp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/mailchimp-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "MAILCHIMP_API_KEY": "your-key-with-dc-suffix-e.g.-us22"
      }
    }
  }
}

Or with Docker:

{
  "mcpServers": {
    "mailchimp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MCP_TRANSPORT_TYPE=stdio",
        "-e", "MAILCHIMP_API_KEY=your-key-with-dc-suffix-e.g.-us22",
        "ghcr.io/cyanheads/mailchimp-mcp-server:latest"
      ]
    }
  }
}

For Streamable HTTP, set the transport and start the server:

MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 MAILCHIMP_API_KEY=... bun run start:http
# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.3.2 or higher (or Node.js v22+).
  • A Mailchimp Marketing API key — the key's -dc suffix (e.g. -us22) identifies your data center and is parsed at startup.

Installation

  1. Clone the repository:
git clone https://github.com/cyanheads/mailchimp-mcp-server.git
  1. Navigate into the directory:
cd mailchimp-mcp-server
  1. Install dependencies:
bun install
  1. Configure environment:
cp .env.example .env
# edit .env and set MAILCHIMP_API_KEY

Configuration

VariableDescriptionDefault
MAILCHIMP_API_KEYRequired. Mailchimp Marketing API key including -dc suffix (e.g. abc…-us22).
MAILCHIMP_BASE_URLOverride API base URL (for mock servers or tests).https://{dc}.api.mailchimp.com/3.0
MAILCHIMP_TIMEOUT_MSPer-request timeout in milliseconds.60000
MAILCHIMP_MAX_RETRIESMax retry attempts for transient upstream failures (0-10).3
MAILCHIMP_CONCURRENCY_LIMITMax in-flight upstream requests per workflow tool (1-10).4
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_HOSTHTTP server hostname.127.0.0.1
MCP_HTTP_PORTHTTP server port.3010
MCP_HTTP_ENDPOINT_PATHMCP endpoint path./mcp
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
OTEL_ENABLEDEnable OpenTelemetry.false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Hot-reload dev mode:

    bun run dev:stdio
    bun run dev:http
    
  • Build and run the production version:

    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:stdio
    # or
    bun run start:http
    
  • Run checks and tests:

    bun run devcheck   # Lint, format, typecheck, security
    bun run test       # Vitest test suite
    bun run lint:mcp   # Validate MCP definitions against spec
    

Docker

docker build -t mailchimp-mcp-server .
docker run --rm -e MAILCHIMP_API_KEY=your-key-us22 -p 3010:3010 mailchimp-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/mailchimp-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources/prompts and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts). Seventeen Mailchimp tools.
src/mcp-server/resourcesResource definitions (*.resource.ts). Four snapshot resources.
src/mcp-server/promptsPrompt definitions (*.prompt.ts). Newsletter starter prompt.
src/services/mailchimpMailchimp client wrapper — HTTP plumbing, retries, normalization, typed surface.
tests/Vitest tests mirroring src/. Currently only config/ is covered; other subdirs are scaffolded for expansion.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging
  • Register new tools and resources via the barrels in src/mcp-server/*/definitions/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues and pull requests are welcome. Run checks and tests before submitting:

bun run devcheck
bun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Reviews

No reviews yet

Sign in to write a review