Google Drive Comments Mcp

io.github.zayansalman由 GitHub 帳號 zayansalman 發布v0.1.0更新於 Oct 24, 2026

Minimal MCP server for reading comments on Google Drive files (Docs, Sheets, Slides). Read-only.

已驗證STDIO僅桌面效率與工作流檔案與儲存

概覽

AI 產生的概覽

本機唯讀 MCP 伺服器,讓助理搜尋 Google Drive 並讀取文件、試算表與簡報的留言串。

可以做什麼
  • 依檔名或 Drive 查詢語法搜尋檔案,回傳 ID、擁有者與連結
  • 以連結或檔案 ID 讀取文件、試算表、簡報的全部留言串
  • 查看每則留言的作者、內容、錨定引文、已解決狀態與回覆
  • 可只篩選未解決的留言,方便整理待處理的回饋
適用情境
需要取得 Google Drive 文件上的審閱討論(錨定引文、回覆、解決紀錄)時使用,這些內容託管版 Drive 連接器只提供檔案內容與搜尋。適合讓助理彙整審閱者對某份文件、試算表或簡報的意見。
執行需求
需在本機安裝 Python 套件(pip 或 uv),以 stdio 程序執行。需要自建 Google Cloud OAuth 用戶端:啟用 Drive API、設定同意畫面、建立桌面應用程式 OAuth 用戶端 JSON,並完成一次瀏覽器授權。透過 DRIVE_MCP_CREDENTIALS、DRIVE_MCP_TOKEN、DRIVE_MCP_SCOPES 設定,更新權杖會快取在本機。
安裝前請注意
預設 drive.readonly 範圍可讀取帳號下所有檔案,而不只是所查詢的檔案。快取的更新權杖(DRIVE_MCP_TOKEN)應視同密碼保管;刪除該檔案或在 Google 帳號中撤銷授權即可中斷。伺服器為唯讀,不能編輯、留言或刪除。設定需要 Google Cloud 專案與 OAuth 同意畫面。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Google Drive Comments Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

google-drive-comments-mcp

A focused Model Context Protocol server (and standalone CLI) for reading comments on Google Drive files — Docs, Sheets, and Slides. Two tools, read-only OAuth scope, no extra surface area.

Built because the hosted Google Drive connectors expose file content and search, but not the comment threads — the review discussion, the anchored quotes, the resolve/reopen history. This server fills that gap for any MCP client (Claude Code, Claude Desktop, Cursor, Cline, etc.), and also works as a plain CLI.

Features

  • 2 MCP tools — drive_search_files, drive_get_comments. That's the whole API.
  • Reads full comment threads — author, content, the anchored quoted text, resolved/open status, and every reply (with resolve/reopen actions).
  • Works across Docs, Sheets, and Slides — the Drive comments API is uniform across file types.
  • Accepts URLs or IDs — paste a docs.google.com/document/d/… link or a bare file ID.
  • Read-only OAuth scope (drive.readonly).
  • Env-var-driven config — DRIVE_MCP_CREDENTIALS, DRIVE_MCP_TOKEN, DRIVE_MCP_SCOPES.

Install

bash
pip install google-drive-comments-mcp# or, with uv:uv tool install google-drive-comments-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 account whose Drive comments you want to read.
  2. Create a project (or pick an existing one).
  3. Enable the Drive API: console.cloud.google.com/apis/library/drive.googleapis.com.
  4. Configure the OAuth consent screen under APIs & Services → OAuth consent screen:
    • Google Workspace users: User type = Internal. No app verification is needed even though drive.readonly is a restricted scope.
    • Personal Gmail users: User type = External, and add your own address under "Test users".
  5. APIs & Services → Credentials → + Create credentials → OAuth client ID
    • Application type: Desktop app
    • Download the JSON.
  6. Run setup:
bash
google-drive-comments-mcp setup --import-credentials ~/Downloads/client_secret_*.json

A browser window opens for OAuth consent. The refresh token is cached at ~/.config/google-drive-comments-mcp/token.json.

Verify:

bash
google-drive-comments-mcp statusgoogle-drive-comments-mcp comments "https://docs.google.com/document/d/YOUR_DOC_ID/edit"

Use it from Claude Code

bash
claude mcp add --scope user google-drive-comments google-drive-comments-mcp -- serve

Then:

Read the open comments on this doc and summarize what reviewers are asking for: https://docs.google.com/document/d/…

Use it from Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (Mac):

json
{  "mcpServers": {    "google-drive-comments": {      "command": "google-drive-comments-mcp",      "args": ["serve"]    }  }}

(Use the absolute path from which google-drive-comments-mcp if it isn't on Claude Desktop's $PATH.)

Use it from the shell

bash
# Find a docgoogle-drive-comments-mcp search "Q3 strategy"
# Read all comments (open + resolved) on a doc by URL or IDgoogle-drive-comments-mcp comments "https://docs.google.com/document/d/abc123/edit"
# Only unresolved commentsgoogle-drive-comments-mcp comments abc123 --open-only

The 2 MCP tools

drive_search_files(query, max_results=10)

Search Drive. Plain strings are auto-wrapped as a filename search; raw Drive query syntax passes through.

json
[  {    "id": "1AbC…",    "name": "Q3 Strategy",    "mime_type": "application/vnd.google-apps.document",    "modified": "2026-04-20T09:00:00.000Z",    "owners": ["Jane Doe"],    "web_view_link": "https://docs.google.com/document/d/1AbC…/edit"  }]

drive_get_comments(file, include_resolved=True)

Read all comments on a file. file accepts a Docs/Sheets/Slides/Drive URL or a bare file ID.

json
{  "file": { "id": "1AbC…", "name": "Q3 Strategy", "mime_type": "…document", "web_view_link": "…", "owners": ["Jane Doe"] },  "open_count": 2,  "resolved_count": 1,  "comments": [    {      "id": "AAAA…",      "author": "Jane Doe",      "content": "Can we add the unit-economics table here?",      "quoted_text": "Our margins improved in Q3.",      "resolved": false,      "created": "2026-04-21T10:00:00Z",      "modified": "2026-04-21T10:00:00Z",      "replies": [        { "author": "John Smith", "content": "Added.", "action": "", "created": "2026-04-21T11:00:00Z" }      ]    }  ]}

quoted_text is the document text the comment is anchored to — useful context for understanding what each comment refers to.

Configuration

VariableDefaultWhat
DRIVE_MCP_CREDENTIALS~/.config/google-drive-comments-mcp/credentials.jsonOAuth client secret JSON
DRIVE_MCP_TOKEN~/.config/google-drive-comments-mcp/token.jsonCached refresh token
DRIVE_MCP_SCOPEShttps://www.googleapis.com/auth/drive.readonlyOAuth scopes (comma-separated)
XDG_CONFIG_HOME~/.configStandard XDG override

Sharing one login with other Google MCP tools

If you also run a sibling tool (e.g. gmail-attachments-mcp) and want a single OAuth consent for both, point both tools at the same credential + token files (via the env vars above, or symlinks) and authorize once with the combined scopes:

bash
DRIVE_MCP_SCOPES="https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/drive.readonly" \  google-drive-comments-mcp setup --reauth

A token granted a superset of scopes satisfies each tool's narrower request.

Security

  • Read-only: the default scope is drive.readonly. It cannot edit, comment, or delete — only read file metadata, content, and comments.
  • Scope breadth: drive.readonly grants read access to all your Drive files, not just the one you query. There is no per-file read scope that also exposes comments. Treat the cached token like a password (it's written 0600).
  • No telemetry: your OAuth client lives in your own Google Cloud project. Nothing leaves your machine.

Troubleshooting

HttpError 403: Google Drive API has not been used in project … before or it is disabled Enable the Drive API on the project that owns your OAuth client, then retry.

No valid Google token from Claude Desktop / cron Run google-drive-comments-mcp setup once in a terminal where a browser can open. Subsequent runs reuse the cached token.

Comments come back empty on a file you know has comments Confirm you authorized the account that can actually see the file, and that the file genuinely has comments (suggestions are not comments). Resolved comments are included unless you pass --open-only / include_resolved=false.

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, drive.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 Drive API enabled, an OAuth consent screen, and a Desktop OAuth client. Full walkthrough → docs/setup-google-oauth.md.
  • Where your token lives: ~/.config/google-drive-comments-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 Drive data never touches a third-party server.

More guides

Related tools

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

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

License

MIT. See LICENSE.

來源:README.md,提交 5e81432

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分