
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.
概览
只读的 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 提供。首次需在浏览器中登录,令牌保存在本地;另有可选变量指定凭据路径、令牌路径和配置目录。
安装
在 SourceWeft 中
- 打开 控制台中的 Google Docs Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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.
- Read-only by design. It only requests the
documents.readonlyanddrive.readonlyscopes. There is no tool that creates, edits, resolves or deletes anything, and every tool is advertised withreadOnlyHint: 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
Example: list_comments
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
- Open the Google Cloud Console and create or select a project.
- APIs & Services → Library: enable Google Drive API and Google Docs API.
- 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.
- APIs & Services → Credentials → Create credentials → OAuth client ID, application type Desktop app.
- 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.readonlyis 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:
2. Sign in with Google
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):
Claude Code:
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
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
How it works
- Comments come from the Drive API (
comments.list/comments.get) with every field requested explicitly, so nothing is silently dropped: quoted text, replies,resolve/reopenactions, 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
isErrorresults with an actionable message instead of breaking the session. Logs go tostderr;stdoutis reserved for the protocol.
Development
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.jsonandtoken.jsonare 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_documentas 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_documentreturns 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_commentspages by 100. Usepage_tokenfor the rest. Thestatusfilter applies to each page, so a page can come back short or empty while more remain.get_comments_summaryreads 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, with0600permissions. drive.readonlycovers 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
来源:README.md,提交 58d531c
工具
0版本历史
2- v0.1.2最新Nov 7, 2026
- v0.1.1Nov 1, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分