Metadata-Version: 2.4
Name: mailferret
Version: 0.1.0
Summary: A read-only-by-default IMAP MCP server and Claude Code plugin
Keywords: imap,mcp,claude,email,read-only
Author: DocGerd
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Communications :: Email
Classifier: Typing :: Typed
Requires-Dist: click>=8.5,<9
Requires-Dist: imapclient==4.3.0
Requires-Dist: keyring>=25.7,<26
Requires-Dist: lxml>=6.1,<6.2
Requires-Dist: mcp>=2.3,<3
Requires-Dist: platformdirs>=4.14,<5
Requires-Dist: pydantic>=2.14,<3
Requires-Dist: pypdf>=7.2,<8
Requires-Dist: tomlkit>=0.15,<0.16
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/DocGerd/mailferret
Project-URL: Repository, https://github.com/DocGerd/mailferret
Project-URL: Issues, https://github.com/DocGerd/mailferret/issues
Project-URL: Changelog, https://github.com/DocGerd/mailferret/blob/main/CHANGELOG.md
Project-URL: Security, https://github.com/DocGerd/mailferret/blob/main/SECURITY.md
Project-URL: Documentation, https://github.com/DocGerd/mailferret/tree/main/docs/user
Description-Content-Type: text/markdown

<img src="https://raw.githubusercontent.com/DocGerd/mailferret/main/docs/brand/banner.svg" alt="mailferret by DocGerdSoft: read-only IMAP for MCP clients and Claude Code" width="100%">

[![mcp: stdio server](https://img.shields.io/badge/mcp-stdio%20server-B0457E?labelColor=3B4046)](https://modelcontextprotocol.io)
[![imap: read-only by default](https://img.shields.io/badge/imap-read--only%20by%20default-14161A?labelColor=3B4046)](https://github.com/DocGerd/mailferret/blob/main/SECURITY.md)
[![ci](https://img.shields.io/github/actions/workflow/status/DocGerd/mailferret/ci.yml?label=ci&labelColor=3B4046)](https://github.com/DocGerd/mailferret/actions/workflows/ci.yml)
[![python: 3.13+](https://img.shields.io/badge/python-3.13%2B-5E646B?labelColor=3B4046)](https://github.com/DocGerd/mailferret/blob/main/pyproject.toml)
[![license: MIT](https://img.shields.io/badge/license-MIT-5E646B?labelColor=3B4046)](https://github.com/DocGerd/mailferret/blob/main/LICENSE)

Read-only by default: folders open with `EXAMINE` and bodies are fetched with `BODY.PEEK`, so nothing is moved, flagged or marked read.

```console
$ uv tool install git+https://github.com/DocGerd/mailferret
$ mailferret setup
```

This puts `mailferret` on PATH, which every later command below needs, `register` in particular.
Before the first PyPI release, `register` finds no launcher without this install.
Alternatively, run the setup once with uvx, which leaves no `mailferret` on PATH:

```console
$ uvx --from git+https://github.com/DocGerd/mailferret mailferret setup
```

After the first PyPI release the install is `uv tool install mailferret` and the one-shot `uvx mailferret setup`.
pipx or a venv work too.
Requires [uv](https://docs.astral.sh/uv/) and Python 3.13 or newer.

Status: [docs/STATUS.md](https://github.com/DocGerd/mailferret/blob/main/docs/STATUS.md).

## Safety

- Read-only: no tool moves, flags, deletes or sends. Writing and SMTP exist only as disabled interfaces; the config rejects enabling them.
- Credentials live in the OS keyring or a command you configure, never in the config, logs or tool output. Store them with `mailferret auth set`, never by pasting them into a chat.
- TLS certificate verification is always on. A rejected login is never retried.
- Mail text is untrusted data, wrapped in delimiters and stripped of hidden content.

Residual risk: mailferret cannot stop a client from obeying instructions hidden in a mail.
If your assistant can read mail and also run commands or fetch URLs, an injected mail may steer it to send what it has read elsewhere.
Read mail in a context without shell or web tools, and keep other outbound tools out of it.
The plugin's `mail-reader` agent is meant for this but is not installable yet, and its runtime tool list is unverified (`T-18`).
A residual path remains: its summary returns to a parent that may have shell and web tools.
Details: [SECURITY.md](https://github.com/DocGerd/mailferret/blob/main/SECURITY.md) and `T-18` in [docs/SECURITY.md](https://github.com/DocGerd/mailferret/blob/main/docs/SECURITY.md).

## Set up

```console
$ mailferret setup
$ mailferret accounts list
```

`setup` adds an account, stores its password and tests the connection read-only.
Change or store a password later in a terminal:

```console
$ mailferret auth set <account>
```

Per-platform backends, WSL with `pass`, and exporting `DBUS_SESSION_BUS_ADDRESS` for the keyring: [docs/user/credentials.md](https://github.com/DocGerd/mailferret/blob/main/docs/user/credentials.md).

## Connect a client

- Claude Code: `mailferret register claude-code`
- Claude Desktop: `mailferret register claude-desktop`
- Any MCP client: a stdio entry with command `mailferret` and args `["serve"]`
- Claude Code plugin (adds the `mail-reader` agent and `doctor` skill): not installable until the first PyPI release
- claude.ai zip upload: unverified

All of it: [docs/user/clients.md](https://github.com/DocGerd/mailferret/blob/main/docs/user/clients.md).

## Tools

`list_accounts`, `list_folders`, `search`, `get_message`, `get_thread`, `list_attachments`, `get_attachment_text`, `list_aliases`.
Overview: [docs/user/tools.md](https://github.com/DocGerd/mailferret/blob/main/docs/user/tools.md).

## Docs

- [Getting started](https://github.com/DocGerd/mailferret/blob/main/docs/user/getting-started.md)
- [Credentials](https://github.com/DocGerd/mailferret/blob/main/docs/user/credentials.md)
- [Configuration and presets](https://github.com/DocGerd/mailferret/blob/main/docs/user/configuration.md)
- [Clients](https://github.com/DocGerd/mailferret/blob/main/docs/user/clients.md)
- [Tools](https://github.com/DocGerd/mailferret/blob/main/docs/user/tools.md)
- [Troubleshooting](https://github.com/DocGerd/mailferret/blob/main/docs/user/troubleshooting.md)

## Troubleshooting

```console
$ mailferret doctor
```

It checks config, credentials, the connection and client registrations, and changes nothing.

## Contributing and security

[CONTRIBUTING.md](https://github.com/DocGerd/mailferret/blob/main/CONTRIBUTING.md). Report vulnerabilities privately as described in [SECURITY.md](https://github.com/DocGerd/mailferret/blob/main/SECURITY.md).
