Google Docs Mcp

io.github.yeyo11由 GitHub 帳號 yeyo11 發布v0.1.2更新於 Nov 7, 2026

Read-only server that explains a Google Doc's comments and reply threads to an AI assistant.

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

概覽

AI 產生的概覽

唯讀的 MCP 伺服器,讓助理讀取 Google 文件的留言、回覆串和內文,並整理出誰在等誰回覆。

可以做什麼
  • 列出、篩選並分頁檢視每則留言的作者、時間、狀態、引用文字和完整回覆串
  • 彙整留言狀況:依狀態計數、參與者活躍度、無人回覆或等待原作者的留言
  • 依 ID 取得單一留言串及其脈絡
  • 讀取文件中介資料與各分頁的純文字內容
  • 在雲端硬碟中依標題或全文搜尋 Google 文件
  • 查看登入狀態及目前連結的 Google 帳號
適用情境
適合在審閱共用 Google 文件時,讓助理說明留言串、找出等待你處理的未解決留言,或在不開啟文件的情況下彙整審閱動態。它為唯讀,無法回覆或解決留言。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 20 以上版本。需要一個已啟用 Drive API 與 Docs API 的 Google Cloud 專案,以及桌面應用程式類型的 OAuth 用戶端,可用憑證 JSON 檔或 GOOGLE_CLIENT_ID 與 GOOGLE_CLIENT_SECRET 提供。首次需在瀏覽器登入,權杖會存在本機;另有選用變數可指定憑證路徑、權杖路徑與設定目錄。
安裝前請注意
需要 Google OAuth 用戶端密鑰,並會把存取權杖寫入磁碟;請妥善保管憑證檔與權杖檔,切勿提交到版本庫。它只申請唯讀權限,但仍會把文件內文、留言者姓名與電子郵件交給助理及其模型服務提供者。每次安裝僅支援一個 Google 帳號。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

google-docs-mcp

[CI] [npm] [License: MIT] [Node.js >= 20] [MCP] [yeyo11/google-docs-mcp MCP server]

A read-only Model Context Protocol server for Google Docs. Its job is to explain a document's comments to an AI assistant (Claude or any MCP client) in full detail: who wrote each one, when, on which piece of text, whether it is open or resolved, the complete reply thread, and who resolved it.

[An assistant reads a document's comments through the server and lists what is unanswered, undecided and pending]

  • Read-only by design. It only requests the documents.readonly and drive.readonly scopes. There is no tool that creates, edits, resolves or deletes anything, and every tool is advertised with readOnlyHint: true.
  • OAuth 2.0 sign-in. Users authenticate with their own Google account through the desktop-app flow with PKCE. Tokens are stored locally and refreshed automatically (see the seven-day exception for External apps in Testing mode).
  • Zero configuration for the assistant. Tools accept a document ID or a full Google Docs URL.

Built by José Antonio Garrido. I write about the developer tools I build on my blog, josegarrido.dev.

Tools

ToolWhat it does
list_commentsThe main tool. Every comment in full detail: author, dates, open/resolved status, quoted text, the whole reply thread (including who resolved or reopened it) and, optionally, the paragraph of the document where the quoted text appears. Filter by status, include deleted comments, paginate, and choose markdown or json output.
get_comments_summaryAggregate view: counts by status, participants and their activity, open comments with no replies, open comments waiting for the original author, oldest open comment and latest activity.
get_commentA single comment thread by ID, with context.
get_documentDocument metadata plus plain-text content (all tabs), so the assistant can understand what the comments refer to.
list_documentsSearch Google Docs in Drive (shared drives included) by title or full text.
get_auth_statusWhether the server is signed in and with which account.

Example: list_comments

markdown
# Q4 project plan- Document ID: `1AbC...`- Link: https://docs.google.com/document/d/1AbC.../edit- Owner: Ana <[email protected]>- Last modified: 2026-09-22 08:00 UTC by Jose <[email protected]> (you)
## Comments (all): 2
### [1] 🟢 OPEN — Ana · 2026-09-22 08:00 UTC
**Quoted text (what the comment refers to):**> delivery date
**Surrounding paragraph (#7):**> The delivery date will be shared with the client once the scope is final.
**Comment:**The delivery date is missing.
_No replies yet._
Comment ID: `AAAAxyz`
### [2] ✅ RESOLVED — Ana · 2026-09-20 10:32 UTC...**Thread (2 replies):**  - Jose (you) · 2026-09-21 09:00 UTC: Yes, moving it.  - Jose (you) · 2026-09-21 12:00 UTC — marked as RESOLVED
Resolved by Jose (you) on 2026-09-21 12:00 UTC.

Comment and reply authors appear by display name: the Drive API doesn't populate their email address. A document's owner and last editor show an email when Google makes it visible to you.

Quick start

Prerequisites

  • Node.js >= 20
  • A Google Cloud project with the Google Drive API and Google Docs API enabled

1. Create an OAuth client in Google Cloud

  1. Open the Google Cloud Console and create or select a project.
  2. APIs & Services → Library: enable Google Drive API and Google Docs API.
  3. APIs & Services → OAuth consent screen: configure it. Use Internal for a Workspace organization; for External apps in testing mode, add your account as a test user.
  4. APIs & Services → Credentials → Create credentials → OAuth client ID, application type Desktop app.
  5. Download the JSON and save it as ~/.config/google-docs-mcp/credentials.json.

External apps in Testing mode have to sign in again every seven days. With an External consent screen whose publishing status is Testing, Google issues a refresh token that expires in 7 days, so automatic renewal stops working and tools report that the sign-in expired until you repeat step 2. The running server picks up the new sign-in without a restart. An Internal consent screen (Workspace organizations only) doesn't have this limit. Neither does publishing the app (In production), but drive.readonly is a restricted scope, so Google then shows an unverified-app warning and caps the project at 100 users unless the app is verified.

You can use environment variables instead of the file:

bash
export GOOGLE_CLIENT_ID="...apps.googleusercontent.com"export GOOGLE_CLIENT_SECRET="..."

2. Sign in with Google

bash
npx -y -p @yeyo11/google-docs-mcp google-docs-mcp-auth

Your browser opens (or the URL is printed so you can paste it). Google asks for read-only access to Drive and Docs. Tokens are saved to ~/.config/google-docs-mcp/token.json with 0600 permissions. Run the same command again to switch accounts.

3. Register the server with your MCP client

No clone or build step is needed; npx fetches the package on first use.

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "google-docs": {      "command": "npx",      "args": ["-y", "@yeyo11/google-docs-mcp"]    }  }}

Claude Code:

bash
claude mcp add google-docs -- npx -y @yeyo11/google-docs-mcp

Any other MCP client that supports stdio servers works the same way. If you use environment variables for the OAuth client, add them to the env block of your client configuration.

Running from source instead
bash
git clone https://github.com/yeyo11/google-docs-mcp.gitcd google-docs-mcpnpm installnpm run buildnpm run auth

Then point your MCP client at node /absolute/path/to/google-docs-mcp/dist/index.js.

4. Ask away

"Summarize the open comments in https://docs.google.com/document/d/…/edit and tell me which ones are waiting on me."

Configuration

VariableDescriptionDefault
GOOGLE_OAUTH_CREDENTIALSPath to the OAuth client JSON.~/.config/google-docs-mcp/credentials.json
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETAlternative to the JSON file.—
GOOGLE_DOCS_MCP_TOKEN_PATHWhere the user's tokens are stored.~/.config/google-docs-mcp/token.json
GOOGLE_DOCS_MCP_CONFIG_DIRBase directory for the two files above.~/.config/google-docs-mcp

How it works

MCP client ──stdio──▶ google-docs-mcp ──OAuth2 (read-only)──▶ Google Drive API (files, comments)                                                            └▶ Google Docs API (document text)
  • Comments come from the Drive API (comments.list / comments.get) with every field requested explicitly, so nothing is silently dropped: quoted text, replies, resolve/reopen actions, deleted flags.
  • The "surrounding paragraph" is found by locating the quoted text inside the document body fetched from the Docs API (all tabs are traversed, including tables).
  • Google API errors (401/403/404/429) are returned as MCP isError results with an actionable message instead of breaking the session. Logs go to stderr; stdout is reserved for the protocol.

Development

bash
npm run dev        # run the server from src/ with tsxnpm run typecheck  # type-check without emittingnpm test           # smoke test: tool listing, error handling without credentials, comment formatting

See CONTRIBUTING.md for the workflow and commit conventions.

Security

  • Only read-only scopes are requested; Google never grants this client write access.
  • If the stored token lacks the expected scopes, the server refuses to use it and asks you to sign in again.
  • credentials.json and token.json are git-ignored. Never commit them.
  • To revoke access, remove the app at https://myaccount.google.com/permissions and delete token.json.

To report a vulnerability, see SECURITY.md.

Limits

  • Read-only. It can't create, reply to or resolve comments, or edit documents.
  • Google Docs only. Sheets, Slides and other file types are refused, by URL and by bare ID.
  • Suggestions, assignments and mentions aren't read as such. A comment is its text, status and thread: an assigned comment looks like any other and a mention is just part of the text. Depending on your access, text pending as a suggestion can appear in get_document as ordinary text.
  • Comment authors are told apart by display name, since Drive doesn't return their email. In get_comments_summary, two people with the same name count as one.
  • get_document returns plain body text from all tabs, tables included: no formatting, images, smart chips, headers, footers or footnotes. 20,000 characters by default, 500,000 at most (max_chars).
  • The surrounding paragraph is found by searching for the quoted text. It takes the first match, so a repeated phrase can point to the wrong paragraph, and it may be missed if the text was edited after the comment. Quotes under 8 characters get no paragraph, and paragraphs over 600 characters are trimmed.
  • list_comments pages by 100. Use page_token for the rest. The status filter applies to each page, so a page can come back short or empty while more remain. get_comments_summary reads every page.
  • One Google account per installation. Run the sign-in command again to switch.
  • Local stdio only. There is no remote or HTTP transport.
  • Tokens are stored unencrypted in token.json, with 0600 permissions.
  • drive.readonly covers all of Drive the account can see, not only Docs. The tools read Docs only, but that is what you grant on Google's sign-in screen and what the stored token allows.
  • What a tool returns reaches the assistant. Document text, comments, names and email addresses go to whichever assistant and model provider you use. Text written by other people arrives as is, so treat it as untrusted.

Roadmap

  • Optional write tools (reply, resolve) behind an explicit opt-in scope
  • Multiple accounts / profiles
  • Streamable HTTP transport for remote deployments

License

MIT

來源:README.md,提交 58d531c

工具

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

版本歷史

2
  1. v0.1.2最新Nov 7, 2026
  2. v0.1.1Nov 1, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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