google-drive-mcp-server: Instructions file for Claude Code

CLAUDE.md

google-drive-mcp-server CLAUDE.md is an instructions file for Claude Code from us-all/google-drive-mcp-server. It costs 3,568 tokens per session, scanned A, original, MIT.

Project instructions for a TypeScript server that connects an AI assistant to Google Drive and other Google Workspace APIs through the Model Context Protocol. They describe its tools, build commands, tests, and handling of personal versus business Workspace accounts.

In plain words
What is it for?
Use them when developing, testing, or extending the Google Drive MCP server. They cover Node.js and pnpm commands, Zod input schemas, Google API calls, and tool registration.
Why use it?
They give contributors a shared set of technical rules for building and running the server. This reduces inconsistent API calls, validation, registration, and account-capability handling.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is us-all/google-drive-mcp-server's own configuration. It tells Claude Code how to work on google-drive-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything google-drive-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to us-all/google-drive-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/us-all/google-drive-mcp-server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/us-all/google-drive-mcp-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for google-drive-mcp-server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/us-all/google-drive-mcp-server/claude-md.svg)](https://agentmods.dev/instructions/us-all/google-drive-mcp-server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/us-all/google-drive-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/us-all/google-drive-mcp-server/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,568 This file is loaded in full into every session.
When invoked 3,568 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03568 $0.03568
Opus 5 $0.01784 $0.01784
Sonnet 5 $0.00714 $0.00714
Haiku 4.5 $0.00357 $0.00357

Measured 7d ago against content hash 6b99b325e5b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

google-drive-mcp-server CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Google Drive MCP Server

Tech Stack

  • Node.js 18+, pnpm, TypeScript (strict, ESM)
  • @modelcontextprotocol/sdk — MCP protocol
  • googleapis — Google Drive API v3, Drive Activity API v2, Drive Labels API v2, Sheets API v4, Slides API v1, Docs API v1
  • zod — input validation
  • dotenv — env loading
  • vitest — testing

Build & Run

pnpm install
pnpm run build
pnpm start              # or: node dist/index.js
pnpm run dev            # watch mode
pnpm run test           # unit tests
pnpm run smoke          # live API smoke test

Architecture

Claude → MCP (stdio) → index.ts → tools/* → googleapis → Google Drive API
                              ↑
                    capabilities.ts (personal vs GWS detection)

Tool Pattern

Each tool file exports: schema (Zod) + handler (async function). Registration in index.ts: server.tool(name, description, schema.shape, wrapToolHandler(handler)).

Every schema field must have .describe(). Use z.coerce.number() for numbers. Always pass supportsAllDrives: true to Drive API calls.

GWS Awareness

  • capabilities.ts detects account type on startup via about.get() + domain check
  • GWS-only tools call requireGWS(caps, "Feature Name") which throws GWSFeatureError for personal accounts
  • Write tools call assertWriteAllowed() which checks GOOGLE_DRIVE_ALLOW_WRITE=true

Auth Methods

  • OAuth2: GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET + GOOGLE_REFRESH_TOKEN
  • Service Account: GOOGLE_SERVICE_ACCOUNT_KEY_PATH + optional GOOGLE_IMPERSONATE_USER
  • ADC: gcloud auth application-default login --client-id-file=client_secret.json --scopes=... (auto-detected)

Tool Categories (95 tools)

File Tools
files.ts list-files, get-file, read-file, create-file, update-file, copy-file, delete-file
search.ts search-files
folders.ts create-folder, move-file, get-folder-tree
permissions.ts list-permissions, share-file, remove-permission
export.ts export-file, get-download-link
comments.ts list-comments, get-comment, create-comment, resolve-comment
revisions.ts list-revisions, get-revision
about.ts get-about
activity.ts get-activity
sheets.ts 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
Structure: sheets-insert-dimension, sheets-delete-dimension, sheets-duplicate-sheet, sheets-copy-sheet-to, sheets-copy-paste, sheets-sort-range, sheets-find-replace
Formatting: sheets-format-cells, sheets-update-borders, sheets-merge-cells, sheets-unmerge-cells, sheets-auto-resize, sheets-resize-dimensions
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
docs.ts Document: docs-get-document, docs-create-document, docs-get-content, docs-list-tabs
Editing: docs-insert-text, docs-delete-range, docs-replace-text, docs-batch-update
Formatting: docs-format-text, docs-format-paragraph
Elements: docs-insert-table, docs-insert-image, docs-insert-page-break
shared-drives.ts list-shared-drives, get-shared-drive, create-shared-drive (GWS)
labels.ts list-file-labels, apply-label, remove-label (GWS)
approvals.ts list-approvals, get-approval (GWS)
slides.ts Presentation: slides-get-presentation, slides-create-presentation, slides-duplicate-presentation
Slide Management: slides-get-slide, slides-add-slide, slides-delete-slide, slides-move-slide, slides-duplicate-slide
Content: slides-insert-text, slides-replace-text, slides-insert-text-box, slides-insert-image, slides-insert-table, slides-update-table-cell, slides-insert-shape
Formatting: slides-format-text, slides-format-shape, slides-resize-element, slides-set-slide-background, slides-batch-update

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 118 lines · 3,568 tokens per session scan A 6b99b325e5b4

Subscribe to this mod's changes

google-drive-mcp-server CLAUDE.md is an instructions file published in the GitHub repository us-all/google-drive-mcp-server (0 stars, last pushed 1mo ago), licensed MIT. It adds 3,568 tokens to every session, about $0.0178 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens