MCP Server
Pigeon ships an MCP server exposing eight mail tools. Run it over stdio for
local clients, or use the /mcp HTTP endpoint of pigeon serve.
stdio
The process reads MCP JSON-RPC on stdin/stdout and logs to stderr. It opens the
same data directory as pigeon serve (~/.pigeon by default); pass
--data DIR in args if you use a custom location.
Streamable HTTP
pigeon serve mounts the MCP endpoint at /mcp. It is stateless and replies
with JSON (application/json, not SSE). Authenticate exactly like the REST
API — bearer token required for non-loopback clients:
Tools
| Tool | Parameters | Description |
|---|---|---|
list_accounts |
— | Accounts with unread counts |
list_mailboxes |
account? |
Mailboxes with unread/total counts and attributes |
list_messages |
account?, mailbox?, limit?, query?, unseenOnly? |
Message summaries, newest first |
read_message |
id, includeHtml? |
Full message; fetches the body if uncached |
search_messages |
query?, from?, subject?, body?, since?, until?, account?, limit? |
Search cached mail; metadata by default |
sync_mailbox |
account?, mailbox? |
Fetch new mail over IMAP |
set_message_flags |
id, seen?, flagged? |
Change read/starred state on server and locally |
send_email |
account?, to, cc?, bcc?, subject, text, html?, inReplyTo?, attachments? |
Send over SMTP and archive to Sent |
Parameter notes:
accountaccepts an account ID, email address or name. It may be omitted when exactly one account is configured.mailboxaccepts a path or display name and defaults toINBOX.list_messagesdefaults to 20 results, maximum 100;search_messagesthe same for hits.search_messagesrequires at least one ofquery,from,subject,sinceoruntil, and searches all accounts unlessaccountis given.querymatches subject and sender/recipient metadata; setbody=trueto also match snippet and cached body text (bodies are fetched lazily, and body searches are slower).since/untilacceptYYYY-MM-DD(local time,untilinclusive through end of day) or RFC3339 timestamps.read_messagereturns text truncated to 64 KiB and, withincludeHtml, HTML up to 256 KiB. It does not mark the message as read. When the message has attachments, anattachmentsarray of{id, filename, contentType, size}metadata is included — bytes download through the REST endpointGET /api/attachments/{id}. Stored attachments are capped at 25 MB each; larger files are skipped and do not appear in the array.send_emailaccepts anattachmentsarray of{filename, contentType?, content}objects, wherecontentis standard base64. It requires explicit user intent. It is annotated as non-idempotent and OpenWorld, so MCP clients that surface confirmations will ask first.
Output shapes
MCP outputs are JSON-friendly variants of the REST objects. Dates are ISO-8601
UTC strings (e.g. 2026-12-01T08:30:00Z) rather than Unix seconds. Examples:
Recommended flow
The server’s built-in instructions suggest this pattern to agents:
list_accounts→list_mailboxesto learn what exists.- If a mailbox looks empty or stale,
sync_mailbox. list_messages/search_messagesto find mail,read_messagefor the body.- Use
set_message_flagsonly when the user wants read/starred state changed. - Call
send_emailonly with clear user intent, after confirming recipients and content.