Skip to main content
Glama
mailchimp-mcp

mailchimp-mcp

by tomjones
README.md
# mailchimp-toolkit

A command-line tool and MCP server for the Mailchimp Marketing API v3. The `mailchimp` command reads and
changes audiences, members, tags, segments, campaigns and reports. The `mailchimp-mcp` server gives Claude,
ChatGPT and other AI assistants the same operations as tools, read-only unless you allow writes and with
subscribers' personal data masked.

## Install

```bash
uv tool install git+https://github.com/tomjones/mailchimp-toolkit
# or
pipx install git+https://github.com/tomjones/mailchimp-toolkit
```

It needs Python 3.10 or newer.

## Connect

```bash
mailchimp configure    # prompts for your API key (hidden) and a default audience
mailchimp ping         # checks the key and shows the account name
```

`mailchimp configure` saves the key to `~/.config/mailchimp-toolkit/.env` with mode 0600. Create a key under
Extras > API keys in Mailchimp ([guide](https://mailchimp.com/help/about-api-keys/)).

## Examples

```bash
mailchimp audiences list
mailchimp members get jane@example.com
mailchimp signups report --since 7d --by source
mailchimp signups bursts --since 7d
mailchimp reports list --since 30d
mailchimp reports get b2c3d4e5f6
mailchimp members export --status subscribed --csv exports/members.csv
```

Add `--json` to any command for machine-readable output. Without a default audience, pass `--audience ID`;
`mailchimp audiences list` shows the IDs.

## Commands

| Group | What it does |
|---|---|
| `audiences` | Lists audiences with their stats, daily activity and monthly growth |
| `members` | Looks up, lists, exports, adds, updates, archives, unsubscribes and resubscribes members |
| `tags` | Lists tags, and adds or removes them on many members at once |
| `segments` | Lists, creates and deletes segments, and lists a segment's members |
| `merge-fields` | Lists and finds merge fields, audits them for blank values and fills in defaults |
| `interests` | Lists interest categories and their interests |
| `signups` | Counts recent signups by source, day, country or hour, and finds bursts such as a bot hitting a form |
| `campaigns` | Lists campaigns and fetches their settings and content |
| `reports` | Shows campaign reports, per-link clicks, opens and unsubscribes |
| `templates` | Lists templates and fetches their content |
| `automations` | Lists classic automations and their emails |
| `forms` | Lists signup forms and landing pages |
| `webhooks` | Lists, creates and deletes audience webhooks |
| `batches` | Shows the status of Batch API operations |
| `sync` | Copies Salesforce records and payment CSV exports into merge fields |
| `account`, `ping`, `configure` | Show the account, check the connection and save credentials |

[docs/commands.md](docs/commands.md) lists every command and option, and [docs/sync.md](docs/sync.md)
explains the Salesforce and payment CSV syncs.

## Use it with Claude or ChatGPT

### Claude Code or Codex

Paste this into Claude Code or Codex:

> Set up mailchimp-toolkit from https://github.com/tomjones/mailchimp-toolkit. Install it with `uv tool install git+https://github.com/tomjones/mailchimp-toolkit`, or with pipx if uv is missing. Then stop and ask me to run `mailchimp configure` in a separate terminal, so that you never see my API key. When I say it is done, add the MCP server read-only (Claude Code: `claude mcp add --transport stdio --scope user mailchimp -- mailchimp-mcp`; Codex: `codex mcp add mailchimp -- mailchimp-mcp`), run `mailchimp ping`, and tell me which account it connected to. Before running any other mailchimp command, read https://github.com/tomjones/mailchimp-toolkit/blob/main/AGENTS.md and follow it.

If the assistant does not show the `mailchimp` tools afterwards, restart it.

### Claude Desktop

Install the toolkit and run `mailchimp configure` as above. In Claude Desktop, open Settings > Developer >
Edit Config, add the server, then quit and restart the app:

```json
{
  "mcpServers": {
    "mailchimp": {
      "command": "mailchimp-mcp",
      "args": []
    }
  }
}
```

If Claude Desktop cannot find `mailchimp-mcp`, use the absolute path that `which mailchimp-mcp` prints.

### ChatGPT

The ChatGPT desktop app reads the same `~/.codex/config.toml` as Codex, so the Codex prompt above sets it up
too. You can also add the server in the app under Settings > MCP servers > Add server, with STDIO and the
command `mailchimp-mcp`. ChatGPT on the web cannot start local programs;
[docs/ai-assistants.md](docs/ai-assistants.md#chatgpt-on-the-web) explains the options.

### Things to ask

- "How many people joined each audience in the last 30 days, by source?"
- "Check the main audience for signup bursts this week. Do any look like bots?"
- "Compare open and click rates for the last five campaigns."
- "Which merge fields have the most blank values?"

[docs/ai-assistants.md](docs/ai-assistants.md) covers every client's configuration, the server options,
writes, several accounts and troubleshooting.

## Privacy

The MCP server masks email addresses, names, phone numbers, merge field values, IP addresses, and free text
such as notes and unsubscribe reasons in every result. The `mailchimp` command masks them in output captured
by another program, which is how AI assistants run commands, and a person at a terminal sees full records.
`--include-pii` turns masking off, and files written with `--csv PATH` or `--output PATH` always hold full
data.

Members can be addressed by member ID, so an assistant can act on them without seeing an address. For
example, to remove a bot run without printing any address:

```bash
mailchimp signups list --since 24h --source "API" --ids-only | mailchimp members archive --file - --dry-run
```

An assistant with a shell could type `--include-pii` itself. [AGENTS.md](AGENTS.md) tells it not to unless
you ask. On the MCP server, `--include-pii` is a startup flag that no tool call can change, so use the MCP
server when you work with real subscriber data.

## Safety

The MCP server is read-only unless started with `--allow-writes`. Permanent deletion, segment deletion, bulk
merge-field writes and syncs are available only on the command line.

On the command line, every command that writes takes `--dry-run`, which shows what would change and sends no
writes. Commands that change many members at once (tagging, archiving, unsubscribing, resubscribing,
permanent deletion, merge-field defaults and syncs), and commands that delete segments or webhooks, refuse to
run without `--yes`. So does `members update` or `members upsert` with `--status unsubscribed` or
`--status cleaned`.

## Troubleshooting

- `401 API Key Invalid` or `API Key Expired` means the saved key no longer works. Run `mailchimp configure`
  with a new key.
- `No audience selected` means no default audience is saved. Pass `--audience ID`, or run
  `mailchimp configure` again and enter one.
- Masked values such as `j***@example.com` appear when output is piped or captured. Add `--include-pii`, or
  write the records to a file with `--csv PATH`.
- Set `MAILCHIMP_DEBUG=1` to see the full traceback for an error.

## Build from source

You need Python 3.10 or later.

```bash
git clone https://github.com/tomjones/mailchimp-toolkit.git
cd mailchimp-toolkit
python3 -m venv venv
./venv/bin/pip install -e ".[dev]"
./venv/bin/mailchimp --version
```

[docs/development.md](docs/development.md) describes the layout, the pre-commit hooks and how the command
reference is generated.

## Tests

```bash
./venv/bin/pytest
./venv/bin/ruff check src tests scripts
```

The tests mock every HTTP request, so they never call Mailchimp. On GitHub they run on Python 3.10, 3.11,
3.12 and 3.13, and a second workflow scans every commit for secrets with gitleaks.

## License

Released under the [MIT License](LICENSE).

mailchimp-toolkit is an independent project and is not affiliated with Mailchimp or Intuit. Mailchimp is a
registered trademark of The Rocket Science Group LLC.

TDQS

B3.4/5.0

Scored across 40 tools

Disambiguation4/5

Most tools target distinct resource+action pairs (audiences_*, campaigns_*, reports_*, templates_*), and the descriptions explicitly steer agents between near-neighbors (e.g. members_list says to use signups_report or audiences_get for counts). The main soft spots are merge_fields_list vs merge_fields_find vs merge_fields_audit_blanks, and the signups_list/signups_report/signups_bursts triad, which rely on prose to separate rather than names.

Naming Consistency4/5

There is a clear dominant convention of resource_verb with plural resource nouns (audiences_list, campaigns_get, reports_clicks, batches_get, signups_report). Minor deviations exist: ping, account_get (singular resource), and merge_fields_find (verb 'find' rather than list/get), but the pattern remains highly predictable.

Tool Count2/5

40 tools is well above the workable range for a single server, and many are near-duplicate list/get read pairs across parallel resources (audiences, campaigns, reports, templates, automations, batches, forms). Many of the analytics tools (signups_bursts, merge_fields_audit_blanks, sync_mapping_validate) are niche additions that push the surface well past what an agent can hold in working context.

Completeness3/5

The read/analytics surface is broad — audiences, members, campaigns, reports, templates, automations, forms, webhooks, batches, plus a Salesforce sync sub-domain — so inspection is well covered. However, there is no write path at all: no member create/update/tag/unsubscribe, no campaign create/send, no segment or webhook creation, which are core Mailchimp workflows an agent would reasonably expect.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues