Use the Mailgun CLI from KosmoKrator to call Mailgun tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Mailgun can be configured headlessly with `kosmokrator integrations:configure mailgun`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure mailgun --set api_key="$MAILGUN_API_KEY" --set domain="$MAILGUN_DOMAIN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor mailgun --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
MAILGUN_API_KEY
Secret secret
yes
API Key
domain
MAILGUN_DOMAIN
Text text
yes
Sending Domain
Call Mailgun Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Mailgun.
mailgun.mailgun_get_current_user
Read read
Verify the Mailgun API connection and retrieve basic account info by listing domains.
Plain text body of the email. Required unless html is provided.
html
string
no
HTML body of the email. Required unless text is provided.
cc
array
no
Array of CC recipient email addresses.
bcc
array
no
Array of BCC recipient email addresses.
tag
array
no
Array of tag strings for categorization.
reply_to
string
no
Reply-to email address.
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.