{
  "markdown": "# Google Drive MCP Server\n\n> **The Workspace power-editing MCP — formula-aware Sheets, full Slides editing, shared-drive audits the read-only Claude.ai connector deliberately won't ship.**\n>\n> 98 tools across Drive, Docs, Sheets, Slides, GWS admin, and aggregations. Service Account + Domain-Wide Delegation for org-scale automation. GWS-aware capability detection — features auto-unlock for Workspace accounts.\n\n[![npm](https://img.shields.io/npm/v/@us-all/google-drive-mcp)](https://www.npmjs.com/package/@us-all/google-drive-mcp)\n[![downloads](https://img.shields.io/npm/dm/@us-all/google-drive-mcp)](https://www.npmjs.com/package/@us-all/google-drive-mcp)\n[![tools](https://img.shields.io/badge/tools-98-blue)](#tools)\n[![@us-all standard](https://img.shields.io/badge/built%20to-%40us--all%20MCP%20standard-blue)](https://github.com/us-all/mcp-toolkit/blob/main/STANDARD.md)\n[![Glama MCP server](https://glama.ai/mcp/servers/us-all/google-drive-mcp-server/badges/score.svg)](https://glama.ai/mcp/servers/us-all/google-drive-mcp-server)\n\n## What it does that others don't\n\n- **Deep Sheets editing** — charts, conditional formats, protected ranges, named ranges, data validation, borders, merge, sort, find/replace, formulas, A1-quote-doubling for CJK tab names. The 1st-party Workspace connector reads Sheets as CSV — formulas don't survive.\n- **Full Slides editing** — presentations, slides, shapes, tables, images, formatting. Not in the connector at all.\n- **Shared-Drive admin tooling** — `list-shared-drives`, `get-shared-drive`, `create-shared-drive`, list/share/remove permissions, file activity, labels, approvals. Workspace governance surface the connector deliberately doesn't expose.\n- **3 auth modes** — OAuth2 (personal or GWS), Service Account + Domain-Wide Delegation (org-scale), Application Default Credentials (auto-detected).\n- **Aggregation tools** — `audit-shared-drive-permissions` (single Shared-Drive audit) + `audit-external-shares` (cross-drive / My-Drive audit with top external-domain concentration view), `summarize-spreadsheet` (metadata + per-tab sample + named ranges), `summarize-doc` (file + content + permissions + comments).\n- **MCP Prompts** (3) — `cleanup-shared-with-me`, `analyze-doc-structure`, `bulk-format-spreadsheet`.\n- **GWS-aware** — `capabilities.ts` detects account type on startup; GWS-only tools return clear errors for personal accounts instead of mysterious 403s.\n\n## Try this — 5 prompts\n\nConnect the server to Claude Desktop or Claude Code, then paste any of these:\n\n1. **Shared-drive permission audit** — *\"Audit external shares across all my Shared Drives. List people outside `us-all.co.kr` who have access to anything. Group by drive, sort by access level.\"*\n2. **Bulk conditional formatting** — *\"Apply this conditional format to column `amount` across every `sales-*` spreadsheet in my drive: red if <0, yellow if 0–100, green if >100.\"*\n3. **Slides from Doc outline** — *\"Convert this Google Doc's outline into a 12-slide presentation: title slide, then 1 slide per H2 with H3 bullet points, end with a Q&A slide. Use the company template.\"*\n4. **Doc structure analysis** — *\"Analyze this Doc's structure: heading hierarchy, internal vs external link health, image alt-text coverage. Suggest 3 concrete improvements.\"*\n5. **Cleanup shared-with-me** — *\"Find files shared with me more than 180 days ago that I never opened. List them with sharer, last modified, and a guess at whether to keep.\"*\n\n## When to use this vs alternatives\n\n| | Anthropic 1st-party Workspace connector | taylorwilsdon/google_workspace_mcp | xing5/mcp-google-sheets | `@us-all/google-drive-mcp` (this) |\n|--|---|---|---|---|\n| Stars / availability | n/a (Claude.ai built-in, Feb 2026) | 2.3K★ | 836★ | — |\n| Scope | Drive read + Sheets-as-CSV read | Gmail+Calendar+Drive+Docs+Sheets+Slides+Forms+Chat+Tasks+Contacts+Apps Script | Sheets only | Drive + Docs + Sheets + Slides + GWS admin |\n| Sheets formula editing | ❌ (CSV round-trip loses formulas) | ✅ basic | ✅ specialist | ✅ deep (charts/conditional/named ranges) |\n| Slides editing | ❌ | ✅ | ❌ | ✅ deep |\n| Shared-drive admin | partial | ✅ | ❌ | ✅ deep |\n| Folder operations | ❌ | ✅ | ❌ | ✅ |\n| Aggregation tools | ❌ | ❌ | ❌ | ✅ `summarize-spreadsheet`, `summarize-doc`, `audit-external-shares` |\n| MCP Prompts | ❌ | ❌ | ❌ | ✅ 4 |\n| Auth modes | managed OAuth | OAuth + SA + stateless | SA / OAuth / ADC | OAuth + SA + DWD + ADC |\n| Transport | n/a (Claude.ai-only) | stdio + HTTP | stdio | stdio |\n\n**Use the 1st-party connector** for zero-config Drive read flows in Claude.ai. **Use taylorwilsdon** if you need the full Workspace surface (Gmail / Calendar / Forms etc.). **Use this server** for Drive + Docs + Sheets + Slides power-editing, shared-drive governance, and bulk operations the connector can't do.\n\n## Install\n\n### Claude Desktop\n\n```json\n{\n  \"mcpServers\": {\n    \"google-drive\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@us-all/google-drive-mcp\"],\n      \"env\": {\n        \"GOOGLE_CLIENT_ID\": \"<your-client-id>\",\n        \"GOOGLE_CLIENT_SECRET\": \"<your-client-secret>\",\n        \"GOOGLE_REFRESH_TOKEN\": \"<your-refresh-token>\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add google-drive -s user -- npx -y @us-all/google-drive-mcp\n```\n\n(Set env vars separately or in `.mcp.json`.)\n\n### Docker\n\n```bash\ndocker run --rm -i --env-file .env ghcr.io/us-all/google-drive-mcp-server\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/us-all/google-drive-mcp-server.git\ncd google-drive-mcp-server && pnpm install && pnpm build\nnode dist/index.js\n```\n\n## Auth setup\n\n### OAuth2 (personal or GWS)\n\n1. [Google Cloud Console](https://console.cloud.google.com/) → create project\n2. Enable **Drive API**, **Docs API**, **Sheets API**, **Slides API**, **Drive Activity API**, **Drive Labels API**\n3. Create OAuth2 credentials (Desktop App)\n4. Get a refresh token (OAuth2 playground or your own flow)\n5. Set `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, `GOOGLE_REFRESH_TOKEN`\n\n### Service Account + Domain-Wide Delegation (org-scale)\n\n1. Create a Service Account in Google Cloud Console\n2. Download the JSON key\n3. Workspace Admin Console → **Security → API Controls → Domain-Wide Delegation** → add the SA's Client ID + grant required scopes\n4. Set `GOOGLE_SERVICE_ACCOUNT_KEY_PATH` and `GOOGLE_IMPERSONATE_USER`\n\n### Application Default Credentials (zero-config)\n\n`gcloud auth application-default login --client-id-file=client_secret.json --scopes=...` — auto-detected on startup. Windows ADC paths (`%APPDATA%\\gcloud\\`) supported.\n\n## Configuration\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `GOOGLE_CLIENT_ID` | OAuth2 | — | OAuth2 Client ID |\n| `GOOGLE_CLIENT_SECRET` | OAuth2 | — | OAuth2 Client Secret |\n| `GOOGLE_REFRESH_TOKEN` | OAuth2 | — | OAuth2 Refresh Token |\n| `GOOGLE_SERVICE_ACCOUNT_KEY_PATH` | SA | — | Path to service-account JSON key |\n| `GOOGLE_IMPERSONATE_USER` | ❌ | — | GWS user email to impersonate (SA only) |\n| `GOOGLE_DRIVE_ALLOW_WRITE` | ❌ | `false` | Set `true` to enable mutations |\n| `GOOGLE_DRIVE_SCOPES` | ❌ | read-only Drive Activity + Docs scopes (or broader Drive/Docs scopes if write enabled) | Comma-sep OAuth scopes override |\n| `GD_TOOLS` | ❌ | — | Comma-sep allowlist of categories. Biggest token saver. |\n| `GD_DISABLE` | ❌ | — | Comma-sep denylist. Ignored when `GD_TOOLS` is set. |\n| `MCP_TRANSPORT` | ❌ | `stdio` | `http` to enable Streamable HTTP transport |\n| `MCP_HTTP_TOKEN` | conditional | — | Bearer token. Required when `MCP_TRANSPORT=http` |\n| `MCP_HTTP_PORT` | ❌ | `3000` | HTTP listen port |\n| `MCP_HTTP_HOST` | ❌ | `127.0.0.1` | HTTP bind host (DNS rebinding protection auto-enabled for localhost) |\n| `MCP_HTTP_SKIP_AUTH` | ❌ | `false` | Skip Bearer auth — e.g. behind a reverse proxy that handles it |\n\n**Categories** (7): `drive`, `sheets`, `docs`, `slides`, `shared-drives`, `labels`, `approvals`. Plus always-on `meta`.\n\nWhen `MCP_TRANSPORT=http`: `POST /mcp` (Bearer-auth JSON-RPC) + `GET /health` (public liveness).\n\n### Token efficiency\n\n| Scenario | Tools | Schema tokens | vs default |\n|----------|------:|--------------:|-----------:|\n| default (all categories) | 96 | 18,400 | — |\n| typical (`GD_TOOLS=drive,docs,sheets`) | 68 | 13,700 | −25% |\n| narrow (`GD_TOOLS=drive`) | 25 | **4,000** | **−78%** |\n\n`extractFields` projection on `list-files`/`get-file`/`sheets-get-spreadsheet`/`docs-get-document` (with `tabsCount`, `rowCount`, `columnCount`, `locale`, `timeZone` defaults). `list-files` slim default trims ~80% (drops `capabilities` 40-bool object + `contentRestrictions`).\n\n## GWS detection\n\n`capabilities.ts` detects account type at startup via `about.get()` + domain check:\n\n| Feature | Personal | GWS Standard+ | GWS Enterprise |\n|---|---|---|---|\n| File CRUD / Search / Export | ✅ | ✅ | ✅ |\n| Docs / Sheets / Slides editing | ✅ | ✅ | ✅ |\n| Comments & Revisions | ✅ | ✅ | ✅ |\n| Drive Activity | ✅ | ✅ | ✅ |\n| **Shared Drives** | — | ✅ | ✅ |\n| **Labels (classification)** | — | ✅ | ✅ |\n| **Approvals** | — | ✅ | ✅ |\n| **Domain-Wide Delegation** | — | ✅ | ✅ |\n\nGWS-only tools throw `GWSFeatureError` with a clear message for personal accounts — no mysterious 403s.\n\n## MCP Prompts (4)\n\nWorkflow templates available via MCP `prompts/list`:\n\n- `audit-shared-drive-permissions` — fleet-wide external-share audit; flag access-level outliers.\n- `cleanup-shared-with-me` — find untouched stale shares + suggest cleanup.\n- `analyze-doc-structure` — heading hierarchy + link health + alt-text coverage.\n- `bulk-format-spreadsheet` — apply consistent format across many sheets/tabs.\n\n## MCP Resources\n\nURI-based read-only access:\n\n- `gdrive://file/{fileId}`\n- `gdrive://spreadsheet/{spreadsheetId}`\n- `gdrive://document/{documentId}`\n- `gdrive://presentation/{presentationId}`\n- `gdrive://folder/{folderId}`\n- `gdrive://shared-drive/{driveId}` (GWS-gated)\n- `gdrive://about/me`\n\n## Tools (98)\n\n7 categories. Use `search-tools` to discover at runtime; full list collapsed below.\n\n| Category | Tools |\n|----------|------:|\n| Sheets (data / structure / formatting / advanced) | 30 |\n| Drive (files / search / folders / permissions / export / comments / revisions / activity) | 24 |\n| Slides (presentation / slide mgmt / content / formatting) | 20 |\n| Docs (document / editing / formatting / elements) | 13 |\n| GWS-only (shared drives / labels / approvals / audit) | 9 |\n| Aggregations (`summarize-spreadsheet`, `summarize-doc`, `audit-external-shares`) | 3 |\n| Meta (`search-tools`) | 1 |\n\n<details>\n<summary>Full tool list</summary>\n\n### Drive (24)\n`get-about`, `list-files`, `get-file`, `read-file`, `create-file`, `update-file`, `copy-file`, `delete-file`, `search-files`, `create-folder`, `move-file`, `get-folder-tree`, `list-permissions`, `share-file`, `remove-permission`, `export-file`, `get-download-link`, `list-comments`, `get-comment`, `create-comment`, `resolve-comment`, `list-revisions`, `get-revision`, `get-activity`\n\n### Google Docs (13)\n**Document**: `docs-get-document`, `docs-create-document`, `docs-get-content`, `docs-list-tabs`\n**Editing**: `docs-insert-text`, `docs-delete-range`, `docs-replace-text`, `docs-batch-update`\n**Formatting**: `docs-format-text`, `docs-format-paragraph`\n**Elements**: `docs-insert-table`, `docs-insert-image`, `docs-insert-page-break`\n\n### Google Sheets (30)\n**Data**: `sheets-get-spreadsheet`, `sheets-get-values`, `sheets-batch-get-values`, `sheets-update-values`, `sheets-batch-update-values`, `sheets-append-values`, `sheets-clear-values`, `sheets-batch-clear-values`, `sheets-create-spreadsheet`, `sheets-manage-sheets`\n**Structure**: `sheets-insert-dimension`, `sheets-delete-dimension`, `sheets-duplicate-sheet`, `sheets-copy-sheet-to`, `sheets-copy-paste`, `sheets-sort-range`, `sheets-find-replace`\n**Formatting**: `sheets-format-cells`, `sheets-update-borders`, `sheets-merge-cells`, `sheets-unmerge-cells`, `sheets-auto-resize`, `sheets-resize-dimensions`\n**Advanced**: `sheets-set-data-validation`, `sheets-add-conditional-format`, `sheets-add-chart`, `sheets-delete-chart`, `sheets-add-protected-range`, `sheets-delete-protected-range`, `sheets-manage-named-range`\n\n### Google Slides (20)\n**Presentation**: `slides-get-presentation`, `slides-create-presentation`, `slides-duplicate-presentation`\n**Slide management**: `slides-get-slide`, `slides-add-slide`, `slides-delete-slide`, `slides-move-slide`, `slides-duplicate-slide`\n**Content**: `slides-insert-text`, `slides-replace-text`, `slides-insert-text-box`, `slides-insert-image`, `slides-insert-table`, `slides-update-table-cell`, `slides-insert-shape`\n**Formatting**: `slides-format-text`, `slides-format-shape`, `slides-resize-element`, `slides-set-slide-background`, `slides-batch-update`\n\n### GWS-only (9)\n`list-shared-drives`, `get-shared-drive`, `create-shared-drive`, `audit-shared-drive-permissions`, `list-file-labels`, `apply-label`, `remove-label`, `list-approvals`, `get-approval`\n\n### Aggregations\n`summarize-spreadsheet`, `summarize-doc`, `audit-external-shares`\n\n`audit-external-shares` complements the GWS-only `audit-shared-drive-permissions`: it runs across all corpora the caller can see (or just My Drive on personal accounts) and adds a top-external-domains concentration view.\n\n### Meta\n`search-tools` — query other tools by keyword; always enabled.\n\n</details>\n\n## Architecture\n\n```\nClaude → MCP stdio → src/index.ts\n                      ├── config.ts (OAuth2 / SA / ADC)\n                      ├── capabilities.ts (Personal vs GWS detect)\n                      ├── client.ts (Google API auth)\n                      └── tools/{files,search,folders,permissions,export,comments,revisions,\n                                  about,activity,docs,sheets,slides,shared-drives,labels,approvals,\n                                  aggregations}.ts\n                                       ↓\n                              Drive API v3 / Docs API v1 / Sheets API v4 /\n                              Slides API v1 / Drive Activity API v2 / Drive Labels API v2\n```\n\nBuilt on [`@us-all/mcp-toolkit`](https://github.com/us-all/mcp-toolkit):\n- `extractFields` — token-efficient response projections\n- `aggregate(fetchers, caveats)` — fan-out helper for `summarize-doc`\n- `createWrapToolHandler` — Google query-string `key=...` redaction + `WriteBlockedError` / `GWSFeatureError` passthrough + Google API error extraction\n- `search-tools` meta-tool\n\n`supportsAllDrives: true` is passed to every Drive API call so Shared Drives just work.\n\n## Tech stack\n\nNode.js 22+ • TypeScript strict ESM • pnpm • `@modelcontextprotocol/sdk` • `googleapis` (Drive v3 / Docs v1 / Sheets v4 / Slides v1 / Activity v2 / Labels v2) • zod • dotenv • vitest.\n\n## Limitations\n\n- **Approvals API** — `googleapis` SDK has no typed bindings; uses raw `fetch` with auth header extraction.\n- **`search-files`** — auto-wraps plain text in `fullText contains '...'`; pass Drive query syntax directly for advanced searches.\n\n## License\n\n[MIT](./LICENSE)\n",
  "bytes": 14963,
  "sha": "aa96adcd07108c49545a17e8464f47b2020d1740d31ecd265e24e6ed9aec4879",
  "repo_slug": "us-all/google-drive-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_us_all_google_drive_4e6aa67b/readme"
}