hypermail-mcp 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,8 +9,8 @@ Microsoft account, or (soon) a personal IMAP mailbox — it just calls
9
9
  address as the `account` argument. The server routes to the right backend.
10
10
 
11
11
  **v1 status:** Outlook / Microsoft 365 (personal + work) fully supported via
12
- Microsoft Graph. IMAP and Gmail are stubbed at the provider interface so they
13
- can be plugged in without touching tool definitions.
12
+ Microsoft Graph. IMAP (any IMAP server) supported via `imapflow` + `nodemailer`.
13
+ Gmail supported via Google OAuth device-code flow.
14
14
 
15
15
  ## Why
16
16
 
@@ -70,6 +70,32 @@ reproducibly decryptable.
70
70
 
71
71
  CLI flags: `--http`, `--port`, `--host`, `--data-dir`, `--read-only`, `--help`.
72
72
 
73
+ ### Config file (`hypermail-config.json`)
74
+
75
+ Instead of (or in addition to) CLI flags and env vars, you can configure the
76
+ server with a `hypermail-config.json` file next to the server binary. The server
77
+ looks for it in the same directory as `cli.js`.
78
+
79
+ ```jsonc
80
+ {
81
+ "http": { "enabled": true, "port": 3000, "host": "0.0.0.0" },
82
+ "dataDir": "/path/to/data",
83
+ "tools": {
84
+ // allowlist: only these tools are registered
85
+ "enabled": ["list_emails", "search_emails", "read_email", "send_email"],
86
+ // blocklist: these tools are NOT registered
87
+ // "disabled": ["add_account", "remove_account"]
88
+ },
89
+ "providers": {
90
+ "outlook": { "clientId": "...", "tenantId": "..." }
91
+ }
92
+ }
93
+ ```
94
+
95
+ Per-tool filtering (`tools.enabled` / `tools.disabled`) lets operators ship
96
+ minimal agent-facing surfaces — e.g. a read-only assistant that can only list
97
+ and read emails.
98
+
73
99
  ## Tools
74
100
 
75
101
  All "email" tools take an `account` argument — the email address of the inbox
@@ -84,7 +110,7 @@ account store.
84
110
  | `get_account_settings` | `account` | Get signature (HTML) and style preferences for an account. |
85
111
  | `set_account_settings` | `account`, `signature?`, `style?` | Set signature HTML and font preferences. Disabled under `--read-only`. |
86
112
  | `remove_account` | `email` | Deletes tokens for the account. |
87
- | `list_emails` | `account`, `folder?`, `limit?`, `unreadOnly?` | Defaults: folder=`inbox`, limit=25. |
113
+ | `list_emails` | `account`, `folder?`, `limit?`, `unreadOnly?`, `skip?` | Defaults: folder=`inbox`, limit=25. Supports pagination via `skip` — response includes `hasMore`. |
88
114
  | `search_emails` | `account`, `query`, `limit?` | KQL on Outlook. |
89
115
  | `read_email` | `account`, `id`, `format?` | Returns full body + recipients + attachment metadata. `format`: `markdown` (default), `html`, or `text`. |
90
116
  | `read_attachment` | `account`, `messageId`, `attachmentId` | Download an attachment to a temporary file and return its path. |
@@ -94,6 +120,14 @@ account store.
94
120
  | `send_email` | `account`, `to[]`, `cc?`, `bcc?`, `subject`, `body`, `isHtml?`, `include_signature?`, `inReplyTo?`, `replyAll?`, `forwardMessageId?` | Send an email. Appends signature when `include_signature` is true. `inReplyTo` sends as threaded reply; `forwardMessageId` sends as forward. Disabled under `--read-only`. |
95
121
  | `draft_email` | `account`, `to[]`, `cc?`, `bcc?`, `subject`, `body`, `isHtml?`, `include_signature?`, `inReplyTo?`, `replyAll?`, `forwardMessageId?` | Save as draft instead of sending. Returns the draft message ID and HTML body (`draftHtml`). Disabled under `--read-only`. |
96
122
  | `edit_draft` | `account`, `id`, `to?`, `cc?`, `bcc?`, `subject?`, `body?`, `isHtml?`, `include_signature?` | Edit an existing draft by ID. Only provided fields are updated. Returns the updated draft ID and HTML body (`draftHtml`). Disabled under `--read-only`. |
123
+ | `send_draft` | `account`, `id` | Send an existing draft email by ID. Use with draft IDs returned by `draft_email` or `edit_draft`. Disabled under `--read-only`. |
124
+ | `add_attachment_to_draft` | `account`, `id`, `path` | Attach a local file to an existing draft email. Disabled under `--read-only`. |
125
+ | `list_folders` | `account`, `parentFolderId?` | List available mail folders. Returns top-level folders by default, or children of `parentFolderId`. |
126
+ | `create_folder` | `account`, `displayName`, `parentFolderId?` | Create a new mail folder under root (default) or the given parent. Disabled under `--read-only`. |
127
+ | `delete_folder` | `account`, `folderId` | Delete a mail folder by ID. Disabled under `--read-only`. |
128
+ | `rename_folder` | `account`, `folderId`, `newName` | Rename an existing mail folder. Disabled under `--read-only`. |
129
+ | `mark_read` | `account`, `id` | Mark a message as read. Disabled under `--read-only`. |
130
+ | `mark_unread` | `account`, `id` | Mark a message as unread. Disabled under `--read-only`. |
97
131
 
98
132
  ### Add-account flow (Outlook)
99
133
 
@@ -118,11 +152,9 @@ account store.
118
152
 
119
153
  ## Roadmap
120
154
 
121
- - IMAP provider (interface already in place at `src/providers/imap/index.ts`)
122
- — `imapflow` + `nodemailer`, password/app-password stored encrypted.
123
- - Gmail provider via Google OAuth.
124
- - Folder listing, attachment upload/download, mark-as-read.
125
155
  - Threading / conversations.
156
+ - Calendar integration.
157
+ - Webhook / push notifications for new mail.
126
158
 
127
159
  ## Project layout
128
160
 
@@ -139,7 +171,12 @@ src/
139
171
  auth.ts # msal-node device-code flow
140
172
  client.ts # @microsoft/microsoft-graph-client factory
141
173
  index.ts # OutlookProvider implementation
142
- imap/index.ts # stub
174
+ imap/index.ts # IMAP provider (imapflow + nodemailer)
175
+ gmail/
176
+ auth.ts # Google OAuth device-code flow
177
+ client.ts # Gmail API (googleapis)
178
+ index.ts # GmailProvider implementation
179
+ shared/ # Shared utilities across providers
143
180
  tools/index.ts # MCP tool registrations
144
181
  ```
145
182