# @postfleet/mcp

Local [MCP](https://modelcontextprotocol.io) server for [Postfleet](https://postfleet.ai) — give an AI agent its own email address, then send, receive, and read mail. Runs on your machine over stdio and talks to the Postfleet API with your key.

Prefer a hosted server (no install)? Point your client at `https://api.postfleet.ai/api/mcp` with an `Authorization: Bearer <key>` header instead. The Cursor plugin manifest declares `headers.Authorization = Bearer ${POSTFLEET_API_KEY}`.

## Setup

You need a Postfleet API key (`pf_...`) from https://postfleet.ai. No install step — `npx` fetches the latest on demand.

### Claude Desktop / Cursor / any MCP client

```json
{
  "mcpServers": {
    "postfleet": {
      "command": "npx",
      "args": ["-y", "@postfleet/mcp"],
      "env": { "POSTFLEET_API_KEY": "pf_your_key_here" }
    }
  }
}
```

Hosted (streamable HTTP):

```json
{
  "mcpServers": {
    "postfleet": {
      "url": "https://api.postfleet.ai/api/mcp",
      "headers": { "Authorization": "Bearer pf_your_key_here" }
    }
  }
}
```

### Claude Code

```bash
claude mcp add postfleet --env POSTFLEET_API_KEY=pf_your_key_here -- npx -y @postfleet/mcp
```

## Environment

| Variable | Required | Default | Purpose |
|----------|----------|---------|---------|
| `POSTFLEET_API_KEY` | yes | — | Your `pf_` API key. |
| `POSTFLEET_API_URL` | no | `https://api.postfleet.ai` | API origin. Override for staging/self-hosted. |

## Tools

16 tools: `list_mailboxes`, `create_mailbox`, `list_domains`, `create_domain`, `verify_domain`, `send_email`, `reply_email`, `list_inbox`, `read_email`, `wait_for_email`, `create_draft`, `list_drafts`, `get_draft`, `update_draft`, `send_draft`, `delete_draft`.

## Support

Questions or bug reports? Reach us at [postfleet.ai](https://postfleet.ai).
