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.

ClaudeToday’s mailpostkeep

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

MCP callshttps://mail.example.com/mcp

  1. 1search_messagesreadOnlyHint

    { "unread_only": true, "limit": 20 }

    →14 messages, newest first

  2. 2get_messagereadOnlyHint

    { "id": "<id from search_messages>" }

    →Invoice 1042 · October, the body as Markdown

  3. 3reply_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.

  1. 01

    Generate a master key

    It encrypts the saved passwords and sign-ins. Keep a copy somewhere safe.

    sh
    test -s master.key || (umask 077 && docker run --rm postkeep/postkeep generate-key > \
       master.key)
  2. 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_EMAILS
  3. 03

    Add it to your agent app

    Paste the /mcp address. The app opens postkeep’s sign-in page.

    https://mail.example.com/mcp

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_foldersreadOnlyHint

    Lists your folders and their roles, such as Inbox, Sent and Trash.

  • search_messagesreadOnlyHint

    Searches a folder by sender, recipient, subject, text, date, unread or flagged, newest first.

  • get_messagereadOnlyHint

    Reads 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_attachmentreadOnlyHint

    Downloads 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_messageopenWorldHintdestructiveHint

    Sends a new plain-text email with any attachments or forwards a message with its attachments. Saves a copy to Sent by default.

  • reply_to_messageopenWorldHintdestructiveHint

    Replies, or replies to all, with any attachments, and keeps the thread together.

  • create_draft

    Saves 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_attachment

    Gives 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_flags

    Marks a message read or unread, flagged or unflagged.

  • move_message

    Moves a message to another folder.

  • delete_messagedestructiveHint

    Moves a message to the trash, or deletes it for good when you ask.

  • create_folder

    Creates a new folder.

Alerts6

  • get_webhook_statusreadOnlyHint

    Shows 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_enabledopenWorldHintdestructiveHint

    Turns this mailbox’s new-mail webhook on or off.

  • set_webhook_outbox_limitsdestructiveHint

    Sets how long new-mail events are kept, and how many.

  • list_webhook_filtersreadOnlyHint

    Lists this mailbox’s webhook filter rules, oldest first, a page at a time.

  • add_webhook_filter

    Adds a rule that chooses which new mail sends an event.

  • remove_webhook_filterdestructiveHint

    Removes one filter rule, or all of them.

You set the webhook address and its secrets yourself, on your server’s account page.

Full tool reference

Works 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 /account on 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.

crates/Rust, in six crates

mail
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

postkeep Cloud

The hosted service built on this server. It isn’t open yet.The hosted service. It isn’t open yet.

About postkeep Cloud

Your 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.