mcp-gdrive-cf: Instructions file for GitHub Copilot

.github/instructions/agent.instructions.md

mcp-gdrive-cf agent.instructions.md is an instructions file for GitHub Copilot from brianmoney/mcp-gdrive-cf. It costs 2,661 tokens per session, scanned B, original, MIT.

A project instruction file for adapting mcp-gdrive into a remote MCP server on Cloudflare Workers. It describes access to Google Drive and Sheets, including search, reading files, and updating cells.

In plain words
What is it for?
Planning a Cloudflare-hosted Google Drive and Sheets MCP service with remote connections, OAuth, and Server-Sent Events.
Why use it?
It records the planned architecture and authentication flows so implementation follows the project’s intended design.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is brianmoney/mcp-gdrive-cf's own configuration. It tells GitHub Copilot how to work on mcp-gdrive-cf 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 mcp-gdrive-cf configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/brianmoney/mcp-gdrive-cf/master/.github/instructions/agent.instructions.md
Clone the repo
git clone --depth 1 https://github.com/brianmoney/mcp-gdrive-cf

Made for: GitHub Copilot.

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 mcp-gdrive-cf agent.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/brianmoney/mcp-gdrive-cf/agent.svg)](https://agentmods.dev/instructions/brianmoney/mcp-gdrive-cf/agent)
Your own site
<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>
Per session 2,661 This file is loaded in full into every session.
When invoked 2,661 The same file — it is already loaded in full.
Security scan B 1 finding. 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.02661 $0.02661
Opus 5 $0.01331 $0.01331
Sonnet 5 $0.00532 $0.00532
Haiku 4.5 $0.00266 $0.00266

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

Security

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",
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.github/instructions/agent.instructions.md · 296 lines

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.

  1. 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"] } } }

  1. 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.

  1. 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).

  1. 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)

  1. 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.

  1. 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:

Read the full file on GitHub · 296 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. 6d ago First seen · 296 lines · 2,661 tokens per session scan B 4a87fdae3498

Subscribe to this mod's changes

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.

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

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

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

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