Borrowing it
Nothing to install: this file belongs to brianmoney/mcp-gdrive-cf. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/brianmoney/mcp-gdrive-cf/master/.github/instructions/agent.instructions.mdgit clone --depth 1 https://github.com/brianmoney/mcp-gdrive-cfWrote 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.
[](https://agentmods.dev/instructions/brianmoney/mcp-gdrive-cf/agent)<a href="https://agentmods.dev/instructions/brianmoney/mcp-gdrive-cf/agent"><img src="https://agentmods.dev/badge/instructions/brianmoney/mcp-gdrive-cf/agent.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02661 | $0.02661 |
| Opus 5 | $0.01331 | $0.01331 |
| Sonnet 5 | $0.00532 | $0.00532 |
| Haiku 4.5 | $0.00266 | $0.00266 |
Grade B, and why
mcp-gdrive-cf agent.instructions.md scanned grade B with 1 finding 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 6d 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.
Sends data to an external URLmediumData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
const r = await fetch("https://oauth2.googleapis.com/token", { method: "POST", Copies of this mod
1 near-identical copy found in the catalogue:
- mcp-gdrive-cf implementation-plan.instructions.md — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Implementation Plan — Run mcp-gdrive as a Remote MCP Server on Cloudflare (via MCP proxy)
Objective
Adapt the functionality of isaacphi/mcp-gdrive to run as a remote MCP server on Cloudflare Workers, reachable by any MCP client through the Cloudflare remote MCP pattern (direct, or bridged via mcp-remote). This plan directly addresses the auth / dynamic registration concerns raised in issue #19 by exposing proper OAuth endpoints and remote transport.
- Architecture
Runtime: Cloudflare Worker exposing an MCP Server‑Sent Events (SSE) endpoint at /sse.
MCP tools (parity with mcp-gdrive):
gdrive_search → Drive files.list (query, pageToken, pageSize)
gdrive_read_file → Drive files.get?alt=media and files.export for Docs/Sheets/Slides
gsheets_read → Sheets spreadsheets.values.batchGet (or spreadsheets.get when needed)
gsheets_update_cell → Sheets spreadsheets.values.update (valueInputOption=USER_ENTERED)
Auth layers:
Client → MCP server: optional OAuth (server acts as OAuth provider for remote MCP clients). Endpoints: /authorize, /token, /register.
MCP server → Google APIs: OAuth 2.0 “Web application” flow. Tokens stored per user.
State: user token blobs in Workers KV (namespace KV_TOKENS).
Compatibility: Remote‑capable clients connect directly; local‑only clients (e.g., Claude Desktop) use mcp-remote:
{ "mcpServers": { "gdrive": { "command": "npx", "args": ["mcp-remote", "https://..workers.dev/sse"] } } }
- Prerequisites
Cloudflare account with Workers enabled; node LTS; wrangler CLI.
Google Cloud project with Drive API and Sheets API enabled; OAuth consent configured.
OAuth scopes: https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/spreadsheets.
- Scaffold the Remote MCP Server
Start from Cloudflare’s remote MCP template (authless)
npm create cloudflare@latest -- my-mcp-server
--template=cloudflare/ai/demos/remote-mcp-authless
cd my-mcp-server
npm start # local dev at http://localhost:8788/sse
npx wrangler@latest deploy
(Optional but recommended) Spin a second project using the GitHub OAuth template to see a working auth’d remote MCP, then port the auth pattern to your gdrive server:
npm create cloudflare@latest -- my-mcp-server-github-auth
--template=cloudflare/ai/demos/remote-mcp-github-oauth
This shows how the server wires OAuth + Dynamic Client Registration with SSE at /sse and auth endpoints (/authorize, /token, /register).
- Project Layout
/src index.ts # routes: /sse, /google/authorize, /google/callback; wires OAuth provider mcp.ts # tool registry + router (gdrive + gsheets) google.ts # Google REST helpers (Drive/Sheets) auth-google.ts # OAuth URL builder, token exchange, refresh storage.ts # KV helpers (get/set user tokens) wrangler.toml # KV bindings, vars, routes bindings.d.ts # Env types for KV + secrets README.md # quickstart + client config (mcp-remote)
- Google OAuth (server → Google)
Create OAuth Client: type Web application. Redirect URI: https://..workers.dev/google/callback (plus a localhost variant for dev if needed).
Server endpoints:
GET /google/authorize → redirect user to Google with Drive/Sheets scopes.
GET /google/callback → exchange code for {access_token, refresh_token, expiry}; persist to KV under the authenticated user.
Token storage: KV key user:: -> { google: { refresh_token, access_token, expiry, scopes } }.
Refresh: On 401 from Google APIs, auto‑refresh using the stored refresh_token and update KV.
For early iterations, you can skip client OAuth entirely and only run the Google OAuth flow the first time a user calls a tool; maintain a signed session cookie or URL parameter to correlate the token set with the client identity.
- Client Authentication (optional now, recommended soon)
Enable OAuth for clients connecting to your MCP server, so remote clients can discover /authorize, perform dynamic client registration at /register, and obtain access tokens from /token. Use the pattern from the Cloudflare OAuth template:
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.
- 6d ago First seen · 296 lines · 2,661 tokens per session scan B 4a87fdae3498
mcp-gdrive-cf agent.instructions.md is an instructions file published in the GitHub repository brianmoney/mcp-gdrive-cf (4 stars, last pushed 11mo ago), licensed MIT. It adds 2,661 tokens to every session, about $0.0133 per session on Opus 5. A static security scan graded it B with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
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.
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).
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).
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.
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.
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.