gdrive-mcp

gdrive-mcp

A local, read-only MCP server for searching your Google Drive.

Category
Visit Server

README

gdrive-mcp

A local, read-only MCP server for searching your Google Drive.

Tools exposed:

Tool What it does
search_drive_by_name Fuzzy, typo-tolerant search over file/folder names (primary tool).
search_drive_by_content Full-text search inside file contents (Docs, PDFs, …).
list_drive_folder List the direct children of a folder by ID (root = My Drive).

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.

  1. Go to https://console.cloud.google.com/ and create a new project (e.g. "gdrive-mcp"). Select it.
  2. Enable the Drive API: APIs & Services → Library → search "Google Drive API" → Enable.
  3. 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.readonly at 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.
  4. Create credentials: APIs & Services → Credentials → Create CredentialsOAuth client ID.
    • Application type: Desktop app.
    • Name it, Create, then Download JSON.
  5. 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_PATH to its path.)

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

Claude 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/corpora in src/drive.ts if 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured