Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/brianmoney/mcp-gdrive-cf/implementation-plangit 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/implementation-plan)<a href="https://agentmods.dev/instructions/brianmoney/mcp-gdrive-cf/implementation-plan"><img src="https://agentmods.dev/badge/instructions/brianmoney/mcp-gdrive-cf/implementation-plan.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 implementation-plan.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 5d 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", This is a copy
100% identical to mcp-gdrive-cf agent.instructions.md — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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.
- 5d ago First seen · 296 lines · 2,661 tokens per session scan B 4a87fdae3498
mcp-gdrive-cf implementation-plan.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). It is 100% identical to mcp-gdrive-cf agent.instructions.md, differing in 0 lines, and is treated as a copy.
Other instructions, from other repositories
awsmux AGENTS.md
Instructions for 0hardik1/awsmux, covering agents.md, what awsmux is, build, test, verify, layout and the safety model — invariants you must not weaken.
plan-forge naming.instructions.md
Azure naming conventions — Microsoft CAF abbreviations, constraints, uniqueness, tagging.
agent-skills fortrabbit.instructions.md
Instructions for fortrabbit/agent-skills, covering fortrabbit — github copilot instructions, what fortrabbit is, configuration lookup, available operations and mcp server (optional).
cron-mcp CLAUDE.md
Claude Code instructions for Shreyas-Profile/cron-mcp, covering deploying cron-mcp to hetzner + regiq.in, server (shared with the rest of the globalion mcp fleet), deploy a new version, first-time subdomain wiring (cron.regiq.in) and env vars.
Railway-mcp CLAUDE.md
Claude Code instructions for Travis-Gilbert/Railway-mcp, covering railway mcp server, quick reference, file map, architecture and key patterns.
equinix-fabric-mcp CLAUDE.md
Claude Code instructions for sliuuu/equinix-fabric-mcp, covering claude.md — equinix-fabric-mcp, canonical files, auth, add equinixclientid and equinixclientsecret and running.