Mailgun CLI is now available
Mailgun already meets your agent in the chat window via the Cursor MCP server and Claude Docs connector. The CLI meets it in the terminal instead: a new mailgun command for the contexts a chat-based tool cannot reach. This includes CI pipelines, cron jobs, scripts, and coding agents that operate entirely outside a conversation.
The command surface is still growing, and we want feedback on what to prioritize next. Try it:
npm install -g @mailgun/cli
mailgun metrics summary –domain yourdomain.com –json
Why does this matter?
- Coding agents and CI systems that cannot hold an interactive chat session can still act on Mailgun. The same “check sending health” or “run a campaign preflight” logic behind the MCP Skills is now reachable from a shell script or pipeline step.
- Every command outputs clean JSON. It drops straight into scripts, CI logs, or another agent’s context without extra parsing. Pass –json on any command.
- Nearly all commands are read-only. The one write command (preview run) requires an explicit –dry-run or –yes flag and never prompts, meaning behavior is deterministic even when an agent is driving it.
- mailgun agent-context gives any agent a versioned, machine-readable map of the full command surface instead of one it has to guess at from –help text.
Current coverage: Send metrics and live events, Validate, Optimize inbox placement, and Inspect email preview QA. Composite workflow commands like preflight and investigate are next. Your feedback on this release shapes which ones we build first.
Found a bug or a rough edge? Open an issue on the mailgun-cli GitHub repo at github.com/mailgun/mailgun-cli.
What’s not affected:
- Existing API, SMTP, MCP, and Skills integrations are unchanged. The CLI is an additional surface, not a replacement for any of them.
- The CLI requires a Mailgun API key, the same as the MCP server.
- preview run is the only write command, and it never runs without an explicit –dry-run or –yes flag and never prompts, so behavior is deterministic even when an agent is driving it.