CLI
Drive every MyAgentMail surface from a shell — or from an agent loop where MCP's tool-schema tax compounds (Claude Code, terminal agents, CI). Full parity with the MCP server; every command takes --json.
Install and authenticate
npm install -g myagentmail-cli
myagentmail login # opens the dashboard, you click Approve, the key lands in ~/.config/myagentmail/credentials (mode 0600)
myagentmail whoami
myagentmail doctor # read-only health-check matrix
Headless / CI: myagentmail login --api-key tk_…, or set MYAGENTMAIL_KEY in the environment. The CLI and the MCP server share the same credentials file, so you pick a surface per task, not once forever. Key tiers (tk_ tenant / wk_ workspace / ak_ single inbox) scope the CLI exactly as they scope the API — an ak_ key sees one inbox only.
Command groups
myagentmail <group> --help lists each group's subcommands.
- inboxes —
list get create update delete send add-address remove-address.sendtakes--to --cc --bcc --subject --body --body-html --attach <path>(repeatable)--verified. - messages —
list get reply reply-all forward mark-read delete attachments download; reply/forward accept--attach. - threads —
list get - drafts —
create list get update delete send(compose across turns, send atomically) - calendar —
list agenda get create update rsvp delete free-busy(every inbox has a calendar; external attendees get .ics invites) - domains —
register list get verify zone-file delete - workspaces —
create list get delete issue-key list-keys revoke-key - webhooks —
create list get update delete - cadences —
create list get update delete replace-steps enroll enrollments run-now bulk-relink enrollment - linkedin —
session lookup message connection post search-content searches signals - metrics, verify-email — usage counters; MX pre-flight on addresses
- listen / tail — forward production webhook events to localhost without ngrok;
tailprints one JSON line per event - mcp install / mcp install-skill — write an
@latestMCP config into every detected host; drop the agent playbook (SKILL.md) into a Claude skills dir
Examples
# provision an inbox and send with an attachment
myagentmail inboxes create --username scout --display-name "Scout Bot"
myagentmail inboxes send <id> --to lead@acme.com --subject "Deck" \
--body "As promised." --attach ./deck.pdf --verified
# read new mail, reply in-thread
myagentmail messages list <inbox> --unread --json
myagentmail messages reply <inbox> <msg> --body "Thanks — sending a calendar invite."
# put something on the calendar
myagentmail calendar create <inbox> --title "Intro call" --start 2026-08-20T15:00Z --end 2026-08-20T15:30Z --attendee lead@acme.com
# forward production webhooks to your local handler
myagentmail listen --inbox <id> --forward http://localhost:3000/webhook
CLI or MCP?
Same auth, same capabilities. MCP is right inside hosts that load tool schemas eagerly (Claude Desktop, Cursor, Windsurf, the claude.ai connector). The CLI is right for long agent sessions where that schema cost compounds across hundreds of turns (its surface is discovered lazily via --help), for CI and shell scripts, and for local-dev webhook forwarding. Package: myagentmail-cli on npm.