{"id":50993854,"url":"https://github.com/cyanheads/mailchimp-mcp-server","last_synced_at":"2026-06-20T06:32:37.166Z","repository":{"id":352717822,"uuid":"1215487420","full_name":"cyanheads/mailchimp-mcp-server","owner":"cyanheads","description":"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.","archived":false,"fork":false,"pushed_at":"2026-06-12T03:31:04.000Z","size":1777,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T05:13:52.357Z","etag":null,"topics":["ai-agent","audiences","campaigns","cyanheads","email-marketing","mailchimp","mailchimp-api","mcp","mcp-server","model-context-protocol","newsletter","subscribers","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cyanheads/mailchimp-mcp-server","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyanheads.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T00:57:46.000Z","updated_at":"2026-06-12T03:31:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cyanheads/mailchimp-mcp-server","commit_stats":null,"previous_names":["cyanheads/mailchimp-mcp-server"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/cyanheads/mailchimp-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fmailchimp-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fmailchimp-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fmailchimp-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fmailchimp-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyanheads","download_url":"https://codeload.github.com/cyanheads/mailchimp-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fmailchimp-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34560265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","audiences","campaigns","cyanheads","email-marketing","mailchimp","mailchimp-api","mcp","mcp-server","model-context-protocol","newsletter","subscribers","typescript"],"created_at":"2026-06-20T06:32:36.381Z","updated_at":"2026-06-20T06:32:37.110Z","avatar_url":"https://github.com/cyanheads.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e@cyanheads/mailchimp-mcp-server\u003c/h1\u003e\n  \u003cp\u003e\u003cb\u003eDraft, 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.\u003c/b\u003e\n  \u003cdiv\u003e18 Tools (+2 conditional) • 4 Resources • 1 Prompt\u003c/div\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![npm](https://img.shields.io/npm/v/@cyanheads/mailchimp-mcp-server?style=flat-square\u0026logo=npm\u0026logoColor=white)](https://www.npmjs.com/package/@cyanheads/mailchimp-mcp-server) [![Version](https://img.shields.io/badge/Version-0.3.7-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square\u0026logo=docker\u0026logoColor=white)](https://github.com/users/cyanheads/packages/container/package/mailchimp-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge\u0026logo=anthropic\u0026logoColor=white)](https://github.com/cyanheads/mailchimp-mcp-server/releases/latest/download/mailchimp-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=mailchimp-mcp-server\u0026config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvbWFpbGNoaW1wLW1jcC1zZXJ2ZXIiXSwiZW52Ijp7Ik1BSUxDSElNUF9BUElfS0VZIjoieW91ci1hcGkta2V5In19) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge\u0026logo=visualstudiocode\u0026logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22mailchimp-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads/mailchimp-mcp-server%22%5D%2C%22env%22%3A%7B%22MAILCHIMP_API_KEY%22%3A%22your-api-key%22%7D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n\u003c/div\u003e\n\n---\n\n## Tools\n\nEighteen always-on tools plus two conditional ones — `mailchimp_assets` (when `MAILCHIMP_ASSETS_DIR` is set) and `mailchimp_local_templates` (when `MAILCHIMP_TEMPLATES_DIR` is set). 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.\n\n| Tool Name | Description |\n|:----------|:------------|\n| `mailchimp_account` | Account profile, plan, data center, total subscribers, and the Chimp Chatter activity feed. |\n| `mailchimp_audiences` | Manage audiences (lists) — read, create/update, per-audience analytics, signup-form config. No delete. |\n| `mailchimp_audience_overview` | One-call audience health digest: info, stats, growth history, top email clients, merge-field schema. |\n| `mailchimp_subscribers` | Subscriber CRUD + tags/notes/activity. `archive` is the strongest delete available. |\n| `mailchimp_upsert_subscriber` | Add or update a subscriber idempotently with status, merge fields, tags, and optional note. |\n| `mailchimp_find_subscriber` | Locate a subscriber by email in one audience or across the account. |\n| `mailchimp_import_subscribers` | Batch add/update subscribers (capped at 500/call). Status defaults to `pending` (double-opt-in). |\n| `mailchimp_segments` | CRUD for audience segments (saved, static, fuzzy) plus member listing and batch add/remove. |\n| `mailchimp_merge_fields` | Read + create/update custom subscriber attributes. No delete — drops data across all subscribers. |\n| `mailchimp_campaigns` | Campaign record management: list/get/create/update, replicate, content, checklist, RSS/resend controls. |\n| `mailchimp_send_campaign` | Compose and send (or schedule/test) a campaign in one call. Elicits human confirmation on send/schedule. |\n| `mailchimp_replicate_campaign` | Duplicate a campaign with optional overrides, then draft/test/send/schedule. Same elicit + cleanup semantics. |\n| `mailchimp_reports` | Campaign reports — generic slicer across ten dimensions (clicks, opens, locations, etc.). |\n| `mailchimp_campaign_report` | Post-send analytics digest — headline metrics + top 5 slices in one response. |\n| `mailchimp_templates` | Email template read/write — reads (`list`/`get`) work on free for `base`/`user` types; writes (`create`/`update`/`delete`) and `gallery` require a paid plan. |\n| `mailchimp_files` | File Manager (Content Studio) — upload, list, fetch, rename, delete files on Mailchimp's CDN. Embed the returned `fullSizeUrl` in campaign HTML. Works on free; 1 MB per image / 10 MB per other file. |\n| `mailchimp_search` | Global search across members or campaigns. Lightweight discovery — use `find_subscriber` for detail. |\n| `mailchimp_assets` *(conditional — set `MAILCHIMP_ASSETS_DIR`)* | Local-assets surface. List your assets dir, inspect cache state, pre-warm uploads ahead of a send. Most workflows don't call this directly — `@assets/\u003cpath\u003e` references in campaign HTML auto-upload via `mailchimp_send_campaign` and `mailchimp_campaigns set-content`. |\n| `mailchimp_local_templates` *(conditional — set `MAILCHIMP_TEMPLATES_DIR`)* | Local-template authoring surface. List/get/render-preview your `.eta` templates with optional `\u003cname\u003e.meta.yaml` sidecars. `seed-from-mailchimp` bootstraps a local template from a Mailchimp `base`/`user` starter. Use `content.localTemplate` on campaign tools to render at send time. **Canonical write path on free-tier Mailchimp**, where the upstream templates API is read-only. |\n| `mailchimp_playbook` | Returns a structured procedural playbook merged with live account state. Advice-only, no writes. |\n\n---\n\n### `mailchimp_send_campaign`\n\nCompose and send (or schedule/test) a campaign in one call.\n\n- Chains create → content → checklist → optional test → send/schedule\n- Requests human confirmation via `ctx.elicit` when `mode: 'send' | 'schedule'` and the client supports elicitation\n- Auto-deletes aborted or failed drafts when `cleanupOnError: true` (default)\n- Supports `html`, `plaintext`, and `templateId + mergeData` content forms\n\n---\n\n### `mailchimp_replicate_campaign`\n\nDuplicate an existing campaign with optional overrides, then send/schedule/test or leave as draft.\n\n- Overrides: subject, from name, reply-to, audience, segment, content\n- Same elicit confirmation + cleanup semantics as `mailchimp_send_campaign`\n- Tuned for the common \"send v2 of last week's newsletter with an updated intro\" pattern\n\n---\n\n### `mailchimp_upsert_subscriber`\n\nAdd or update a subscriber in one idempotent call.\n\n- Declarative tag sync — pass the desired active set and the tool computes the add/remove delta\n- `preserveTags` protects named segment memberships (Mailchimp stores static-segment membership as tags)\n- `status: 'pending'` triggers Mailchimp's double-opt-in email; `'subscribed'` requires documented consent\n- PUT `/members/{hash}` for create path, PATCH for update to skip re-validating pre-existing merge fields\n\n---\n\n### `mailchimp_import_subscribers`\n\nBatch add (and optionally update) subscribers in one call.\n\n- Capped at 500 rows per call — chunk larger imports client-side\n- Status defaults to `pending` (double-opt-in) to prevent accidental mass-sends\n- Returns per-row succeeded/failed with error reasons\n\n---\n\n### `mailchimp_campaign_report`\n\nAggregated post-send analytics for a campaign.\n\n- Headline delivery metrics: sent, bounces, abuse reports\n- Engagement: opens, clicks, unsubscribes\n- Top-N clicked links, locations, recent unsubscribes\n- Industry benchmarks when available\n- Use `mailchimp_reports` with `operation: 'slice'` for a single dimension in detail\n\n---\n\n### `mailchimp_audience_overview`\n\nSingle-call audience health digest — answers \"what does this audience look like?\" in one request.\n\n- Audience info + live stats\n- Configurable months of growth history\n- Top email clients\n- Full merge-field schema\n- Recent activity\n\n---\n\n### `mailchimp_playbook`\n\nReturns a structured procedural playbook merged with live account state. Advice-only — the agent executes subsequent steps with other tools.\n\n- Topics: `send`, `post-send-review`, `deliverability`, `list-hygiene`, `onboarding`, `subscriber-triage`, `design-campaign`\n- Returns markdown instructions + a live-state snapshot\n- `nextToolSuggestions` pre-fills arguments for the next likely tool call\n\n## Resources and prompts\n\n| Type | Name | Description |\n|:---|:---|:---|\n| Resource | `mailchimp://account` | Account info snapshot — profile, plan, data center, total subscribers. |\n| Resource | `mailchimp://audiences/{audienceId}` | Audience snapshot — name, contact, stats, double-opt-in status. |\n| Resource | `mailchimp://campaigns/{campaignId}` | Campaign snapshot — status, settings, recipients summary. |\n| Resource | `mailchimp://campaigns/{campaignId}/report` | Post-send campaign report headline metrics. |\n| Prompt | `newsletter_from_source` | User-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. |\n\nAll 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`](./docs/email-design-playbook.md).\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):\n\n- Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation\n- Unified error handling — handlers throw, framework catches, classifies, and formats\n- Pluggable auth: `none`, `jwt`, `oauth`\n- Structured logging with optional OpenTelemetry tracing\n- STDIO and Streamable HTTP transports\n\nMailchimp-specific:\n\n- Auto-derives the API base URL from the `-dc` suffix on the API key\n- Safe-by-default send workflows — elicit confirmation, pending-status imports, no permanent deletes from agent surface\n- Workflow tools parallelize related sub-requests under a configurable concurrency limit\n- Domain normalization shapes sparse upstream payloads into compact, LLM-friendly output without fabricating values\n\n## Getting started\n\nAdd the following to your MCP client configuration file. See [`docs/api-key.md`](./docs/api-key.md) for how to generate a Mailchimp API key.\n\n```json\n{\n  \"mcpServers\": {\n    \"mailchimp-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/mailchimp-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\",\n        \"MAILCHIMP_API_KEY\": \"your-key-with-dc-suffix-e.g.-us22\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"mailchimp-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/mailchimp-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\",\n        \"MAILCHIMP_API_KEY\": \"your-key-with-dc-suffix-e.g.-us22\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"mailchimp-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-e\", \"MCP_TRANSPORT_TYPE=stdio\",\n        \"-e\", \"MAILCHIMP_API_KEY=your-key-with-dc-suffix-e.g.-us22\",\n        \"ghcr.io/cyanheads/mailchimp-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 MAILCHIMP_API_KEY=... bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Bun v1.3.2](https://bun.sh/) or higher (or Node.js v24+).\n- A Mailchimp Marketing API key — the key's `-dc` suffix (e.g. `-us22`) identifies your data center and is parsed at startup.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/mailchimp-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd mailchimp-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment:**\n\n```sh\ncp .env.example .env\n# edit .env and set MAILCHIMP_API_KEY\n```\n\n## Configuration\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `MAILCHIMP_API_KEY` | **Required.** Mailchimp Marketing API key including `-dc` suffix (e.g. `abc…-us22`). | — |\n| `MAILCHIMP_BASE_URL` | Override API base URL (for mock servers or tests). | `https://{dc}.api.mailchimp.com/3.0` |\n| `MAILCHIMP_TIMEOUT_MS` | Per-request timeout in milliseconds. | `60000` |\n| `MAILCHIMP_MAX_RETRIES` | Max retry attempts for transient upstream failures (0-10). | `3` |\n| `MAILCHIMP_CONCURRENCY_LIMIT` | Max in-flight upstream requests per workflow tool (1-10). | `4` |\n| `MAILCHIMP_ASSETS_DIR` | Absolute path to a local assets directory. When set (Node-only), enables the `mailchimp_assets` tool and auto-uploads `@assets/\u003cpath\u003e` references in campaign HTML to Mailchimp File Manager. Cache at `\u003cdir\u003e/.mailchimp-cache.json`. | unset |\n| `MAILCHIMP_TEMPLATES_DIR` | Absolute path to a local templates directory. When set (Node-only), enables the `mailchimp_local_templates` tool and support for `content.localTemplate` on campaign tools. Templates are `.eta` files with optional `\u003cname\u003e.meta.yaml` sidecars. | unset |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_HOST` | HTTP server hostname. | `127.0.0.1` |\n| `MCP_HTTP_PORT` | HTTP server port. | `3010` |\n| `MCP_HTTP_ENDPOINT_PATH` | MCP endpoint path. | `/mcp` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |\n| `LOGS_DIR` | Directory for log files (Node.js only). | `\u003cproject-root\u003e/logs` |\n| `OTEL_ENABLED` | Enable OpenTelemetry. | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n## Local assets (optional)\n\nSet `MAILCHIMP_ASSETS_DIR` to enable a local-image workflow on top of Mailchimp's File Manager. Drop image files into the directory, reference them in HTML as `@assets/\u003crelative-path\u003e`, and the server uploads + rewrites at send time.\n\n```sh\nexport MAILCHIMP_ASSETS_DIR=/Users/me/Pictures/email-assets\n```\n\nThen in a campaign:\n\n```html\n\u003cimg src=\"@assets/hero.png\" alt=\"Hero\"\u003e\n\u003ca href=\"@assets/whitepaper.pdf\"\u003eDownload\u003c/a\u003e\n```\n\nWhen `mailchimp_send_campaign` (or `mailchimp_campaigns set-content` / `mailchimp_replicate_campaign contentOverride`) sees these references, it:\n\n1. Hashes each referenced file (SHA-256).\n2. Uploads cache misses to Mailchimp File Manager via the `mailchimp_files` tool surface.\n3. Caches `sha256 → file_id + URL` at `\u003cassetsDir\u003e/.mailchimp-cache.json` (atomic writes; safe to delete to force re-upload).\n4. Rewrites every `@assets/\u003cpath\u003e` to the public CDN URL before passing content upstream.\n\nThe `mailchimp_assets` tool exposes `list`, `info`, `sync` (pre-warm), and `clear-cache` for direct inspection — most workflows don't need it.\n\n**Caveats:**\n- Mailchimp caps images at **1 MB** and other files at **10 MB**. Oversize files fail before upload with an actionable error.\n- Allowed extensions: see the `mailchimp_files` tool description. **WebP and AVIF are NOT in the allowlist** — convert to PNG/JPG.\n- Path traversal is rejected (`../` and absolute paths throw `Forbidden`).\n- The `mailchimp_assets` tool is **Node-only**; on Cloudflare Workers it isn't registered.\n\n## Local templates (optional)\n\nSet `MAILCHIMP_TEMPLATES_DIR` to enable a local-template authoring workflow on top of [Eta](https://eta.js.org/) (v4 — fast, ESM-native, supports partials/conditionals/loops). **This is the canonical write path for templates on free-tier Mailchimp accounts**, where the upstream `/templates` API is read-only.\n\n```sh\nexport MAILCHIMP_TEMPLATES_DIR=/Users/me/email-templates\n```\n\n```text\nemail-templates/\n  welcome.eta              # body + optional YAML frontmatter\n  newsletter.eta\n  partials/\n    header.eta\n    footer.eta\n```\n\nTemplate (`welcome.eta`) — YAML frontmatter on top, Eta body below:\n\n```eta\n---\nsubject: \"Welcome to {{brand}}\"\npreviewText: \"Onboarding starts here\"\nvars:\n  - firstName\n  - brand\n---\n\u003c%~ include('partials/header', it) %\u003e\n\u003ch1\u003eHello \u003c%= it.firstName %\u003e\u003c/h1\u003e\n\u003cp\u003eWelcome to \u003c%= it.brand %\u003e.\u003c/p\u003e\n\u003cimg src=\"@assets/hero.png\" alt=\"Hero\"\u003e\n```\n\nFrontmatter is optional — a body with no `---` block is treated as a meta-less template. All meta fields are optional too. The `vars:` list is informational only (declared variables aren't schema-enforced).\n\n\u003e **Sidecar fallback (legacy):** prior to v0.3.1, meta lived in a separate `\u003cname\u003e.meta.yaml` file next to the body. That form still works for backward compatibility — if a `.eta` has no frontmatter, the loader falls back to reading the sidecar. Frontmatter takes precedence when both exist.\n\nReference from any campaign tool:\n\n```jsonc\n{\n  \"audienceId\": \"abc123\",\n  \"subject\": \"Welcome to Acme\",\n  \"fromName\": \"Casey\",\n  \"replyTo\": \"casey@acme.com\",\n  \"content\": {\n    \"localTemplate\": \"welcome\",\n    \"localTemplateVars\": { \"firstName\": \"Sam\", \"brand\": \"Acme\" }\n  },\n  \"mode\": \"draft\"\n}\n```\n\nThe render pipeline:\n1. Eta renders `welcome.eta` with `it = { firstName: 'Sam', brand: 'Acme' }`.\n2. If L1 is configured, `@assets/hero.png` is uploaded to Mailchimp File Manager and rewritten to a CDN URL.\n3. Final HTML is set on the campaign via Mailchimp's `set-content`.\n\nThe `mailchimp_local_templates` tool exposes `list`, `get`, `render-preview` (returns HTML without sending), and `seed-from-mailchimp` (reads a Mailchimp `base`/`user` template by ID and writes it to disk as a starting point — useful on free where you can read but not write upstream).\n\n### Example templates in this repo\n\nThe [`templates/`](./templates) directory holds working examples — point `MAILCHIMP_TEMPLATES_DIR` at it directly to try them, or copy them into your own dir as a starting point:\n\n| Template | What it shows |\n|:---------|:--------------|\n| [`welcome.eta`](./templates/welcome.eta) | Minimal body — frontmatter declaring `subject` / `previewText` / `vars`, `\u003c%= it.firstName %\u003e` interpolation, `\u003c% if %\u003e` conditional CTA block |\n| [`redden-gardens-april-2026.eta`](./templates/redden-gardens-april-2026.eta) | Full inline-styled HTML newsletter. Demonstrates the recommended split: **Mailchimp merge tags** (`*\\|FNAME\\|*`) for per-recipient personalization on real list sends, **Eta vars** (volume / issue / monthYear / URLs) for list-wide constants substituted at template-render time |\n\n**Caveats:**\n- `localTemplate` is mutually exclusive with `html` and `templateId` on the same content block.\n- Var validation isn't enforced by the schema — missing/extra vars surface as Eta render errors at send time.\n- Path traversal is rejected.\n- Node-only; not available on Workers.\n\n## Running the server\n\n### Local development\n\n- **Watch mode** (transport via `MCP_TRANSPORT_TYPE`):\n\n  ```sh\n  bun run dev                                     # stdio (default)\n  MCP_TRANSPORT_TYPE=http bun run dev             # http\n  ```\n\n- **Build and run:**\n\n  ```sh\n  bun run rebuild\n  bun run start:stdio\n  # or\n  bun run start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck   # Lint, format, typecheck, security\n  bun run test       # Vitest test suite\n  bun run lint:mcp   # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t mailchimp-mcp-server .\ndocker run --rm -e MAILCHIMP_API_KEY=your-key-us22 -p 3010:3010 mailchimp-mcp-server\n```\n\nThe 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.\n\n## Project structure\n\n| Directory | Purpose |\n|:---|:---|\n| `src/index.ts` | `createApp()` entry point — registers tools/resources/prompts and inits services. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Seventeen Mailchimp tools. |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). Four snapshot resources. |\n| `src/mcp-server/prompts` | Prompt definitions (`*.prompt.ts`). Newsletter starter prompt. |\n| `src/services/mailchimp` | Mailchimp client wrapper — HTTP plumbing, retries, normalization, typed surface. |\n| `tests/` | Vitest tests mirroring `src/`. Currently only `config/` is covered; other subdirs are scaffolded for expansion. |\n\n## Development guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for request-scoped logging\n- Register new tools and resources via the barrels in `src/mcp-server/*/definitions/index.ts`\n- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyanheads%2Fmailchimp-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyanheads%2Fmailchimp-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyanheads%2Fmailchimp-mcp-server/lists"}