ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Multi-Account Gmail

โดย cunicopia-devรุ่น 0.3.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.cunicopia-dev/multi-account-gmail-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Multi-account Gmail MCP server — read, search, draft, and label across every inbox.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: แชตและอีเมล

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "multi-account-gmail": {
      "command": "uvx",
      "args": [
        "multi-account-gmail-mcp"
      ],
      "env": {
        "GMAIL_MCP_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GMAIL_MCP_DB": "ใส่ค่าของคุณ",
        "GMAIL_MCP_OAUTH_PORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add multi-account-gmail --env GMAIL_MCP_CLIENT_SECRET='ใส่ค่าของคุณ' --env GMAIL_MCP_DB='ใส่ค่าของคุณ' --env GMAIL_MCP_OAUTH_PORT='ใส่ค่าของคุณ' -- uvx multi-account-gmail-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "multi-account-gmail": {
      "command": "uvx",
      "args": [
        "multi-account-gmail-mcp"
      ],
      "env": {
        "GMAIL_MCP_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GMAIL_MCP_DB": "ใส่ค่าของคุณ",
        "GMAIL_MCP_OAUTH_PORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "multi-account-gmail": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "multi-account-gmail-mcp"
      ],
      "env": {
        "GMAIL_MCP_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GMAIL_MCP_DB": "ใส่ค่าของคุณ",
        "GMAIL_MCP_OAUTH_PORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • GMAIL_MCP_CLIENT_SECRET env
    Path to the Google OAuth "Desktop app" client-secret JSON. Defaults to ~/.gmail-mcp/client_secret.json.
  • GMAIL_MCP_DB env
    Path to the SQLite token store holding per-account refresh tokens. Defaults to ~/.gmail-mcp/tokens.db.
  • GMAIL_MCP_OAUTH_PORT env
    Localhost port for the OAuth redirect during account authorization. Defaults to 8765.

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub cunicopia-dev ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด แชตและอีเมลi

  • ดาวมากกว่า 0% ของอีก 1765 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 14% ของอีก 1765 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 1765 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Multi-Account Gmail ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.3.0) เข้า registry 4 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Vexa, emailmd, MCP WhatsApp Cloud

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Vexa

โดย Vexa-ai

Meeting bot and transcripts for Google Meet, Teams and Zoom. Live or after, speakers labelled.

รันบนคลาวด์★ 2,949Apache-2.0อัปเดต 2 เดือนที่ผ่านมา
ติดตั้ง

emailmd

โดย anypost

Render markdown into email-safe HTML, lint drafts for deliverability problems, and preview emails.

บนเครื่องหรือคลาวด์★ 1,385MITอัปเดต 31 วันที่ผ่านมา
ติดตั้ง

MCP WhatsApp Cloud

โดย codespar

MCP server for WhatsApp Cloud API (Meta) — messages, media, and templates via Graph API

รันบนเครื่อง★ 277MITอัปเดต 5 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

gmail-mcp

An [MCP](https://modelcontextprotocol.io) server that reads across _all_ your Gmail accounts from one connection.

Most Gmail integrations — including the native connectors — bind a single account per OAuth grant: connect a second inbox and you disconnect the first. gmail-mcp keeps any number of accounts authorized at once. One Google Cloud client authorizes them all, each lands as a row in a local SQLite file, and every tool takes an account argument that routes to the right mailbox. search_all_accounts sweeps all of them in a single query.

Python 3.12+ · MIT · stdio MCP server + auth CLI · local SQLite token store

It's built to be owned completely: runs in-process over stdio, stores tokens in one SQLite file you can inspect, copy, or delete, talks only to Google and your MCP client, and hardcodes no secrets.

It reads, searches, drafts, and labels. It doesn't send — create_draft leaves a draft for you to send yourself. That's a deliberate default (reasoning in Security model), not a hard stance; if you want autonomous send, it's a small addition or a different server.


Contents

  • The idea in 30 seconds
  • Design notes
  • Tools
  • Architecture
  • Identity & auth model
  • The OAuth model
  • The multi-account model
  • Token lifecycle
  • The headless auth path
  • Security model
  • Install
  • Quickstart
  • Configuration
  • Register with an MCP client
  • Development
  • Project layout
  • License

The idea in 30 seconds

Authorize N accounts once via the CLI. Then every tool takes an account, and search_all_accounts hits all of them at once:

search_all_accounts(query="invoice newer_than:30d")

── personal@gmail.com ─────────────────────────────── from: billing@acme.com subject: Invoice #4821 (id 18f...)

── work@company.com ───────────────────────────────── from: ap@vendor.io subject: March invoice (id 19a...)

One query, every inbox, each result tagged with its account and carrying the message id — so the agent can chain read_message(account, id) or create_draft(...) next.


Design notes

One OAuth client, many inboxes. A single Google Cloud project and one client_secret.json authorize every account. Adding the tenth inbox is the same one-command flow as the first.

Boring storage. Tokens live in one SQLite file under ~/.gmail-mcp/. No daemon, no keyring dependency, no cloud. Back it up by copying it; revoke an account by deleting a row; inspect it with any SQLite tool.

Least privilege. Four granular scopes — gmail.readonly, gmail.compose, gmail.modify, gmail.settings.basic — never the full-mailbox https://mail.google.com/. It can read, draft, label, and manage filters; it never sends mail, and filters it creates can't forward mail off-account.

Headless-friendly. The auth flow assumes the server may have no browser: it prints a consent URL, binds a fixed port, and you SSH-forward the redirect. Works fine on a desktop too.


Tools

Every tool except list_accounts and search_all_accounts takes an account (the email address). Unknown accounts return an error listing the authorized ones.

ToolArgumentsReturns
list_accounts—Authorized accounts + last-used time. Discover valid account values.
search_messagesaccount, query, max_results=20Message summaries (Gmail search syntax) with ids.
read_messageaccount, message_id, format="full", max_body_chars?Decoded headers, plaintext body (HTML stripped if needed), attachment metadata. Body capped by default; pass max_body_chars=0 for the full body.
read_threadaccount, thread_id, max_body_chars?Every message in the thread, in order. Each body capped by default; max_body_chars=0 for full.
download_attachmentsaccount, message_id, index?Save a message's attachments to disk and return absolute paths. Address them by the #N shown in read_message; omit index for all of them. Fixed download root, no destination argument. Dangerous file types and anything on a spam-labeled message are refused.
search_all_accountsquery, max_results_per_account=10One search across every account, each result tagged by account.
create_draftaccount, body, to?, subject?, cc?, bcc?, html=false, reply_to_message_id?, reply_all=false, from_addr?A draft (not sent). Returns the draft id. With reply_to_message_id the draft is a reply inside that message's thread: recipient, subject, In-Reply-To, References and the thread id come from it, and to/subject become optional overrides. Without it, to and subject are required. from_addr sets the From header for a verified send-as alias; it defaults to the account address.
list_draftsaccount, max_results=20Draft ids in the account.
list_labelsaccountThe account's labels (name + id).
create_labelaccount, nameCreate a user label (nest with /). Idempotent: an existing name (case-insensitive) returns its id and creates nothing.
modify_labelsaccount, selection (message_id \message_ids \query), add?, remove?Add/remove labels on a selection (one id, a list, or everything a query matches), batched 1000/call. General mutator: archive = remove INBOX, mark-read = remove UNREAD, star = add STARRED.
trashaccount, selection (message_id \message_ids \query)Move a selection to Trash (recoverable 30 days; not permanent delete). Refuses an empty selection.
bulk_actionaccount, action, selection (message_id \message_ids \query)Friendly verb layer over modify_labels. action ∈ archive/unarchive/mark_read/mark_unread/star/unstar/spam/unspam/trash/untrash. Batched 1000/call; refuses an empty selection.
read_messagesaccount, message_ids \query, max_results=25Batch-read full content of many messages in one call (vs. N read_message calls).
count_messagesquery, account?, all_accounts=falseCount matches without fetching content — blast-radius check before a bulk action. all_accounts gives a per-account breakdown + total.
list_filtersaccountThe account's filters: id, criteria, actions (label ids shown as names).
create_filteraccount, one of from_address/to_address/subject/query/has_attachment, plus an action (archive/mark_read/delete/star or add_labels/remove_labels)A server-side rule applied to incoming mail. Can't forward off-account.
delete_filteraccount, filter_idRemove a filter by id (leaves already-acted-on mail alone).

Architecture

flowchart TD

subgraph client[Your machine] Agent[MCP client / agent] CLI[gmail-mcp-auth CLI] Server[gmail-mcp stdio server] Store[("SQLite ~/.gmail-mcp/tokens.db")] Secret["client_secret.json one OAuth client"] end Google[Google OAuth + Gmail API]

CLI -->|"loopback OAuth, once per account"| Google CLI -->|"store refresh token"| Store Secret -.-> CLI Agent -->|"tool call (account=...)"| Server Server -->|"look up + refresh creds"| Store Secret -.-> Server Server -->|"read / draft / label"| Google Server --> Agent

Authorization happens once per account through the CLI (it needs a browser). After that the stdio server reads tokens straight from SQLite, refreshing access tokens on demand and persisting them back. The rest of this section is the "why it works the way it does" detail.


Identity & auth model

How gmail-mcp authenticates to Gmail, juggles multiple accounts under a single OAuth client, refreshes tokens over time, and authorizes accounts on a headless server. If you just want to get running, jump to Quickstart.

The OAuth model

gmail-mcp authenticates using a Google "Desktop app" OAuth client (an *installed application* in OAuth 2.0 terms), driven by the InstalledAppFlow helper from google-auth-oauthlib.

Why an installed-app / desktop client. Installed apps run on a machine the end user controls, so OAuth treats them as public clients: the client_secret in the downloaded client_secret.json is *not* assumed to be confidential. That's the right trust model for a local CLI/desktop tool — there's no server-side component that could keep a secret truly secret, and security rests on the user controlling the redirect (the loopback address) rather than on secret confidentiality. It's the client type Google recommends for command-line and desktop tools.

The loopback redirect flow. After you approve consent in a browser, Google redirects the authorization code to http://localhost: /, where a tiny throwaway HTTP server (started by InstalledAppFlow.run_local_server) catches it. gmail-mcp pins this to a fixed port (default 8765, override with GMAIL_MCP_OAUTH_PORT) and runs with open_browser=False so it works on machines with no browser — see The headless auth path.

Scopes requested. Four granular scopes — never the full-mailbox https://mail.google.com/:

ScopeWhat it grants
gmail.readonlyRead mail and metadata: search messages/threads, read bodies, list labels and drafts. Read-only — cannot modify anything.
gmail.composeCreate, update, and manage drafts. Used only by create_draft.
gmail.modifyAdd/remove labels on messages and create labels. Used by modify_labels, bulk_action, trash and create_label.
gmail.settings.basicList, create, and delete filters. Used by list_filters/create_filter/delete_filter. Does not grant forwarding-address changes (that's gmail.settings.sharing, not requested).

gmail.send is not requested. Without it the credential simply has no Gmail API path to send mail — the drafts-only behavior is a property of the grant, not just an omitted tool. gmail.settings.sharing is likewise not requested, so no filter can forward mail to another address. The scope list lives in one place: SCOPES in src/gmail_mcp/config.py.

Adding the filter scope to an existing install: widening SCOPES does not

retro-grant already-authorized accounts. Each account must re-run

gmail-mcp-auth add to re-consent to the new scope; until it does, the filter

tools return a 403 insufficient scope error.

The multi-account model
  • One OAuth client authorizes many accounts. You create a single Google Cloud project and one "Desktop app" OAuth client, then run the consent flow once per Gmail account, signing into the account you want to add each time. A single client_secret.json can authorize any number of accounts.
  • Each account is a row in SQLite. Every authorized account is stored in the accounts table (~/.gmail-mcp/tokens.db, override with GMAIL_MCP_DB), keyed by email. The row holds the long-lived refresh token, the most recent access-token blob, the granted scopes, and timestamps.
  • **

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx