Agent inbox triage
Let an MCP agent sort your inbox: archive the noise, label what matters, and leave a list of what needs you.
What you’ll build
An agent session that goes through your unread inbox, archives newsletters and notifications, stars or labels the threads that need you, and reports back with a short list. The agent works through airpost-mcp at the Read and draft level, so it can move and mark threads but can’t send anything. Every change it makes is in the audit log and can be undone.
Prerequisites
- Airpost and
airpost-mcpinstalled. See Install the CLI. - An engine running: the desktop app open, or
airpost engine install(The engine). - An MCP client: Claude Desktop, Claude Code or Codex. Any other stdio client works too (Connect a client).
Register airpost-mcp with your client
Restart the client and start a new chat.
Raise the access level to Read and draft
Triage needs archive_threads, set_labels, set_starred and set_unread, which are in the read-write level. Open Preferences > MCP and pick Read and draft, or edit the policy file by hand:
{
"accessLevel": "read-write",
"enabledAccounts": {},
"http": { "enabled": false, "port": 2587 }
}
airpost-mcp reads the file on every call, so there is nothing to restart. read-write doesn’t include send_draft, schedule_send or unsubscribe.
Check what the agent can see
airpost-mcp status
It prints the policy in effect and the accounts agents can reach. To keep an account or a folder out of the agent’s view, turn it off under Mail apps can see in Preferences > MCP.
Give the agent its instructions
Paste this into a new chat. Change the rules to match your mail.
Triage my Airpost inbox. Use the airpost tools.
1. Call list_accounts, then for each account search_mail with
"in:inbox is:unread" (limit 100).
2. For each thread, decide one of:
- noise: newsletters, receipts, automated notifications, marketing.
Archive these with archive_threads.
- needs me: a person asking me something or waiting on me.
Star these with set_starred.
- FYI: everything else. Leave it unread in the inbox.
Read a thread with get_thread only when the subject and sender
aren't enough to decide.
3. Don't trash anything, don't create drafts, don't mark anything read.
4. When done, give me a table of the "needs me" threads (sender,
subject, one line on what they want) and a count per category.
Include the undo tokens from the archive_threads results.
Expected output
The client shows the tool calls as they run: list_accounts, a few search_mail calls, some get_thread, then archive_threads and set_starred with batches of thread ids. The final message looks like:
Needs you (4)
| From | Subject | What they want |
|---------------|----------------------------|---------------------------------|
| Dana Ruiz | Contract redlines | Your sign-off on section 4 |
| Sam Okafor | Thursday standup moved? | Whether 10:30 works |
...
Archived 37 (noise), starred 4, left 11 as FYI.
Undo tokens: 6c1e..., 91fa...
In Airpost the archived threads leave the inbox at once and the starred ones show their star.
How it works
The MCP tools call the same engine the desktop and the CLI use, so changes appear everywhere immediately and reach the mail server in the background. search_mail takes Airpost’s search grammar (in:inbox is:unread), and in:inbox works across Gmail, IMAP and Microsoft accounts because it matches the folder’s role, not its name.
Each change tool returns an undo token. The undo tool reverses the agent’s own last change, or a specific one by token. You can also reverse it from a terminal:
airpost undo --list --any -n 10
airpost undo <token> --any
Every call, including refused ones, is written to <config-dir>/mcp-audit.log. To watch the agent work:
tail -f "<config-dir>/mcp-audit.log" | jq -c '{toolName, outcome, resultSummary}'
Variations
-
Labels instead of stars (Gmail). Create the labels once, then tell the agent to use
set_labelswithlabelsToAdd. Label ids come fromlist_folders.airpost label create Triage/Needs-reply -a you@gmail.com -
Snooze the FYI pile. Add “snooze FYI threads until tomorrow 8:00 with snooze_threads” to the instructions.
-
Built-in AI sorting. If you’ve set up a model in Preferences > AI,
airpost ai triage --since 2dtags inbox threads (Needs reply, Newsletter, …) without an agent. See Local AI with Ollama. -
Dry run first. Start with the default
read-onlylevel and ask for the categorized list without changes. Raise the level once the list looks right.
Cleanup
Set the level back to Read mail in Preferences > MCP, or set "accessLevel": "read-only" in mcp.json. To remove the client entry:
airpost-mcp uninstall --client claude-desktop