A minimal MCP server and CLI for reading comments on Google Drive files (Docs, Sheets, Slides).
Project description
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
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.
- Sign in to Google Cloud Console with the account whose Drive comments you want to read.
- Create a project (or pick an existing one).
- Enable the Drive API: console.cloud.google.com/apis/library/drive.googleapis.com.
- 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.readonlyis a restricted scope. - Personal Gmail users: User type = External, and add your own address under "Test users".
- Google Workspace users: User type = Internal. No app verification is needed even though
- APIs & Services → Credentials → + Create credentials → OAuth client ID
- Application type: Desktop app
- Download the JSON.
- Run setup:
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:
google-drive-comments-mcp status
google-drive-comments-mcp comments "https://docs.google.com/document/d/YOUR_DOC_ID/edit"
Use it from Claude Code
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):
{
"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
# Find a doc
google-drive-comments-mcp search "Q3 strategy"
# Read all comments (open + resolved) on a doc by URL or ID
google-drive-comments-mcp comments "https://docs.google.com/document/d/abc123/edit"
# Only unresolved comments
google-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.
[
{
"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.
{
"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
| Variable | Default | What |
|---|---|---|
DRIVE_MCP_CREDENTIALS |
~/.config/google-drive-comments-mcp/credentials.json |
OAuth client secret JSON |
DRIVE_MCP_TOKEN |
~/.config/google-drive-comments-mcp/token.json |
Cached refresh token |
DRIVE_MCP_SCOPES |
https://www.googleapis.com/auth/drive.readonly |
OAuth scopes (comma-separated) |
XDG_CONFIG_HOME |
~/.config |
Standard 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:
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.readonlygrants 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 written0600). - 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(mode0600). 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
- docs/setup-google-oauth.md — full OAuth walkthrough + common errors
- docs/claude-code.md · docs/claude-desktop.md · docs/other-clients.md — per-client setup (Cursor, Cline, Continue, …)
- examples/ — runnable snippets
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
- google-drive-comments-mcp — read comment threads on Docs/Sheets/Slides (this repo)
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_drive_comments_mcp-0.1.0.tar.gz.
File metadata
- Download URL: google_drive_comments_mcp-0.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8f8c58ab60fd39da77a62fac0899ad45c8d445c6aee6e8044c3a9529cee81a2
|
|
| MD5 |
2257fdd2f1686742d3eff4a8f412d663
|
|
| BLAKE2b-256 |
419f94a3ff1375d8f21e9841bb2ad5d29750e0c4f2a16cc07a39a97fd3610da3
|
File details
Details for the file google_drive_comments_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: google_drive_comments_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
080707970fa58579792c1a4bd8340df0fee081bff43b3c94c027a9824ff8bef2
|
|
| MD5 |
f288ad64704c6e1801ce14d9f910e31f
|
|
| BLAKE2b-256 |
e643ccfc263e87abac7a0a55023e23bfff60fce41302bcd1e64f3964c4627559
|