プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。レビューとアカウント機能は今後のステップで始まります。
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

Gmail Attachments MCP

作者:zayansalmanバージョン 0.1.0i★ –iパソコンで動く
レジストリ名io.github.zayansalman/gmail-attachments-mcp

インストール

概要

作者による説明(英語の原文)

Minimal MCP server for downloading Gmail attachments to disk. Read-only OAuth by default.

PopNx MCPの3つの柱

この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。

できること

このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。

  • 接続方法: パソコンで動く
  • トランスポート: stdio
  • カテゴリ: チャット・メール
  • 入力が必要なもの:GMAIL_MCP_TOKEN

インストール

使っているAIアプリを選んで、設定をコピーしてください。

インストールの前に

  • 基本チェック:1項目中1項目に合格
  • あなたのパソコンで、あなたのユーザーと同じ権限(ファイル、ネットワーク、アプリ)で動きます。
  • 自分で入力するもの: GMAIL_MCP_CREDENTIALS, GMAIL_MCP_TOKEN, GMAIL_MCP_DEFAULT_DEST_DIR, GMAIL_MCP_SCOPES

「秘密」と表示された値は、あなたのアカウントの鍵です。絶対に人に教えたり、チャットに貼り付けたりしないでください。

必要なもの

  • PyPIPythonのuvのインストール(uvxコマンドに必要)

どのアプリを使っていますか?

上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。

Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます

{
  "mcpServers": {
    "gmail-attachments": {
      "command": "uvx",
      "args": [
        "gmail-attachments-mcp",
        "serve"
      ],
      "env": {
        "GMAIL_MCP_CREDENTIALS": "your-value",
        "GMAIL_MCP_TOKEN": "your-value",
        "GMAIL_MCP_DEFAULT_DEST_DIR": "your-value",
        "GMAIL_MCP_SCOPES": "your-value"
      }
    }
  }
}

ターミナルでこれを実行します

claude mcp add gmail-attachments --env GMAIL_MCP_CREDENTIALS=your-value --env GMAIL_MCP_TOKEN=your-value --env GMAIL_MCP_DEFAULT_DEST_DIR=your-value --env GMAIL_MCP_SCOPES=your-value -- uvx gmail-attachments-mcp serve

動かす前に、空欄の値を入力してください。

Cursorで開く

または、設定を自分でコピーする

プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます

{
  "mcpServers": {
    "gmail-attachments": {
      "command": "uvx",
      "args": [
        "gmail-attachments-mcp",
        "serve"
      ],
      "env": {
        "GMAIL_MCP_CREDENTIALS": "your-value",
        "GMAIL_MCP_TOKEN": "your-value",
        "GMAIL_MCP_DEFAULT_DEST_DIR": "your-value",
        "GMAIL_MCP_SCOPES": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

VS Codeで開く

または、設定を自分でコピーする

プロジェクトの .vscode/mcp.json に貼り付けます

{
  "servers": {
    "gmail-attachments": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "gmail-attachments-mcp",
        "serve"
      ],
      "env": {
        "GMAIL_MCP_CREDENTIALS": "your-value",
        "GMAIL_MCP_TOKEN": "your-value",
        "GMAIL_MCP_DEFAULT_DEST_DIR": "your-value",
        "GMAIL_MCP_SCOPES": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。

選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。

自分で入力する値

  • GMAIL_MCP_CREDENTIALS env
    Path to the Google OAuth client secret JSON. Default: $XDG_CONFIG_HOME/gmail-attachments-mcp/credentials.json.
  • GMAIL_MCP_TOKEN 秘密 env
    Path to the cached Gmail OAuth refresh token. Default: $XDG_CONFIG_HOME/gmail-attachments-mcp/token.json.
  • GMAIL_MCP_DEFAULT_DEST_DIR env
    Default directory where downloaded attachments are saved when the tool call does not specify dest_dir. Default: ~/Downloads.
  • GMAIL_MCP_SCOPES env
    Comma-separated Google OAuth scopes. Default: https://www.googleapis.com/auth/gmail.readonly.

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月8日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント zayansalman で確認済みです

  • … 未チェック

    今もメンテナンスされている

    このリポジトリはまだGitHubから読み取っていません

  • … 未チェック

    ライセンスがある

    このリポジトリはまだGitHubから読み取っていません

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

チャット・メールのほかのサーバーとの比較i

  • このカテゴリのほかの1845件のうち0%よりスターが多い
  • このカテゴリのほかの1845件のうち13%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの1845件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

Gmail Attachments MCPは安全ですか?

当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

入力が必要なもの:GMAIL_MCP_TOKEN

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は–、最新バージョン(0.1.0)がレジストリに届いたのは5 か月前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。

代わりに使えるものは?

同じカテゴリには:Vexa, emailmd, MCP WhatsApp Cloud

代わりの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Vexa

作者:Vexa-ai

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

クラウドで動く★ 2,949Apache-2.02 か月前更新
インストール

emailmd

作者:anypost

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

パソコンでもクラウドでも★ 1,385MIT32 日前更新
インストール

MCP WhatsApp Cloud

作者:codespar

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

パソコンで動く★ 277MIT5 か月前更新
インストール

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

gmail-attachments-mcp

A focused Model Context Protocol server (and standalone CLI) for downloading Gmail attachments to disk. Three tools, read-only OAuth scope, no extra surface area.

Built because the hosted claude.ai Gmail connector in Claude Desktop returns attachment IDs and metadata only — not the actual bytes. This server fills that gap for any MCP client (Claude Code, Claude Desktop, Cursor, Cline, etc.), and also works as a plain CLI for cron jobs and shell scripts.

If you used @GongRzhe/Gmail-MCP-Server (1.1k★, archived 2026-03-03) for its attachment-download workflow, this is a minimal successor focused on that single capability.

Features

  • 3 MCP tools — gmail_search, gmail_download_thread_attachments, gmail_download_latest_matching. That's the whole API.
  • Read-only OAuth scope (gmail.readonly) — can't send, delete, or modify mail.
  • Works as both an MCP server and a standalone CLI — same code, same auth token, both surfaces.
  • Env-var-driven config — GMAIL_MCP_CREDENTIALS, GMAIL_MCP_TOKEN, GMAIL_MCP_DEFAULT_DEST_DIR.
  • Cron-friendly — once authorized, the cached refresh token lets headless jobs run indefinitely.

Install

pip install gmail-attachments-mcp

or, with uv:

uv tool install gmail-attachments-mcp

One-time setup (~10 minutes)

You need a Google Cloud OAuth client. The server runs entirely on your machine; nothing leaves it.

  1. Sign in to Google Cloud Console with the Gmail account whose attachments you want to download.
  2. Create a project (or pick an existing one).
  3. Enable the Gmail API: console.cloud.google.com/apis/library/gmail.googleapis.com.
  4. Configure the OAuth consent screen under APIs & Services → OAuth consent screen:
  • Google Workspace users: User type = Internal (no app verification needed).
  • Personal Gmail users: User type = External. Add your own Gmail address as a test user under "Test users".
  1. APIs & Services → Credentials → + Create credentials → OAuth client ID
  • Application type: Desktop app
  • Download the JSON.
  1. Run setup:
gmail-attachments-mcp setup --import-credentials ~/Downloads/client_secret_*.json

A browser window opens for OAuth consent. After consent, a refresh token is cached at ~/.config/gmail-attachments-mcp/token.json (or $XDG_CONFIG_HOME/gmail-attachments-mcp/).

Verify:

gmail-attachments-mcp status

gmail-attachments-mcp search "has:attachment newer_than:7d" --max 3

See docs/setup-google-oauth.md for screenshots and troubleshooting.

Use it from Claude Code

claude mcp add --scope user gmail-attachments gmail-attachments-mcp -- serve

Then in any Claude Code session:

Use the gmail-attachments MCP to download the latest CV from careers@example.com to ~/CVs.

Use it from Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

{

"mcpServers": { "gmail-attachments": { "command": "gmail-attachments-mcp", "args": ["serve"] } } }

Restart Claude Desktop. See docs/claude-desktop.md for details.

Use it from Cursor / Cline / Continue / others

Any MCP client that supports stdio servers. Point it at the same gmail-attachments-mcp serve command. See docs/other-clients.md.

Use it from the shell or cron

# Search

gmail-attachments-mcp search "from:noreply@stripe.com has:attachment newer_than:30d"

Download every attachment from a specific thread

gmail-attachments-mcp thread 19db831fab15b507 --dest ~/Invoices

Download from the latest match, only PDFs

gmail-attachments-mcp latest "from:hr@example.com has:attachment" --dest ~/CVs --ext .pdf,.docx

Cron example — pull CV attachments hourly:

0 * * * * /usr/local/bin/gmail-attachments-mcp latest "to:careers@example.com has:attachment newer_than:2d" --dest ~/CVs --ext .pdf,.docx >> ~/.cache/gmail-attachments-mcp.log 2>&1

The 3 MCP tools

gmail_search(query, max_results=10)

Returns thread summaries with attachment filenames. Use Gmail's standard query syntax.

[

{ "thread_id": "19db831fab15b507", "subject": "Folon Q3 2026 Quarterly Product Recap", "sender": "Manon Muhtasin Rahman ", "date": "Thu, 23 Apr 2026 08:35:00 +0600", "snippet": "Hi everyone, Attached is...", "message_count": 1, "attachment_count": 1, "attachment_filenames": ["Folon Quarterly Report Q3 2026.pdf"] } ]

gmail_download_thread_attachments(thread_id, dest_dir?, extensions?)

Downloads every attachment in a thread to disk. Returns path, size_bytes, mime_type, original_filename per file.

gmail_download_latest_matching(query, dest_dir?, extensions?)

Convenience: search + download from the single most recent match, in one call.

Configuration

All paths can be overridden via environment variables.

VariableDefaultWhat
GMAIL_MCP_CREDENTIALS~/.config/gmail-attachments-mcp/credentials.jsonOAuth client secret JSON
GMAIL_MCP_TOKEN~/.config/gmail-attachments-mcp/token.jsonCached refresh token
GMAIL_MCP_DEFAULT_DEST_DIR~/DownloadsDefault download destination
GMAIL_MCP_SCOPEShttps://www.googleapis.com/auth/gmail.readonlyOAuth scopes (comma-separated)
XDG_CONFIG_HOME~/.configStandard XDG override

Security

  • Token storage: refresh token is written to ~/.config/gmail-attachments-mcp/token.json with mode 0600. Anyone with shell access to your account can read your Gmail. Treat the file like a password.
  • OAuth scope: default is gmail.readonly. Cannot send, delete, or modify mail. If you change $GMAIL_MCP_SCOPES, you're on the hook for the consequences.
  • Credential file: your OAuth client secret JSON is *not* a password — it identifies your app to Google. But never commit it. The included .gitignore blocks the common filenames.
  • OAuth client: your client lives in *your* Google Cloud project. There's no central server, no telemetry, nothing leaves your machine.

Troubleshooting

`No valid Gmail token` when invoked from Claude Desktop / cron The first OAuth flow requires a browser. Run gmail-attachments-mcp setup once in a terminal where a browser can open. Subsequent runs use the cached refresh token.

`Token has been expired or revoked` Refresh tokens stay valid as long as you use them at least every 6 months and don't revoke them at myaccount.google.com/permissions. Re-auth:

gmail-attachments-mcp setup --reauth

`Access blocked: This app's request is invalid` On personal Gmail, your OAuth consent screen needs your address listed under Test users. Workspace users should select Internal audience to avoid this.

`HttpError 403: Request had insufficient authentication scopes` You changed $GMAIL_MCP_SCOPES without re-authorizing. Run gmail-attachments-mcp setup --reauth.

Comparison with other Gmail MCP servers

ServerScopeToolsMaintenance
Anthropic hosted claude.ai GmailRead/write, hostedmanyActive, but no attachment bytes
GongRzhe/Gmail-MCP-ServerFull mailbox19Archived 2026-03-03
shinzo-labs/gmail-mcpFull mailbox~30Active
gmail-attachments-mcp (this)read-only3Active

Pick this one if you want a tiny, focused, read-only tool. Pick a fuller one if you also need to send mail, manage labels, drafts, threads, etc.

Authentication — bring your own Google OAuth client

There are no API keys and no shipped secrets. The server authenticates to *your* Google account with an OAuth client *you* create, and caches a refresh token locally. The author has zero access to your data.

  • Why your own client? Google's restricted scopes (here, gmail.readonly) can't be redistributed in a shared app, and an unverified shared app is capped at 100 users. "Bring your own OAuth client" is the standard pattern for personal-data MCP servers.
  • What you need: a free Google Cloud project, the Gmail API enabled, an OAuth consent screen, and a Desktop OAuth client. Full walkthrough → docs/setup-google-oauth.md.
  • Where your token lives: ~/.config/gmail-attachments-mcp/token.json (mode 0600). Delete it to revoke locally; revoke fully at myaccount.google.com/permissions.
  • No hosted/SaaS option — everything runs locally; your mail never touches a third-party server.

Related tools

Part of a small family of focused, local MCP servers for Google Workspace data the hosted connectors don't expose:

  • gmail-attachments-mcp — download Gmail attachment bytes to disk *(this repo)*
  • [google-drive-comments-mcp](https://github.com/zayansalman/google-drive-comments-mcp) — read comment threads on Docs/Sheets/Slides
  • [google-drive-files-mcp](https://github.com/zayansalman/google-drive-files-mcp) — move/organize Drive files

They can share one OAuth login or stay isolated — see each repo's setup.

License

MIT. See LICENSE.

Contributing

Issues and PRs welcome. Run pytest and ruff check src tests before submitting.

git clone https://github.com/zayansalman/gmail-attachments-mcp

cd gmail-attachments-mcp pip install -e ".[dev]" pytest

PopNxに聞く