Metadata-Version: 2.4
Name: aistudio-emailmcp
Version: 0.1.0
Summary: Unified Email MCP server - read/send mail via a self-hosted Mox server, Gmail (keychain app passwords), or local Thunderbird
License: MIT
License-File: LICENSE
Keywords: ai-studio,email,gmail,mcp,mox,thunderbird
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Communications :: Email
Requires-Python: >=3.10
Requires-Dist: mcp>=1.0.0
Description-Content-Type: text/markdown

# aistudio-emailmcp

Unified Email MCP server. Read and send mail from three kinds of accounts through one MCP interface:

- **Mox** — a self-hosted [Mox](https://github.com/mjl-/mox) mail server, managed over SSH
- **Gmail** — via IMAP with an app password stored in the macOS Keychain
- **Thunderbird** — reads the local Thunderbird profile directly (no credentials needed)

Built for [AI Studio](https://github.com/meshclaw/ai-studio) but works with any MCP client.

## Install

```bash
uvx aistudio-emailmcp        # run directly
# or
pip install aistudio-emailmcp
```

## Configuration

Optional config file at `~/.config/emailmcp/config.json`:

```json
{
  "mox": {
    "server": "mail.example.com",
    "path": "/opt/mox",
    "user": "root"
  },
  "accounts": {
    "work": "me@example.com"
  }
}
```

- `mox.server` — SSH host of your Mox server. Leave unset if you don't run Mox; the mox_* tools will say so instead of failing.
- `accounts` — maps short account names to full sender addresses for `mox_send` / `email_reply`.

### Gmail

Store an [app password](https://support.google.com/accounts/answer/185833) in the keychain; accounts are then auto-discovered by `gmail_accounts`:

```bash
security add-generic-password -a 'you@gmail.com' -s 'Gmail' -w 'your-app-password'
```

### Thunderbird

Nothing to configure — the default profile under `~/Library/Thunderbird/Profiles` is found automatically (`thunderbird_accounts`).

## Tools

| Tool | Description |
| --- | --- |
| `mox_accounts` / `mox_list` / `mox_read` / `mox_search` / `mox_send` | Self-hosted Mox server over SSH |
| `gmail_accounts` / `gmail_list` / `gmail_read` / `gmail_send` | Gmail via IMAP/SMTP, keychain app password (metadata-only account listing) |
| `thunderbird_accounts` / `thunderbird_list` / `thunderbird_read` | Local Thunderbird profile |
| `email_reply` | Reply to a message (Mox) |

## MCP client config

```json
{
  "mcpServers": {
    "email": {
      "command": "uvx",
      "args": ["aistudio-emailmcp"]
    }
  }
}
```

## License

MIT
