
Gmail Postmaster Tools
io.github.optipub由 GitHub 帳號 optipub 發布v1.0.1更新於 Oct 27, 2026
Gmail Postmaster Tools v2 — domains, traffic metrics, and compliance via your own Google OAuth.
概覽
在本機執行的 Gmail Postmaster Tools API v2 MCP 伺服器,讓助理列出你的網域、檢查寄件者合規狀態並查詢 Gmail 流量指標。
- 可以做什麼
- 列出並檢視已註冊的 Postmaster 網域及其驗證狀態
- 檢查寄件者合規情形:SPF、DKIM、DMARC、對齊、DNS 記錄、TLS、垃圾郵件率與退訂判定
- 依日期範圍查詢流量指標:垃圾郵件率、驗證成功率、TLS 加密率、投遞錯誤與回饋迴路
- 登入、查看登入狀態,以及登出用於該 API 的 Google 帳號
- 適用情境
- 適合自行管理寄信的寄件者,想讓助理查詢自己網域的 Gmail 送達情形、是否符合 Gmail 寄件者規則,或垃圾郵件與驗證指標,而不必開啟 Postmaster Tools 介面。
- 執行需求
- 以本機 stdio 程序在桌面電腦上執行,需要 Node.js(無 npm 相依套件)。需自備 Google Cloud OAuth 用戶端:啟用 Gmail Postmaster Tools API、建立桌面應用程式類型的用戶端,並透過 GPT_CLIENT_ID 與 GPT_CLIENT_SECRET 提供用戶端 ID 與密鑰。登入會經由 127.0.0.1 回送位址開啟瀏覽器。.mcpb 套件僅供 Claude Desktop/Cowork 使用,其他用戶端需指向 server/index.js。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Gmail Postmaster Tools,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Gmail Postmaster Tools MCP
[License: MIT] [Built with MCPB] [Node] [Dependencies]
An MCP server for the Gmail Postmaster Tools API (v2) — query your domains, sender compliance status, and Gmail traffic metrics from Claude, Cursor, or any MCP client.
This is a bring-your-own-credentials tool for hands-on senders: you supply your own Google OAuth client, and the server runs the sign-in locally. Nothing is hosted and no data leaves your machine.
Want this without setting up a Google Cloud project? That's what Postmaster+ is for — hosted, multi-provider (Gmail + Outlook + more), with verification, history, and alerting.
Built & maintained by the Postmaster+ team at OptiPub.
What you get
list_domains/get_domain— your registered domains and their verification stateget_compliance_status— SPF, DKIM, DMARC, alignment, message formatting, DNS records, TLS encryption, user-reported spam rate, and one-click / honored unsubscribe verdictsquery_domain_stats— spam rate, auth success (SPF/DKIM/DMARC), TLS encryption rate, delivery errors, and feedback-loop metrics over any date rangegpt_authenticate/gpt_auth_status/gpt_sign_out
Note: Postmaster Tools v2 covers traffic metrics + compliance. Domain and IP reputation are not part of v2.
Prerequisites: create a Google OAuth client (one-time, ~5 min)
You need a Google Cloud OAuth client because Google doesn't offer a shared public one for this API.
- Go to the Google Cloud Console and create (or pick) a project.
- APIs & Services → Library → search "Gmail Postmaster Tools API" → Enable.
- APIs & Services → OAuth consent screen (redirects to Google Auth Platform). If the project has never been configured, click Get started and set an App name + support email, Audience = External, and a contact email. If it's already configured, you'll just see the tabs — skip to the next step.
- Open the Audience tab. If User type = External, add your Google address under Test users → + Add users and Save (leave status as Testing — works without app verification, up to 100 users). If User type = Internal (a Workspace org project), no test users are needed — org users can sign in directly.
- Open the Clients tab (or APIs & Services → Credentials) → Create client → application type Desktop app → Create.
- Copy the Client ID and Client secret.
You'll paste those two values into this extension's configuration at install time. (Make sure the Google account you sign in with is one that has access in Gmail Postmaster Tools.)
Install in Claude / Cowork (the .mcpb)
The .mcpb is a packaging convenience for Claude Desktop / Cowork only.
- Download
gmail-postmaster-tools.mcpbfrom the latest release. - Settings → Capabilities → install extension, pick the file.
- When prompted, paste your Google OAuth Client ID and Client Secret.
- Run
gpt_authenticateonce — your browser opens for the Google sign-in.
Use with other MCP clients (Cursor, VS Code, Windsurf, …)
Underneath, this is a standard stdio MCP server — any client that runs local
MCP servers can use it directly, no .mcpb required. Clone or download the repo,
then point the client at server/index.js and pass your Google credentials as
env vars.
Cursor — edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
VS Code (.vscode/mcp.json), Windsurf, Claude Desktop (manual config),
and most other clients use the same command + args + env shape — only the
config file location differs. Other env overrides are listed under
Configuration.
The first tool call (or gpt_authenticate) opens your browser for the Google
sign-in; the 127.0.0.1 loopback works on any local desktop client.
Remote-only clients (e.g. Perplexity, ChatGPT connectors): these accept only a remote HTTPS MCP server URL, not a local command, so this stdio build can't be added directly. That would require hosting it — which is what Postmaster+ provides.
Usage examples
- "Sign me in to Gmail Postmaster Tools" →
gpt_authenticate - "List my Postmaster domains" →
list_domains - "Is example.com compliant with Gmail's sender rules?" →
get_compliance_status { domain: "example.com" } - "Spam rate for example.com over the last 30 days" →
query_domain_stats { domain: "example.com", start_date: "...", end_date: "...", metrics: ["SPAM_RATE"] } - "DKIM auth success for example.com" →
query_domain_stats { domain: "example.com", metrics: [{ "standardMetric": "AUTH_SUCCESS_RATE", "filter": "auth_type=\"dkim\"" }] }
Some metrics require a filter: AUTH_SUCCESS_RATE (auth_type=spf|dkim|dmarc),
TLS_ENCRYPTION_RATE (traffic_direction=inbound|outbound),
DELIVERY_ERROR_RATE (optional error_type=...). SPAM_RATE needs none.
How authentication works
OAuth 2.0 authorization-code + PKCE, over a http://127.0.0.1:<dynamic-port>
loopback redirect (Google's recommended flow for desktop apps). On sign-in the
server starts a short-lived listener on 127.0.0.1, opens your browser, receives
the code, and exchanges it (with your client secret + PKCE verifier) for tokens.
Google requires a client secret even for desktop apps, which is why both values
are needed. Tokens are stored only on your machine at
~/.gmail-postmaster-mcp/tokens.json (0600) and are git-ignored.
Scopes: by default the server requests
postmaster.traffic.readonly (metrics + compliance) and postmaster.domain
(list/get domains). Override with the GPT_SCOPE env var if you want to narrow
it (e.g. traffic-only, dropping list_domains/get_domain).
Token lifetime (important)
Google revokes refresh tokens after 7 days for OAuth apps whose publishing
status is Testing — the mode the setup steps above use to skip verification.
In practice that means you'll re-run gpt_authenticate about once a week. The
server handles this gracefully: when the refresh fails, tool calls tell you to
re-authenticate.
To stop the weekly re-auth, set your OAuth app's publishing status to In
production (Google Auth Platform → Audience → Publish app). Notes for the
postmaster (sensitive) scopes:
- Production, unverified — refresh tokens no longer expire at 7 days. You'll still click through the "Google hasn't verified this app" screen, and the app is capped at 100 users until verified. For your own single-user use, this is the simple fix.
- Verified — submit the app for Google's OAuth verification to remove the warning and the user cap. Only worth it if you're distributing the app widely.
Configuration (env overrides)
Build
Pushing a vX.Y.Z tag triggers CI to pack, attach the .mcpb to a GitHub
Release, and publish to the MCP Registry.
Why zero dependencies
Only Node.js built-ins (http, https, crypto, readline) — tiny bundle, no
supply-chain risk, nothing to npm install.
Contributing
See CONTRIBUTING.md.
License
MIT © OptiPub
Not affiliated with or endorsed by Google. "Gmail", "Google", and "Postmaster Tools" are trademarks of Google LLC.
來源:README.md,提交 df71e5d
工具
0版本歷史
1- v1.0.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分