@ghostpaw/email 0.5.4 → 0.5.6
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 +81 -22
- package/SKILL.md +81 -11
- package/dist/cli.js +1194 -620
- package/dist/index.cjs +213 -12
- package/dist/index.js +213 -12
- package/dist/mcp-server.js +189 -17
- package/dist/mcp.cjs +214 -54
- package/dist/mcp.js +214 -54
- package/package.json +1 -1
- package/skills/email/SKILL.md +81 -11
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
**Agent email: IMAP and SMTP in-process, cached in SQLite, with reading and sending as separate tools.**
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
A standalone email engine for Node.js, built on SQLite.
|
|
@@ -22,14 +22,15 @@ without writing any wiring code.
|
|
|
22
22
|
|
|
23
23
|
## MCP server
|
|
24
24
|
|
|
25
|
-
Every client below starts the same stdio server: `
|
|
25
|
+
Every client below starts the same stdio server: `ghostpaw-email mcp`.
|
|
26
|
+
For npm-based environments, use `npx -y @ghostpaw/email mcp` instead.
|
|
26
27
|
Cached messages live in `~/.ghostpaw/email.db` unless the `GHOSTPAW_EMAIL_DB`
|
|
27
28
|
environment variable (absolute path) or `--db <path>` says otherwise.
|
|
28
29
|
|
|
29
30
|
**Claude Code**
|
|
30
31
|
|
|
31
32
|
```bash
|
|
32
|
-
claude mcp add ghostpaw-email --
|
|
33
|
+
claude mcp add ghostpaw-email -- ghostpaw-email mcp
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
or as a plugin, which also installs the skill:
|
|
@@ -43,8 +44,8 @@ or as a plugin, which also installs the skill:
|
|
|
43
44
|
|
|
44
45
|
```toml
|
|
45
46
|
[mcp_servers.ghostpaw-email]
|
|
46
|
-
command = "
|
|
47
|
-
args = ["
|
|
47
|
+
command = "ghostpaw-email"
|
|
48
|
+
args = ["mcp"]
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
**Cursor** (`.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`)
|
|
@@ -54,8 +55,8 @@ or a project `.mcp.json`:
|
|
|
54
55
|
{
|
|
55
56
|
"mcpServers": {
|
|
56
57
|
"ghostpaw-email": {
|
|
57
|
-
"command": "
|
|
58
|
-
"args": ["
|
|
58
|
+
"command": "ghostpaw-email",
|
|
59
|
+
"args": ["mcp"]
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -104,7 +105,7 @@ Global flags for the new commands: `--db <path>`, `--json`, `--quiet`,
|
|
|
104
105
|
`--compact`, `--help`/`-h`, `--version`/`-V`/`-v`, `--no-color`.
|
|
105
106
|
Output is JSON when piped or when `--json` is set. `--quiet` suppresses stdout.
|
|
106
107
|
`completions bash|zsh|fish` prints shell completion setup; `version` prints
|
|
107
|
-
the
|
|
108
|
+
the version and installation variant. The existing `tools [--json]`, `describe <tool>`,
|
|
108
109
|
`call <tool> [JSON|-]`, flat `mail_<tool> --parameter value`, `mcp` and `skill`
|
|
109
110
|
forms remain available.
|
|
110
111
|
|
|
@@ -136,9 +137,9 @@ credentials. Network operations use `email account add` configuration or
|
|
|
136
137
|
## Tool CLI
|
|
137
138
|
|
|
138
139
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
ghostpaw-email tools
|
|
141
|
+
ghostpaw-email call mail_read '{"view":"folders"}' --db :memory:
|
|
142
|
+
ghostpaw-email call mail_search '{"query":"invoice"}'
|
|
142
143
|
```
|
|
143
144
|
|
|
144
145
|
Both `email` and `ghostpaw-email` run the same CLI. Existing account, read,
|
|
@@ -146,29 +147,66 @@ search, compose, organize and sync commands remain available. The full guide
|
|
|
146
147
|
is preserved in [skills/email/references/cli.md](skills/email/references/cli.md).
|
|
147
148
|
|
|
148
149
|
Agent Skill: `SKILL.md` and `skills/email/` ship in the package; print the skill
|
|
149
|
-
with `
|
|
150
|
+
with `ghostpaw-email skill`. List guides with `ghostpaw-email skill --list`
|
|
151
|
+
and print one with `ghostpaw-email skill compose-and-send`.
|
|
150
152
|
|
|
151
153
|
## Install
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
### Release binary (default)
|
|
156
|
+
|
|
157
|
+
Each line downloads the latest release asset, checks it against the release's SHA256SUMS and installs it on the PATH (~/.local/bin on Linux/macOS; the Windows script adds its folder to the user PATH).
|
|
158
|
+
|
|
159
|
+
These lines never edit ~/.profile or other shell startup files: `export PATH` applies to the current shell only. To keep it, add `export PATH="$HOME/.local/bin:$PATH"` to your shell profile yourself.
|
|
160
|
+
|
|
161
|
+
linux-x64:
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-x64 && export PATH="$HOME/.local/bin:$PATH"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
linux-arm64:
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-arm64 && export PATH="$HOME/.local/bin:$PATH"
|
|
157
171
|
```
|
|
158
172
|
|
|
159
|
-
|
|
173
|
+
darwin-arm64:
|
|
160
174
|
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
```sh
|
|
176
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target darwin-arm64 && export PATH="$HOME/.local/bin:$PATH"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
darwin-x64:
|
|
163
180
|
|
|
164
181
|
```sh
|
|
165
|
-
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
|
|
182
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target darwin-x64 && export PATH="$HOME/.local/bin:$PATH"
|
|
166
183
|
```
|
|
167
184
|
|
|
185
|
+
windows-x64 (PowerShell; persistently adds its folder to the user PATH by default):
|
|
186
|
+
|
|
168
187
|
```powershell
|
|
169
188
|
irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
|
|
170
189
|
```
|
|
171
190
|
|
|
191
|
+
Pinned to a release:
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-x64 --version 0.5.6 && export PATH="$HOME/.local/bin:$PATH"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
To skip the persistent user PATH edit (the installer still installs and prints the folder to add):
|
|
198
|
+
|
|
199
|
+
```powershell
|
|
200
|
+
$env:GHOSTPAW_NO_MODIFY_PATH=1; irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```text
|
|
204
|
+
$ ghostpaw-email --version
|
|
205
|
+
email 0.5.6 (binary, linux-x64)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Scripts that compare versions should use `--version --short` or `--version --json`.
|
|
209
|
+
|
|
172
210
|
A session with the 0.5.1 linux-x64 binary against a local GreenMail test server on 127.0.0.1 (throwaway user, no real account) and a fresh database (output piped through `jq` to keep it short):
|
|
173
211
|
|
|
174
212
|

|
|
@@ -238,10 +276,31 @@ Sizes for 0.5.1 (Node 26.12.1 inside each binary):
|
|
|
238
276
|
| darwin-x64 | 46.4 MB tar.gz | 149.8 MB |
|
|
239
277
|
| windows-x64 | 38.5 MB zip | 105.8 MB |
|
|
240
278
|
|
|
241
|
-
The npm package is 1711 KB unpacked and needs Node 24+.
|
|
242
|
-
|
|
243
279
|
Release installation is checked on ubuntu-24.04, macos-15 and windows-2025.
|
|
244
280
|
|
|
281
|
+
### npx / npm (for npm-based environments)
|
|
282
|
+
|
|
283
|
+
Requires **Node 24+** (uses the built-in `node:sqlite` module).
|
|
284
|
+
The npm package is 1711 KB unpacked.
|
|
285
|
+
|
|
286
|
+
```sh
|
|
287
|
+
npm install @ghostpaw/email # as a library
|
|
288
|
+
npm install -g @ghostpaw/email # as a global CLI
|
|
289
|
+
npx @ghostpaw/email --help # one-off, no install needed
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Library (for harnesses embedding it in code)
|
|
293
|
+
|
|
294
|
+
```sh
|
|
295
|
+
npm install @ghostpaw/email
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
import { Mailbox } from '@ghostpaw/email';
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
See [library usage](#quick-start).
|
|
303
|
+
|
|
245
304
|
## Quick Start
|
|
246
305
|
|
|
247
306
|
```ts
|
package/SKILL.md
CHANGED
|
@@ -2,18 +2,34 @@
|
|
|
2
2
|
name: email
|
|
3
3
|
description: "Read, search, compose, organize and synchronize email with a local SQLite cache. Use when managing email or searching cached messages."
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "
|
|
5
|
+
compatibility: "Release binary ghostpaw-email (no runtime needed); MCP stdio via ghostpaw-email mcp."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# email
|
|
9
9
|
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Linux/macOS (checks SHA256SUMS and installs ~/.local/bin/ghostpaw-email):
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Windows x64:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Run tools as `ghostpaw-email ...`; use `~/.local/bin/ghostpaw-email` if it is not on PATH.
|
|
25
|
+
|
|
10
26
|
Read and search cached email offline. Configure live accounts with email account add before network operations. Inspect messages before replying or changing folders. Confirm recipients and content before sending; trash and folder deletion can remove mail. Credentials use the existing email CLI account configuration or EMAIL_* environment variables.
|
|
11
27
|
|
|
12
28
|
## Calling tools
|
|
13
29
|
|
|
14
30
|
MCP: connect to ghostpaw-email, then call a tool by name with its JSON arguments.
|
|
15
31
|
|
|
16
|
-
CLI: `ghostpaw-email call <tool> '<JSON object>'` or `ghostpaw-email <tool> --parameter value
|
|
32
|
+
CLI: `ghostpaw-email call <tool> '<JSON object>'` or `ghostpaw-email <tool> --parameter value`.
|
|
17
33
|
|
|
18
34
|
Inspect schemas with `ghostpaw-email describe <tool>`. Use `--db <path>` to select a database.
|
|
19
35
|
|
|
@@ -27,6 +43,8 @@ Not for: Use mail_search to find messages by query or mail_organize to change th
|
|
|
27
43
|
|
|
28
44
|
Writes: writes_state.
|
|
29
45
|
|
|
46
|
+
Nested requirements apply within the parent for the selected action.
|
|
47
|
+
|
|
30
48
|
| Parameter | Type | Required | Values / description |
|
|
31
49
|
| --- | --- | --- | --- |
|
|
32
50
|
| view | string | yes | folders, queue, thread, message, attachment, eml. What to read. |
|
|
@@ -38,6 +56,12 @@ Writes: writes_state.
|
|
|
38
56
|
| unreadOnly | boolean | no | Filter to unread messages only (queue view). |
|
|
39
57
|
| refresh | boolean | no | Fetch live folder list from server before returning (folders/queue view). |
|
|
40
58
|
|
|
59
|
+
Examples:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
ghostpaw-email call mail_read '{"view":"folders"}'
|
|
63
|
+
```
|
|
64
|
+
|
|
41
65
|
## mail_search
|
|
42
66
|
|
|
43
67
|
Search for messages locally via FTS or remotely via IMAP SEARCH. Returns matching message references.
|
|
@@ -48,6 +72,8 @@ Not for: Use mail_read when the folder and message UID are already known.
|
|
|
48
72
|
|
|
49
73
|
Writes: writes_state.
|
|
50
74
|
|
|
75
|
+
Nested requirements apply within the parent for the selected action.
|
|
76
|
+
|
|
51
77
|
| Parameter | Type | Required | Values / description |
|
|
52
78
|
| --- | --- | --- | --- |
|
|
53
79
|
| query | string | yes | Free-text search query or FTS5 expression. |
|
|
@@ -59,6 +85,12 @@ Writes: writes_state.
|
|
|
59
85
|
| unreadOnly | boolean | no | Filter to unread messages. |
|
|
60
86
|
| limit | integer | no | Maximum number of results. |
|
|
61
87
|
|
|
88
|
+
Examples:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
ghostpaw-email call mail_search '{"query":"invoice"}'
|
|
92
|
+
```
|
|
93
|
+
|
|
62
94
|
## mail_compose
|
|
63
95
|
|
|
64
96
|
Compose and send email: send new message, reply, forward, save/update/send a draft.
|
|
@@ -69,12 +101,24 @@ Not for: Use mail_read to inspect an existing message without sending or saving
|
|
|
69
101
|
|
|
70
102
|
Writes: writes_state.
|
|
71
103
|
|
|
104
|
+
Nested requirements apply within the parent for the selected action.
|
|
105
|
+
|
|
72
106
|
| Parameter | Type | Required | Values / description |
|
|
73
107
|
| --- | --- | --- | --- |
|
|
74
108
|
| action | string | yes | send, reply, forward, save_draft, update_draft, send_draft. |
|
|
75
109
|
| folder | string | no | Source folder (required for reply/forward). |
|
|
76
110
|
| uid | integer | no | Source message UID (required for reply/forward/update_draft/send_draft). |
|
|
77
111
|
| input | object | no | ComposeInput / ReplyInput / ForwardInput payload. |
|
|
112
|
+
| input.to | array | yes | Recipient addresses. |
|
|
113
|
+
| input.subject | string | yes | Message subject. |
|
|
114
|
+
|
|
115
|
+
Examples:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
ghostpaw-email call mail_compose '{"action":"send","input":{"to":[{"address":"reader@example.com"}],"subject":"Hello"}}'
|
|
119
|
+
ghostpaw-email call mail_compose '{"action":"reply","input":{},"folder":"INBOX","uid":1}'
|
|
120
|
+
ghostpaw-email call mail_compose '{"action":"forward","input":{"to":[{"address":"reader@example.com"}]},"folder":"INBOX","uid":1}'
|
|
121
|
+
```
|
|
78
122
|
|
|
79
123
|
## mail_organize
|
|
80
124
|
|
|
@@ -86,6 +130,8 @@ Not for: Use mail_read or mail_search when only inspection is requested.
|
|
|
86
130
|
|
|
87
131
|
Writes: writes_state.
|
|
88
132
|
|
|
133
|
+
Nested requirements apply within the parent for the selected action.
|
|
134
|
+
|
|
89
135
|
| Parameter | Type | Required | Values / description |
|
|
90
136
|
| --- | --- | --- | --- |
|
|
91
137
|
| action | string | yes | mark_read, mark_unread, star, unstar, mark_answered, copy, move, archive, trash, junk, not_junk, set_labels, add_labels, remove_labels, create_folder, rename_folder, delete_folder, subscribe_folder, unsubscribe_folder. |
|
|
@@ -97,6 +143,14 @@ Writes: writes_state.
|
|
|
97
143
|
| oldPath | string | no | Old folder path (required for rename_folder). |
|
|
98
144
|
| newPath | string | no | New folder path (required for rename_folder). |
|
|
99
145
|
|
|
146
|
+
Examples:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
ghostpaw-email call mail_organize '{"action":"mark_read","folder":"INBOX","uids":[1]}'
|
|
150
|
+
ghostpaw-email call mail_organize '{"action":"mark_unread","folder":"INBOX","uids":[1]}'
|
|
151
|
+
ghostpaw-email call mail_organize '{"action":"star","folder":"INBOX","uids":[1]}'
|
|
152
|
+
```
|
|
153
|
+
|
|
100
154
|
## mail_sync
|
|
101
155
|
|
|
102
156
|
Manage the IMAP connection lifecycle and sync local state: connect, disconnect, reconnect, sync folders, or refresh the folder list.
|
|
@@ -107,25 +161,41 @@ Not for: Use mail_read for cached content or the network watch stream for contin
|
|
|
107
161
|
|
|
108
162
|
Writes: writes_state.
|
|
109
163
|
|
|
164
|
+
Nested requirements apply within the parent for the selected action.
|
|
165
|
+
|
|
110
166
|
| Parameter | Type | Required | Values / description |
|
|
111
167
|
| --- | --- | --- | --- |
|
|
112
168
|
| action | string | yes | connect, disconnect, reconnect, sync, refresh_folders, watch. |
|
|
113
169
|
| folders | array | no | Folders to sync or watch (optional — defaults to all subscribed folders). |
|
|
114
170
|
| bodies | string | no | none, missing, all. Body fetch strategy for sync (default: missing). |
|
|
115
171
|
|
|
172
|
+
Examples:
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
ghostpaw-email call mail_sync '{"action":"connect"}'
|
|
176
|
+
ghostpaw-email call mail_sync '{"action":"disconnect"}'
|
|
177
|
+
ghostpaw-email call mail_sync '{"action":"reconnect"}'
|
|
178
|
+
```
|
|
179
|
+
|
|
116
180
|
## Workflow guides
|
|
117
181
|
|
|
118
|
-
- [triage-inbox](skills/email/references/triage-inbox.md): Process a full inbox from scratch: sync to get latest state, read message queue, selectively fetch bodies for decisions, then bulk-organize by priority.
|
|
119
|
-
- [read-and-reply](skills/email/references/read-and-reply.md): Read a message with full thread context, then compose and send a properly-threaded reply with quoted attribution.
|
|
120
|
-
- [connect-and-sync](skills/email/references/connect-and-sync.md): Establish or restore an IMAP connection, refresh the folder list, and pull new messages — handling first-run vs incremental scenarios.
|
|
121
|
-
- [search-and-act](skills/email/references/search-and-act.md): Find messages matching criteria (local FTS first, remote IMAP SEARCH as fallback), verify targets, then act — organize, reply, or present.
|
|
122
|
-
- [compose-and-send](skills/email/references/compose-and-send.md): Full draft lifecycle — save, review, update, then send — plus direct send, reply, and forward with proper threading and forwarded-header blocks.
|
|
123
|
-
- [organize-bulk](skills/email/references/organize-bulk.md): Bulk organize messages across folders — flagging, moving, archiving, labelling — and manage the folder hierarchy as part of the flow.
|
|
124
|
-
- [attachment-workflow](skills/email/references/attachment-workflow.md): Discover, inspect, and fetch email attachments on demand; embed attachments in outbound messages; and export or import full .eml files.
|
|
125
|
-
- [recover-from-disruption](skills/email/references/recover-from-disruption.md): Detect and recover from connection loss or IMAP/SMTP failures — reconnect with back-off, re-sync to reconcile state, and handle auth vs transient errors distinctly.
|
|
126
|
-
- [cli](skills/email/references/cli.md): Complete existing email CLI guide.
|
|
182
|
+
- `ghostpaw-email skill triage-inbox` ([triage-inbox](skills/email/references/triage-inbox.md)): Process a full inbox from scratch: sync to get latest state, read message queue, selectively fetch bodies for decisions, then bulk-organize by priority.
|
|
183
|
+
- `ghostpaw-email skill read-and-reply` ([read-and-reply](skills/email/references/read-and-reply.md)): Read a message with full thread context, then compose and send a properly-threaded reply with quoted attribution.
|
|
184
|
+
- `ghostpaw-email skill connect-and-sync` ([connect-and-sync](skills/email/references/connect-and-sync.md)): Establish or restore an IMAP connection, refresh the folder list, and pull new messages — handling first-run vs incremental scenarios.
|
|
185
|
+
- `ghostpaw-email skill search-and-act` ([search-and-act](skills/email/references/search-and-act.md)): Find messages matching criteria (local FTS first, remote IMAP SEARCH as fallback), verify targets, then act — organize, reply, or present.
|
|
186
|
+
- `ghostpaw-email skill compose-and-send` ([compose-and-send](skills/email/references/compose-and-send.md)): Full draft lifecycle — save, review, update, then send — plus direct send, reply, and forward with proper threading and forwarded-header blocks.
|
|
187
|
+
- `ghostpaw-email skill organize-bulk` ([organize-bulk](skills/email/references/organize-bulk.md)): Bulk organize messages across folders — flagging, moving, archiving, labelling — and manage the folder hierarchy as part of the flow.
|
|
188
|
+
- `ghostpaw-email skill attachment-workflow` ([attachment-workflow](skills/email/references/attachment-workflow.md)): Discover, inspect, and fetch email attachments on demand; embed attachments in outbound messages; and export or import full .eml files.
|
|
189
|
+
- `ghostpaw-email skill recover-from-disruption` ([recover-from-disruption](skills/email/references/recover-from-disruption.md)): Detect and recover from connection loss or IMAP/SMTP failures — reconnect with back-off, re-sync to reconcile state, and handle auth vs transient errors distinctly.
|
|
190
|
+
- `ghostpaw-email skill cli` ([cli](skills/email/references/cli.md)): Complete existing email CLI guide.
|
|
127
191
|
|
|
128
192
|
## Principles
|
|
129
193
|
|
|
130
194
|
- Inspect before changing messages.
|
|
131
195
|
- Confirm recipients and content before sending.
|
|
196
|
+
|
|
197
|
+
## Without the binary
|
|
198
|
+
|
|
199
|
+
For npm-based environments (Node 24+): `npx -y @ghostpaw/email ...`.
|
|
200
|
+
|
|
201
|
+
Harnesses that embed it in code can import `@ghostpaw/email` as a library.
|