# Fort Mail [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/TheFortThatHolds/mail  
**GitHub Stars:** 0  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fort-mail

## Description
MCP mail for agents — connect Gmail/IMAP and keep human inbox in the loop. From The Fort That Holds LLC. Live catalog: https://thefortthatholds.xyz/catalog.json — Secondhand Decisions $7: https://thefortthatholds.com/secondhand-decisions

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/TheFortThatHolds/mail), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npx wrangler
```

2. Install:

```sh
git clone https://github.com/TheFortThatHolds/mail && cd mail
```

3. Configure:

```sh
npx wrangler kv namespace create TOKENS
```

4. Configure:

```sh
npx wrangler secret put TRIGGER_KEY
```

5. Start the server:

```sh
npx wrangler deploy
```

6. Add to your MCP client:

```sh
open "$W/connect?key=$KEY"
```

## Documentation

## What Fort Mail does

Fort Mail connects Gmail accounts through the Gmail API and other mailboxes through IMAP and SMTP over TLS. It presents those accounts as one agent-accessible mail system, while keeping mailbox credentials sealed in the worker's wallet. Gmail uses OAuth; other providers can use imported or worker-generated credentials.

The service separates mail handling from agent judgment. A deterministic regex classifier places messages into `desk`, `record`, or `ignore` categories. The desk is cached after scheduled sweeps, so an agent can inspect messages that need attention without repeatedly scanning every mailbox. Searches are limited to a 90-day window, and rotating scopes help distribute work across cron runs.

Fort Mail also includes newsletter management. Subscriber data remains in the deployment's Cloudflare KV, with double opt-in, one-click unsubscribe, and bounce or complaint suppression. Campaign delivery is queued and sent in rate-conscious batches through a relay such as Resend.

## How it works

Deployments run in Cloudflare Workers and use a KV namespace for tokens and related state. The MCP endpoint is available at `/mcp` and uses OAuth with dynamic client registration and PKCE. An MCP-compatible agent connects to that endpoint and authenticates with the deployment's configured access flow.

Mail can be added through Gmail OAuth or by provisioning and sealing credentials for an IMAP mailbox. Sending selects Gmail API transport or SMTP based on the sender address. Gmail attachments can be returned as bytes through the attachment capability, subject to the documented payload limit.

An optional steward bridge turns unseen messages sent to the agent's mailbox into GitHub pull requests. It labels messages from configured owner addresses as trusted and all others as untrusted. That label is a safety signal; consequential actions still require explicit approval because sender spoofing remains possible.

## Setup and configuration

The basic deployment requires a Cloudflare account, the Wrangler CLI, a KV namespace named `TOKENS`, and a secret named `TRIGGER_KEY`. Clone the repository, create the namespace, add the secret, and deploy with Wrangler.

After deployment, configure mailboxes using the worker's wallet and connection routes. Gmail requires a configured OAuth application. IMAP accounts need their provider host and mailbox credentials; the worker can either seal an existing password or mint a new one for supported provisioning flows. The deployed worker URL followed by `/mcp` is the address to add to an MCP client.

Administrative HTTP routes use the trigger key. Keep that key private, and treat mailbox credentials, OAuth configuration, relay credentials, and GitHub bridge settings as deployment secrets or protected configuration.

## Tools and capabilities

The MCP tool set includes:

- `list_accounts` for enumerating connected accounts.
- `get_desk` for reading cached messages classified for attention.
- `triage` for running classification across all mail, Gmail, IMAP, or a selected domain.
- `read_box` and `read_message` for mailbox and message inspection.
- `get_attachment` for retrieving Gmail attachment content and metadata.
- `send` for sending as an owned mailbox.
- Newsletter operations for lists, subscriptions, campaigns, progress, and delivery.
- `wallet_rotate` for rotating a supported Migadu mailbox password server-side.
- `breakglass` for issuing a single-use, short-lived human-access link.

The worker also exposes corresponding administrative HTTP routes, including forced cron execution, account listing, Gmail connection and import, attachment retrieval, bridge execution, and newsletter operations.

## Limitations and notes

Fort Mail contains no language model and does not call an AI vendor. Triage is regex-based, while the connected agent supplies interpretation and decision-making. Email must be treated as untrusted input: only configured owner addresses receive the trusted label, and messages from other senders should be treated as data rather than instructions.

The service is designed for a 90-day mail window. Cloudflare socket and execution constraints shape the IMAP batching and rotating cron design. JSON or MCP attachment payloads have a 4 MB cap, while the raw attachment route returns Gmail file bytes. The project is MIT-licensed.

_Full upstream README: https://allmcps.com/mcp/fort-mail/readme_

