gdrive-mcp
Provides read-only search capabilities over Google Drive files and folders, including fuzzy name search, full-text content search, and folder listing.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gdrive-mcpsearch for budget spreadsheet 2024"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gdrive-mcp
A local, read-only MCP server for searching your Google Drive.
Tools exposed:
Tool | What it does |
| Fuzzy, typo-tolerant search over file/folder names (primary tool). |
| Full-text search inside file contents (Docs, PDFs, …). |
| List the direct children of a folder by ID ( |
It runs locally over stdio, authenticates once with your Google account via a
browser, and caches the token in ~/.gdrive-mcp/token.json. The only Google scope
requested is drive.readonly — it cannot modify or delete anything.
Fuzzy search note: Google Drive's API only supports substring matching, so this server pulls a candidate pool (substring matches + recent files) and re-ranks them client-side with Fuse.js for typo tolerance.
1. Provision the Google OAuth app (one time, ~5 min)
You need a Google Cloud project with the Drive API enabled and an OAuth client.
Go to https://console.cloud.google.com/ and create a new project (e.g. "gdrive-mcp"). Select it.
Enable the Drive API: APIs & Services → Library → search "Google Drive API" → Enable.
Configure the OAuth consent screen: APIs & Services → OAuth consent screen.
User type: External (unless you're on Google Workspace and want Internal).
Fill in app name, your support email, developer email. Save.
Scopes: you can skip adding scopes here (the app requests
drive.readonlyat runtime).Test users: add your own Google account (
lio.lunesu@defang.io). While the app is in "Testing" status this is required, and the token works indefinitely for test users.
Create credentials: APIs & Services → Credentials → Create Credentials → OAuth client ID.
Application type: Desktop app.
Name it, Create, then Download JSON.
Save that file as
~/.gdrive-mcp/credentials.json:mkdir -p ~/.gdrive-mcp mv ~/Downloads/client_secret_*.json ~/.gdrive-mcp/credentials.json(Or put it anywhere and set
GOOGLE_CREDENTIALS_PATHto its path.)
Related MCP server: Google Drive MCP Server
2. Build & log in
Node is provided by Nix + direnv — no system Node needed. From the project dir:
direnv allow # first time only; loads node from flake.nix
npm install
npm run login # builds, opens browser, caches token to ~/.gdrive-mcp/token.json(Without direnv you can run anything via nix develop -c <cmd>, e.g.
nix develop -c npm run login.)
A browser tab opens asking you to grant read-only Drive access. Approve it; the tab says "Authorized" and the token is saved. You only do this once (it auto-refreshes).
Google may warn the app is "unverified" since it's your own test app — click Advanced → Go to … (unsafe) to continue. That's expected for a personal app.
3. Register with your MCP client
Because Node comes from Nix/direnv (not your system PATH), launch the server with
direnv exec so it picks up the flake's Node regardless of how the MCP client's
own environment is set up.
Claude Code:
claude mcp add gdrive -- direnv exec /Users/llunesu/repos/gdrivemcp node /Users/llunesu/repos/gdrivemcp/dist/index.jsClaude Desktop / generic (claude_desktop_config.json or equivalent):
{
"mcpServers": {
"gdrive": {
"command": "direnv",
"args": [
"exec",
"/Users/llunesu/repos/gdrivemcp",
"node",
"/Users/llunesu/repos/gdrivemcp/dist/index.js"
]
}
}
}(If you have a system Node and don't care about pinning, "command": "node" with
just the script path also works.)
If you stored credentials somewhere other than ~/.gdrive-mcp/credentials.json, add
"env": { "GOOGLE_CREDENTIALS_PATH": "/path/to/credentials.json" }.
Development
npm run dev # tsc --watch
npm run build # one-off compile to dist/Notes & limits
Read-only by design — scope is
drive.readonly, no write methods are called.Searches My Drive for the signed-in user (not Shared Drives; flip
includeItemsFromAllDrives/corporainsrc/drive.tsif you need those).Fuzzy search fetches up to ~500 candidate files per query to rank locally; for very large Drives you may want to tighten the caps in
searchByName.Reading/exporting file content is intentionally not included — these tools find and list files only.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lionello/gdrive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server