# aliasflare [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/charleswei118/aliasflare  
**GitHub Stars:** 37  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/aliasflare

## Description
Self-hosted email aliases on Cloudflare Workers + D1 + Email Routing: Deploy button plus two Email Routing settings, reply from alias, OTP extraction, MCP for AI agents. 自建永久别名邮箱

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "aliasflare": {
    "command": "npx",
    "args": ["-y","github:charleswei118/aliasflare"],
    "env": {
      "DOMAIN": "",
      "DESTINATION": "",
      "ADMIN_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `DOMAIN`, `DESTINATION`, `ADMIN_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What aliasflare does

aliasflare provides self-hosted email aliases for one or more domains managed through Cloudflare. Incoming mail is delivered by Cloudflare Email Routing to a Worker, which processes the message and forwards it to a verified inbox. Aliases can be created in the dashboard, through the REST API, through MCP, or automatically when mail arrives if `AUTO_CREATE` remains enabled.

Each alias can be disabled independently. In rewrite mode, forwarded messages identify the alias rather than exposing the original sender address, and replies can travel through a private reply address so the real inbox address is not disclosed. The service can also send new messages from an alias.

Verification codes detected in several languages can be added to the subject line. Tracking pixels and other known one-pixel or hidden images can be removed. D1 stores message metadata rather than message bodies, and if message rewriting fails, the original message is forwarded unchanged.

## How it works

Cloudflare Email Routing sends mail for the configured domain to the Worker's `email()` handler. The Worker associates the recipient address with an alias, applies forwarding and message-processing settings, and sends the result to `DESTINATION`.

Replies use addresses in the `reply+` form. The Worker accepts those reply addresses only for messages coming from the configured destination and passing the relevant SPF or DMARC checks, then forwards the reply to the original sender. Outbound replies and new messages require a configured sending route.

The service exposes an authenticated HTTP API and an MCP endpoint at `/mcp`. For clients that only support stdio, the repository includes a bridge that runs locally and forwards MCP calls to the deployed Worker. A Dockerfile is available for running that bridge in a container.

## Setup and configuration

Deployment requires a domain on Cloudflare, enabled Email Routing, and a verified destination address. The Cloudflare Deploy button can create the Worker and D1 database; manual deployment uses Wrangler, migrations, and `npm run deploy`. After deployment, configure the catch-all Email Routing rule to send mail to the Worker.

Set `DOMAIN`, `DESTINATION`, and `ADMIN_TOKEN` as secrets. `RESEND_API_KEY` is optional. Resend, Brevo, or Cloudflare Email Sending can provide outbound delivery; without one of these routes, receiving, forwarding, alias management, and code extraction work, but replies and new outbound messages do not.

The main settings are `AUTO_CREATE`, `FORWARD_MODE`, `BLOCK_TRACKERS`, `CODE_IN_SUBJECT`, and `BANNER`. HTTP API and MCP requests use `Authorization: Bearer <ADMIN_TOKEN>`. The stdio bridge uses `ALIASFLARE_URL` and `ALIASFLARE_TOKEN` in its local client configuration.

## Tools and capabilities

The MCP endpoint provides these tools:

- `create_alias` creates an alias, with an optional note.
- `get_latest_code` retrieves a recent verification code.
- `list_aliases` lists configured aliases.
- `set_alias_enabled` enables or disables an alias.
- `recent_messages` reads recent message metadata.
- `send_from_alias` sends a message using an alias.

The REST API covers configuration, alias creation and updates, message queries, code lookup, and sending. The web dashboard provides administrative access after authentication with `ADMIN_TOKEN`.

## Limitations and notes

Cloudflare Email Routing limits messages to 25 MiB. The free Workers plan allows 100,000 requests per day and 10 ms of CPU time per invocation; large messages with many attachments may exceed the CPU limit and fall back to plain forwarding. Cloudflare Email Sending is beta.

Outbound deliverability depends on the reputation of the sending domain and provider. New domains or free subdomains may be placed in spam or rejected. The catch-all rule must remain enabled for aliases to receive mail, and a verified destination is required for forwarding. Keep the admin token private; it protects the dashboard, API, and MCP endpoint.

_Full upstream README: https://allmcps.com/mcp/aliasflare/readme_

