productivity
Mailtrap CLI for Headless Automation
Use the Mailtrap CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API token auth
Mailtrap CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Mailtrap CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Mailtrap CLI for Headless Automation
kosmokrator integrations:configure mailtrap --set api_token="$MAILTRAP_API_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call mailtrap.mailtrap_list_inboxes '{}' --json Discovery Before Execution
Agents and scripts can inspect Mailtrap docs and schemas before choosing a function.
kosmo integrations:docs mailtrap --json
kosmo integrations:docs mailtrap.mailtrap_list_inboxes --json
kosmo integrations:schema mailtrap.mailtrap_list_inboxes --json
kosmo integrations:search "Mailtrap" --json
kosmo integrations:list --json Useful Mailtrap CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
mailtrap.mailtrap_list_inboxes | Read | none | List all inboxes in the Mailtrap account. Returns inbox IDs, names, and email addresses. |
mailtrap.mailtrap_get_inbox | Read | inbox_id | Get details for a specific Mailtrap inbox by ID, including its email address, settings, and message counts. |
mailtrap.mailtrap_list_messages | Read | inbox_id, page, per_page, search | List messages in a Mailtrap inbox with optional search and pagination. |
mailtrap.mailtrap_get_message | Read | inbox_id, message_id | Get a single message from a Mailtrap inbox by its ID, including subject, sender, recipient, and body. |
mailtrap.mailtrap_send_test_email | Write | from, to, subject, text, html, inbox_id | Send a test email through Mailtrap. Provide sender, recipient(s), subject, and either text or HTML body. |
mailtrap.mailtrap_list_suppressions | Read | inbox_id, page, per_page | List suppressions (blocked recipients) for a Mailtrap inbox. |
mailtrap.mailtrap_get_current_user | Read | none | Get the current Mailtrap user profile and account info. Useful as a health check. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.