iCloud Gmail Outlook Fastmail Yahoo IMAP
Your agent reads and answers your mail. You run the server.
postkeep is a free, MIT-licensed MCP server for the mail you already have. Your agent can search, read, reply and file, and a webhook can tell it when new mail arrives.
What needs a reply today?
Usedpostkeepsearch_messages, get_message
Work · 14 unread3 need a reply
- NWNorthwindInvoice 1042 · OctoberInvoice dueOct 24
- OTOps teamRe: Launch checklistQuestionOct 22
- SBStudio billingPayment details updatedCheck detailsOct 21
+11 more
First, Northwind’s October invoice (1042). Here’s a reply for that thread. Send it?
ToNWNorthwindbilling@northwind.exampleSame thread
Hi, thanks for the October invoice. It’s in, and we’ll pay it this week.
Plain text · no attachments
Send it.
reply_to_messagesent to Northwind, in the same threadSent
1
search_messagesreadOnlyHint{ "unread_only": true, "limit": 20 }→
14 messages, newest first2
get_messagereadOnlyHint{ "id": "<id from search_messages>" }→
Invoice 1042 · October, the body as Markdown3
reply_to_messageopenWorldHintdestructiveHint{ "id": "<same id>", "body": "Hi, thanks for the October invoice. It’s in, and…" }→
sent, in the same thread
Streamable HTTP · OAuth 2.1
Install
A key, a container, and HTTPS
Back up the master key apart from the data, and keep the same key across restarts and upgrades: it decrypts the saved passwords and sign-ins.
01
Generate a master key
It encrypts the saved passwords and sign-ins. Keep a copy somewhere safe.
test -s master.key || (umask 077 && docker run --rm postkeep/postkeep generate-key > \ master.key)02
Start the server behind HTTPS
One container or one binary, with your public address and who may connect.
POSTKEEP_PUBLIC_URL POSTKEEP_MASTER_KEY POSTKEEP_ALLOWED_EMAILS03
Add it to your agent app
Paste the /mcp address. The app opens postkeep’s sign-in page.
Tools
Eighteen tools, for your mail
Plain names, one job each. They work the same way across providers, with a few differences the docs list, such as Gmail sending deleted mail to Trash.
Read4
list_foldersreadOnlyHintLists your folders and their roles, such as Inbox, Sent and Trash.
search_messagesreadOnlyHintSearches a folder by sender, recipient, subject, text, date, unread or flagged, newest first.
get_messagereadOnlyHintReads one message: headers, the body as Markdown (links and images as references, never loaded) or plain text, and the attachment list with ids;
body_format: "html"gives the raw HTML instead (Markdown is recommended for LLMs). It stays unread.download_attachmentreadOnlyHintDownloads one attachment of a message: images as images, text as text, other files as base64, or any file as base64 with
base64: true, up to 3 MiB. It stays unread.
Send4
send_messageopenWorldHintdestructiveHintSends a new plain-text email with any attachments or forwards a message with its attachments. Saves a copy to Sent by default.
reply_to_messageopenWorldHintdestructiveHintReplies, or replies to all, with any attachments, and keeps the thread together.
create_draftSaves a new draft or threaded reply, with any attachments, to the Drafts folder without sending it. Not available for Outlook or for Gmail with Sign in with Google.
upload_attachmentGives a one-time upload for one file’s bytes, sent with a command, to attach to one message. Off unless the server has a bucket.
Organize4
update_flagsMarks a message read or unread, flagged or unflagged.
move_messageMoves a message to another folder.
delete_messagedestructiveHintMoves a message to the trash, or deletes it for good when you ask.
create_folderCreates a new folder.
Alerts6
get_webhook_statusreadOnlyHintShows whether this mailbox’s new-mail webhook is active, paused, off, not set up, unreadable, waiting for a new password, or
rules_unreadable(its filter rules can’t be read or compiled), with its outbox limits and filter rule counts.set_webhook_enabledopenWorldHintdestructiveHintTurns this mailbox’s new-mail webhook on or off.
set_webhook_outbox_limitsdestructiveHintSets how long new-mail events are kept, and how many.
list_webhook_filtersreadOnlyHintLists this mailbox’s webhook filter rules, oldest first, a page at a time.
add_webhook_filterAdds a rule that chooses which new mail sends an event.
remove_webhook_filterdestructiveHintRemoves one filter rule, or all of them.
You set the webhook address and its secrets yourself, on your server’s account page.
Full tool referenceWorks with
The agent apps and mailboxes you already use
postkeep speaks MCP over Streamable HTTP, with OAuth sign-in. Add your server’s /mcp address, and the app opens postkeep’s sign-in page.
Agent apps5
- ClaudeAdd a custom connector and paste the address.
- ChatGPTCreate an app in developer mode, with the address and OAuth.
- GrokAdd a custom connector with the address.
- CursorAdd the address to
~/.cursor/mcp.json. - VS CodeRun MCP: Add Server, choose HTTP, and paste the address.
Other remote MCP clients with OAuth sign-in connect the same way. Clients that only run local servers can use a bridge such as mcp-remote.
Mailboxes6
- iCloud MailAn app-specific password. The sign-in page shows the steps.
- GmailAn app password, or Sign in with Google. Labels show up as folders.
- Outlook.com and Microsoft 365Sign in with Microsoft, with a personal or a work or school account.
- FastmailAn app password.
- Yahoo MailAn app password.
- Your own IMAP serverAdded by the server’s operator, with IMAP and SMTP settings.
For Outlook, and for Gmail with Sign in with Google, you register one OAuth app with Microsoft or Google. The setup guides walk you through it. Each connection is one mailbox, so add the server to your agent app once for each mailbox you want.
Self-host
Yours to run
postkeep is one Rust binary, also published as a container image for linux/amd64 and linux/arm64. You choose where it lives and who can use it.
Fits the machine you have
A VPS, a home server, a container platform or Kubernetes. Give it HTTPS, the master key and a volume or PostgreSQL.
SQLite or PostgreSQL
SQLite by default. Point it at PostgreSQL and set POSTKEEP_WEBHOOKS=false to run several replicas.
You hold the key
Saved app passwords, Microsoft and Google sign-ins, webhook secrets and filter patterns, stored events and uploaded files, in your bucket, are encrypted with AES-256-GCM under data keys wrapped by a master key you generate.
You choose who connects
List the addresses allowed to use your server in
POSTKEEP_ALLOWED_EMAILS. postkeep checks it at sign-in and on every request.An account page for each person
At
/accounton your server, each person can see their connection, disconnect their agent apps, set up a webhook, or delete what the server keeps about them.
Open source
MIT licensed, and yours to change
Use it, change it and share it, free of charge. The code, the threat model and the October 2026 security reviews are all in the repository.
- IMAP and SMTP client, with presets for iCloud, Fastmail, Yahoo and Gmail
- upstream
- OAuth client and token refresh for Microsoft and Google
- store
- Storage: SQLite by default, PostgreSQL optional
- auth
- OAuth 2.1 server, plus the sign-in and account pages
- webhook
- Webhook delivery: signing and retries
- server
- The postkeep binary: MCP over Streamable HTTP
MIT License · postkeep contributors
Reviewed in the open
postkeep Cloud
The hosted service built on this server. It isn’t open yet.The hosted service. It isn’t open yet.
About postkeep CloudYour agent does the mail work. You keep the free end of the line.
Run the server, add its /mcp address to your agent app, then ask in your own words.


