
GhostPaw Email
io.github.GhostPawJS由 GitHub 帳號 GhostPawJS 發布v0.5.10更新於 Oct 29, 2026
Email tools with a local SQLite cache and IMAP/SMTP account configuration.
概覽
本機 stdio MCP 伺服器,透過 SQLite 快取為助理提供 IMAP/SMTP 郵件工具:讀取、搜尋、撰寫與整理郵件。
- 可以做什麼
- 讀取資料夾清單、郵件佇列、會話串、內文、附件與原始 EML
- 使用本機 FTS5 搜尋或在伺服器上執行 IMAP SEARCH
- 寄送、回覆、轉寄,以及儲存、更新或寄出草稿
- 設定標記與標籤,複製、移動、封存、刪除、標為垃圾郵件,並管理資料夾
- 連線、中斷、重新連線、同步、重新整理資料夾並監看變化
- 適用情境
- 適合讓助理整理收件匣、依關鍵字尋找郵件、起草或寄出回覆並歸檔郵件;本機快取讓讀取與搜尋不必每次都連到伺服器。
- 執行需求
- 以本機程序執行:可使用發行版二進位檔,或 npm 套件 @ghostpaw/email(需要 Node 24+,使用內建 node:sqlite)。網路操作需要已設定的帳號,或環境變數 EMAIL_IMAP_HOST、EMAIL_SMTP_HOST、EMAIL_USER 與 EMAIL_PASS(或 EMAIL_ACCESS_TOKEN)。快取路徑由 GHOSTPAW_EMAIL_DB 指定,預設為 ~/.ghostpaw/email.db。探索工具與讀取快取不需要憑證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 GhostPaw Email,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[GhostPaw email: Your agent can read the inbox. Sending is a separate tool.]
@ghostpaw/email
[npm] [CI] [site] [runtime deps] [MCP Registry] [node] [license]
Agent email: IMAP and SMTP in-process, cached in SQLite, with reading and sending as separate tools.
A standalone email engine for Node.js, built on SQLite.
Email treats IMAP sync, SMTP send, local caching, threading, search, and
transport errors as one coherent model instead of a grab bag of protocol
adapters. It ships as a single prebundled blob with zero runtime dependencies,
designed for three audiences at once: human developers working directly in
code, LLM agents operating through a structured soul / tools / skills
runtime, and agent operators who want a ready-to-use email CLI binary
without writing any wiring code.
MCP server
Every client below starts the same stdio server: ghostpaw-email mcp.
For npm-based environments, use npx -y @ghostpaw/email mcp instead.
Cached messages live in ~/.ghostpaw/email.db unless the GHOSTPAW_EMAIL_DB
environment variable (absolute path) or --db <path> says otherwise.
Claude Code
or as a plugin, which also installs the skill:
Email CLI (~/.email/config.toml)
Cursor (.cursor/mcp.json), Claude Desktop (claude_desktop_config.json)
or a project .mcp.json:
Claude Desktop users can also install server.mcpb from the
latest GitHub release.
A Dockerfile is included for container hosts:
docker build -t ghostpaw-email . && docker run -i --rm -v email:/data ghostpaw-email.
The server speaks MCP 2026-07-28 (stateless, server/discover) and the
initialize-based revisions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05.
Network operations use the existing CLI account configuration (email account add) or
EMAIL_IMAP_HOST, EMAIL_SMTP_HOST, EMAIL_USER and EMAIL_PASS (or
EMAIL_ACCESS_TOKEN). Discovery and cached reads need no account or credentials.
The surface database defaults to ~/.ghostpaw/email.db; point --db at an
existing account cache to read it. Each network call opens and closes its IMAP
session. Connection commands do not retain a session between calls.
On POSIX, new accounts files and SQLite caches (including WAL/SHM sidecars) use mode 0600, and newly created storage directories use 0700. Existing permissions are preserved, except rewriting accounts.json sets it to 0600.
Use ghostpaw-email skill --short for a compact command cheat sheet, ghostpaw-email skill for the full reference, and ghostpaw-email skill --list to list guides.
Noun-verb CLI
Both email and ghostpaw-email accept this additive command tree. Existing
account, read, search, compose, organize and sync commands retain
their flags, output and exit codes. Use mail --help for the new tree and
mail <verb> --help for parameters.
These 33 paths map to the 5 aligned tools. Action verbs set the tool's action;
draft sets save_draft. Search accepts its query as a positional argument.
Other fields use kebab-case flags, such as --folder INBOX --uids 1 --uids 2
and --input @message.json for a compose payload. Arrays accept repeated
flags or JSON; objects accept JSON. Values are literal, including a leading
@. Two flags read files: --input on the mail compose verbs and --body
on compose send|reply|draft. On those, @path reads the file, @- reads
stdin and @@text passes @text; help marks them (@file, @- stdin, @@ literal @). An
empty or unreadable path exits 2. A single - reads stdin JSON;
explicit flags override stdin fields. -- ends option parsing.
Global flags for the new commands: --db <path>, --json, --quiet,
--compact, --help/-h, --version/-V/-v, --no-color.
Output is JSON when piped or when --json is set. --quiet suppresses stdout.
completions bash|zsh|fish prints shell completion setup; version prints
the version and installation variant. The existing tools [--json], describe <tool>,
call <tool> [JSON|-], flat mail_<tool> --parameter value, mcp and skill
forms remain available.
Offline examples, run against an empty cache:
Search returns 0 matches and folder reads return 0 folders in an empty cache.
GHOSTPAW_EMAIL_DB sets the default cache path, otherwise
~/.ghostpaw/email.db is used. Local search and cached reads need no
credentials. Network operations use email account add configuration or
EMAIL_IMAP_HOST, EMAIL_SMTP_HOST, EMAIL_USER and EMAIL_PASS (or
EMAIL_ACCESS_TOKEN). Each invocation closes its network session;
mail connect does not retain a session for later commands.
Tool CLI
Both email and ghostpaw-email run the same CLI. Existing account, read,
search, compose, organize and sync commands remain available. The full guide
is preserved in skills/email/references/cli.md.
Agent Skill: SKILL.md and skills/email/ ship in the package; print the skill
with ghostpaw-email skill. List guides with ghostpaw-email skill --list
and print one with ghostpaw-email skill compose-and-send.
Install
Release binary (default)
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).
These lines never edit ~/.profile or other shell startup files: export PATH applies to the current shell only. To keep it in new shells, use the ~/.profile line below.
linux-x64:
linux-arm64:
darwin-arm64:
darwin-x64:
windows-x64 (PowerShell; persistently adds its folder to the user PATH by default):
Pinned to a release:
Also adding ~/.local/bin to ~/.profile (edits ~/.profile once; skipped if it already mentions ~/.local/bin; zsh login shells read ~/.zprofile instead, so use that file name there):
To skip the persistent user PATH edit (the installer still installs and prints the folder to add):
Scripts that compare versions should use --version --short or --version --json.
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):
The same session as an animated GIF.
Other release installers:
For aqua, define a
github_release package in aqua.yaml:
email-registry.yaml:
Install scripts verify SHA256SUMS. To verify a downloaded archive's build attestation:
Set GHOSTPAW_VERIFY=attestation for attestation verification in install.sh.
Binaries are unsigned; macOS binaries carry an ad-hoc signature. For a browser
download on macOS, remove quarantine with
xattr -d com.apple.quarantine /path/to/ghostpaw-email.
Linux binaries require glibc 2.28+; use npx on Alpine.
See the binary build workflow.
Sizes for 0.5.1 (Node 26.12.1 inside each binary):
Release installation is checked on ubuntu-24.04, macos-15 and windows-2025.
npx / npm (for npm-based environments)
Requires Node 24+ (uses the built-in node:sqlite module).
The npm package is 1711 KB unpacked.
Library (for harnesses embedding it in code)
See library usage.
Quick Start
connect() opens the SQLite database, initialises the schema, upserts the
account, and authenticates the IMAP session — one call does everything.
Docs
Read the manual for usage guides and the stored email model.
- Overview: what the manual covers and where to start
- Human usage: using the library directly in code
- LLM building blocks: tools, skills and the soul prompt for agents
- Accounts: one email identity and its connection
- Folders: cached IMAP mailboxes
- Messages: header records per folder and UID
- Bodies: decoded message content
- Threads: JWZ conversation trees
- Attachments: cached MIME parts
- Sync: the log of each sync pass
Repository references:
The Model
Seven stored concepts and three derived ones:
The model means each kind of mail state has its own home:
State is derived, not toggled. Thread IDs are computed from header chains at sync time, folder roles are detected from IMAP special-use attributes, and attachment metadata is extracted from BODYSTRUCTURE — all materialised during sync, never stored as manual status fields.
Two Audiences
Human developers
Use the Mailbox class with typed read, write, and network surfaces for
direct-code access to every mail operation:
See HUMAN.md for the full human-facing guide with worked examples.
LLM agents
Use the tools, skills, and soul namespaces for a structured runtime
surface designed to minimise LLM cognitive load:
The shared facade exposes name, description, whenToUse, whenNotToUse,
inputSchema, readOnly, and sideEffects. Handlers take a context containing
read, write, and network surfaces and the existing tool input. They return
{ ok, outcome, summary, next, data }; data.entities contains the message or
mailbox references, and next contains follow-up hints. Errors map to ok: false.
Read operations may refresh the local cache, so metadata conservatively marks
all tools as writing state.
The deprecated tools.emailTools and tools.getEmailToolByName() remain
available with the original { outcome, summary, entities, nextSteps } result
and unchanged inputs. Migrate to tools.aligned to use the shared shape.
See LLM.md for the full AI-facing guide covering soul, tools, and skills.
CLI (bash)
The package ships as a standalone email binary. Accounts are stored in
~/.config/email/accounts.json and every command accepts --json for
machine-readable output.
--attach (on compose send and compose reply) takes one or more file
paths, comma-separated:
Each path must be a regular file. Symlinks are followed to their target;
directories, devices, FIFOs and sockets are rejected with exit code 1
(invalid_flag_value) before anything is sent. The MIME type comes from the
file extension (unknown extensions are sent without an explicit type).
All commands return the same { outcome, summary, entities, nextSteps }
shape as the tool layer, with consistent exit codes (0 success, 1 user error,
2 config, 3 auth, 4 network, 5 tool error).
See SKILL.md for the complete CLI reference for agent operators and Claude Code / OpenClaw users.
Tools
Five tools shaped around operator intent, not raw protocol operations:
Key Properties
- Zero runtime dependencies. Only
node:sqlite,node:tls,node:net,node:zlib,node:crypto(built into Node 24+). - Single prebundled blob. One ESM + one CJS entry in
dist/. No subpath exports, no code splitting. - Pure SQLite storage. FTS5 full-text search, six tables, and deterministic
derived reads.
Mailboxcreates and manages its ownDatabaseSyncinstance. - Full IMAP engine. Streaming tokenizer, response parser, COMPRESS=DEFLATE, IDLE (RFC 2177), CONDSTORE/QRESYNC (RFC 7162), XOAUTH2/OAUTHBEARER.
- Full SMTP client. TLS/STARTTLS/plaintext, PLAIN/LOGIN/XOAUTH2, dot stuffing, APPEND to Sent after send.
- Fetch-on-demand bodies. Initial sync pulls headers and BODYSTRUCTURE only. Message bodies and attachment bytes are fetched when actually read.
- JWZ threading. Conversation trees computed from References/In-Reply-To headers, with depth-ordered rendering and cross-folder support.
- Intention-shaped writes.
send,reply,forward,archive,trash,saveDraft,sendDraft— operations that say what happened, not generic CRUD. - Additive AI runtime.
soulfor posture,toolsfor actions,skillsfor workflow guidance — all optional, all structured. - Colocated tests. Every non-type module has a colocated
.test.tsfile. The documented behaviour is backed by executable coverage.
Package Surface
All domain and runtime types are also available at the root for TypeScript consumers:
Development
The repo is pinned to Node 24.14.0 via .nvmrc / .node-version /
.tool-versions / mise.toml / Volta. Use whichever version manager you
prefer.
Support
If this package helps your project, consider sponsoring its maintenance:
來源:README.md,提交 52010f1
工具
0版本歷史
2- v0.5.10最新Oct 29, 2026
- v0.4.1Oct 25, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分