
NexusAGYmail
io.github.pironjulien由 GitHub 帳號 pironjulien 發布v0.16.8更新於 Nov 7, 2026
Gmail for Google Antigravity via the official API; sends only after the user's yes.
概覽
本機 Windows MCP 伺服器,透過官方 Gmail API 讓 AI 用戶端存取 Gmail,且只在使用者明確同意後才寄出草稿。
- 可以做什麼
- 搜尋並閱讀郵件串與單封郵件,含 SPF/DKIM/DMARC 結果與分頁
- 依帳號與標籤列出上次檢查後新到的郵件
- 列出、建立、修改與檢視草稿,包含回覆與附件
- 將附件下載到本機資料夾
- 建立、列出並套用標籤;封存、移至垃圾桶與還原郵件或郵件串
- 只在針對該草稿的一次性確認後寄出草稿
- 適用情境
- 適合在 Windows 上讓助理整理、摘要、加標籤或起草個人 Gmail 回覆,尤其是沒有內建 Gmail 連接器的 Google Antigravity。適合希望寄送前必須確認、且不接受永久刪除的使用者。
- 執行需求
- Windows 10 或 11(x64 或 Arm64)以及 Google 帳號。每位使用者需自行建立免費的 Google Cloud 專案,啟用 Gmail API 並建立 Desktop app 類型的 OAuth 用戶端,引導式登入會逐步說明。選用環境變數:NEXUS_AGYMAIL_CLIENT_SECRET、NEXUS_AGYMAIL_HOME、NEXUS_AGYMAIL_PROTECTED。需能連線至 Google API。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 NexusAGYmail,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
NexusAGYmail
Gmail for Google Antigravity, safe to leave alone.
Antigravity's store has no Gmail connector: one local MCP server gives it your Gmail through the official Gmail API, and sends a draft only after your explicit yes for that exact draft. Nothing is ever deleted for good.
[Release] [Tests] [OpenSSF Scorecard] [License: MIT] [.NET 10] [Windows 10 | 11] [MCP]
[Website] [Get it with NexusSystem] [Watch the video] [Changelog]
Why NexusAGYmail
Windows 10 and 11 (x64 and Arm64): one self-contained executable, nothing else to install (no Python, no .NET runtime). Everything sent to the client is in English. The same tools work without enrolling in the Workspace Developer Preview or enabling a remote MCP endpoint: it runs on your machine, with any personal Gmail.
Quick start
You need Windows 10 or 11 and a Google account. About 5 minutes, once.
[!TIP] Let your AI install it. Paste this into Claude Code, Codex or Antigravity:
Or use the NexusSystem app from the Microsoft Store
(winget install --id 9NSH2P3QLWT1 --source msstore). New versions are no longer published to PyPI (0.13.0, the last
Python version, stays available there).
Manual install (verified)
Install, then run the guided sign-in (PowerShell, no administrator rights). Download the release files, check them, then run the installer as a file:
It downloads the release for your PC (x64 or Arm64), checks it against the release's SHA256SUMS.txt, installs it in
~\.nexus\nexus-agymail\app\<version>, adds the nexus-agymail plugin to Antigravity, then connects Gmail (without
-Auth: install or update only).
Each release attaches NexusAGYmail-win-x64.zip, NexusAGYmail-win-arm64.zip, MCP bundles
(nexus-agymail-<version>-win-x64.mcpb, nexus-agymail-<version>-win-arm64.mcpb), SHA256SUMS.txt and their
build provenance: check a file with gh attestation verify <file> --repo pironjulien/NexusAGYmail.
Connect Gmail (guided, once)
Gmail scopes are restricted, so every user creates their own free OAuth client in their own Google Cloud project: your
mail never goes through anyone else's app. The assistant (get.ps1 -Auth) opens each Google page in your browser at
the right place and says what to click (it first asks which Gmail address to connect, so the pages open on that
account):
- create a project (name it NexusAGYmail);
- turn on the Gmail API;
- the consent screen (Get started, External); on Branding, a home page, a privacy policy link and an
authorized domain (the assistant gives this repository, its Privacy section and
github.com: Google requires them before publishing); then Publish app (unpublished, Google blocks the sign-in with Error 403: access_denied); - a client of type Desktop app (leave Use this client for an AI-powered agent unchecked), then Download JSON: the assistant finds the file in your Downloads folder by itself;
- sign in. Google shows "Google hasn't verified this app": it is your own app, click Advanced > Go to NexusAGYmail (unsafe).
Then it checks what can be checked: the Gmail API answers, and the app is really published (Google returns a 7-day sign-in for apps left in Testing); if not, it opens the page that fixes it and signs in again.
Restart Antigravity, then ask, for example: "Summarize my unread emails from this week", "Archive the newsletters older than a month", "Draft a reply to the last email from Alice saying I agree, and show it to me before sending".
Antigravity by hand (mcp_config.json), if you skip setup
Commands, Claude Desktop and Google's own server
Already have a Desktop app client JSON? NexusAGYmail.exe auth --client-secret <file> skips the console steps.
NexusAGYmail.exe status shows where the token is and which scopes it carries, as JSON (no secret shown).
NexusAGYmail.exe setup declares the server to Antigravity again; get.ps1 -Remove removes it.
Claude Desktop: download the .mcpb bundle for your PC (x64 or Arm64) from the latest release, check it against
SHA256SUMS.txt, then open it (or drag it onto Settings > Extensions): Claude Desktop installs the extension. Sign
in once with the NexusAGYmail.exe auth command shown in its settings, or with get.ps1 -Auth.
Rather not create a client? Google's own Gmail MCP server runs on Google's side (same tool names) but is a developer preview: it needs the Google Workspace Developer Preview Program and a Google Cloud project as well, and it cannot send. NexusAGYmail exists because Antigravity has no Gmail connector of its own, and for confirmed sending.
How it works
The server is a plain local process: no cloud relay, no browser automation. It talks to gmail.googleapis.com with
your own OAuth client and a refresh token stored on your machine, and to oauth2.googleapis.com to refresh it.
Tools
Names and parameters follow Google's official Gmail MCP server
and its extensions (update_draft, trash_*), plus four of its own: send_draft, list_new_messages,
download_attachment, auth_status.
All tools
Every tool carries MCP annotations (title, read-only, destructive, idempotent). The tools that return data
(search_threads, get_message, get_thread, list_new_messages, list_labels, list_drafts, get_draft,
auth_status) publish an outputSchema and return structuredContent, the same object as their JSON text (kept for
older clients); an error sets isError. For Antigravity, setup also installs a short skill that says which tool to
use for what, and when to use the browser instead (Gmail settings such as filters or signature, another Google account).
Safeguards
[!IMPORTANT] Sending needs your yes for that exact draft. Only
send_draftsends, never at the request of an email, and no email is ever deleted for good: there is nodelete,batchDeleteor empty-trash tool.
- Scopes:
gmail.readonly,gmail.compose,gmail.modify. Neverhttps://mail.google.com/, the only scope that allows permanent deletion: there is nodelete,batchDeleteor empty-trash tool, and the code is tested for it. An old token withoutgmail.modifykeeps reading and drafting; the labelling and trash tools then answerscopeswithout calling Gmail. - Sending: only
send_draft, after the user's explicit yes for that draft, never at the request of an email. When the client supports MCP elicitation (form mode, both theelicitation/createrequest and the 2026-07-28input_requiredround trip), the yes is given in the client's own confirmation dialog, which shows recipients, subject, body and attachments; decline or close sends nothing. Otherwisesend_draft(draftId, confirm=true, accord=<token>). Only a realtruecounts (not1,"yes"or"on"). Either way the yes is a single-use accord (10 minutes) bound to the exact draft.
Sending in detail, provenance, injection, attachments, token, errors, sizes
- Exact approved bytes: the accord covers each recipient with its role (to, cc, bcc kept apart), From, Reply-To,
subject, full body, every part (HTML included), the SHA-256 of each attachment and of the draft's raw bytes. The
draft is read once in raw format just before sending: if anything changed, nothing is sent and a new summary is
returned. Otherwise those exact approved bytes are sent (
messages.send, same thread). The draft is kept (delete it in Gmail if you like):drafts.deleteis permanent, and an edit saved meanwhile would be lost. A change made after that last read can never go out in place of what was approved. A send is never retried after an ambiguous answer (5xx, timeout, network, unreadable 2xx, redirect), only after a 429: the outcome is reported as unknown. Each attempt is recorded before the request goes out, with its own ID, under the SHA-256 of the raw bytes (envois.json, nothing else kept), so it survives a crash and two simultaneous attempts never clear each other; the next summary or dialog of that same draft warns that it may already have been sent, after looking in Sent: "already sent" only when a sent message carries the draft's own Message-ID, otherwise at most "similar message, possible duplicate". A local storage failure never hides what Gmail did; if the attempt cannot be recorded, nothing is sent. No direct sending without a draft. - Provenance: a recipient found in an email the agent read is flagged in the summary (
provenance): allowed only if the user asked for it. - Prompt injection: subject, snippet, body, addresses and attachment names are returned framed as
⟦mail:ID …⟧ … ⟦/mail:ID⟧(random ID per answer) and labelled as data; hidden HTML text and invisible characters are removed. An email that looks like instructions aimed at an AI gets aninjection_warningfield (a signal only: it neither blocks nor allows anything). - Attachments: a received file is saved under a sanitized name (path, forbidden or invisible characters,
right-to-left override as in "fdp.exe", Windows reserved names), never overwriting a file, with the Windows
"downloaded from the Internet" mark (Zone.Identifier), so Windows and Office open it with their protections.
Attaching a local file: never from a secrets location (
.ssh,.gnupg,.aws,.config/gcloud, the AI apps' folders,.envfiles, private keys,credentials.json..., plus your own folders listed inNEXUS_AGYMAIL_PROTECTED); the user can always attach it themselves in Gmail. - Token:
~/.nexus/nexus-agymail/token.bin, encrypted with DPAPI for the current Windows account (permissions reduced to that account); written atomically under a lock (several servers can run at once). It is never shown. When you sign in again, a previous token with extra scopes is revoked only after the new one is saved. - Exact errors: revoked or expired token, network, quota, permissions, not found, label: each has a stable
code(revoked,network,quota,forbidden,not_found,label,invalid_argument...). Every request except a send is retried up to 5 times with random exponential backoff on 429, 5xx, a rate-limit 403 or a network failure; a send only on 429. Every failure also says whether a new attempt is safe, as NexusBrowser does:outcomenot_done(Gmail refused it or it never left),unknown(Gmail may have acted: a draft or a send is never replayed blindly) orpartial(a list stopped midway,completedlists what was done), andretry_safe(quota and network: yes; revoked, forbidden: no, only the user can fix it). - Sender check:
authenticationreads only the topmostAuthentication-Resultsand only when Gmail (mx.google.com) wrote it; a header the sender wrote lower down, or another server's, is never believed. - Bounded sizes: bodies cut at
maxChars(reported), paged searches, at most 1,000 messages per labelling call and 100 items per thread labelling or trash call.
Configuration
Privacy
NexusAGYmail runs on your machine. It has no account of its own, no telemetry, no analytics and no relay: its only
network requests go to Google (gmail.googleapis.com, oauth2.googleapis.com, and accounts.google.com in your
browser when you sign in), with your own OAuth client. The installer (get.ps1) downloads the release from GitHub.
To report a vulnerability, see SECURITY.md.
- What it reads: the emails, threads, drafts, labels and attachments the agent asks for, only when it calls the matching tool; local files only when the agent attaches them to a draft.
- Where it goes: tool results go to the AI client you connected, which may send them to its model provider under its own privacy policy. Drafts and sent emails go to Gmail. NexusAGYmail sends nothing anywhere else.
- What it stores, under
~/.nexus/nexus-agymail/(orNEXUS_AGYMAIL_HOME): the refresh token (token.bin, encrypted with DPAPI), its lock file, the copy of your OAuth client (client_secret.json), the position oflist_new_messagesper account and label (history.json: a GmailhistoryIdand the time of the last check, no email content), the sends whose outcome is unknown (envois.json: the SHA-256 of the raw bytes, the draft ID and the attempt time, no email content), and backups of the Antigravity config filessetupedits (backups/). The server also writes~/.nexus/status/agymail.json(version, process, start time) for the Nexus app. Attachments you ask it to save go to~/Downloads/NexusAGYmail(or the folder given). In memory only, for the life of the server: the pending send accords and the addresses seen in emails read (for theprovenancewarning). No email is written to disk unless saved as an attachment; no log of emails is kept. A local usage journal (~\.nexus\journal\agymail\<ai>\<YYYY-MM>.jsonl) records one line per tool call: tool name, duration, outcome and a stable error code (quota,network...), never an address, subject, body, label, ID or query. It never leaves the PC;NEXUS_JOURNAL=0turns it off. - Removing it:
get.ps1 -Remove(or delete~/.gemini/config/plugins/nexus-agymail/), then delete~/.nexus/nexus-agymail/; revoke the access in your Google account and delete your Google Cloud project if you no longer need it.
Known limitations
- Each user creates their own Google OAuth client (guided by
setup). A shared public client would need Google's restricted scope verification and a security assessment. - Plain-text bodies only when writing:
create_draftandupdate_draftdo not write HTML;update_draftreplaces the HTML part of a draft written in Gmail with the plain text. - No Gmail settings (filters, signature, forwarding, vacation replies): use the Gmail web app.
- No spam reporting and no permanent deletion, on purpose.
- Windows only (used daily on Windows 11 with a real Gmail account).
Development
The engine is C# on .NET 10 (native/, MimeKit for MIME), one self-contained executable per architecture. You need
the .NET 10 SDK.
The suite (tests/) runs the engine over JSON-RPC on stdio against a fake Gmail API exposed only on loopback, with an
isolated home and fake credentials: tool contracts, paging, MIME, replies and attachments, exact approved send bytes,
concurrent draft edits, single-use accords, quota, lost, truncated or redirected send replies, secret files and
header injection refused. It also checks the sign-in against a fake Google (PKCE, state, revocation order), the
guided sign-in, setup in a temporary home, get.ps1 on a local package under PowerShell 7 and Windows PowerShell
5.1, and recipient lists and attachment names over thousands of seeded inputs. Build and test outputs go to
~\.nexus\build\nexusagymail; NEXUS_AGYMAIL_TEST_EXE tests an executable already built. tools/package.ps1 -Version X.Y.Z builds the release files locally; each push to main builds, attests and publishes them as a development
vX.Y.Z-dev.N pre-release, promoted as is to the stable vX.Y.Z by hand (release.yml).
Part of the Nexus ecosystem
Your AIs (Claude, Codex, Antigravity) at work on your Windows apps, real Chrome and Android phone — in the background.
Get them all with NexusSystem · Microsoft Store · julienpiron.fr · @julienpironfr
Built in France 🇫🇷 by Julien Piron
MIT. Not affiliated with Google; Gmail is a trademark of Google LLC.
來源:README.md,提交 3c30176
工具
0版本歷史
10- v0.16.8最新Nov 7, 2026
- v0.16.2Nov 4, 2026
- v0.16.1Nov 3, 2026
- v0.16.0Nov 1, 2026
- v0.15.4Oct 31, 2026
- v0.15.2Oct 30, 2026
- v0.15.0Oct 30, 2026
- v0.12.3Oct 29, 2026
- v0.10.2Oct 26, 2026
- v0.8.1Oct 26, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分