drive-file-browser-mcp

drive-file-browser-mcp

MCP server that lets AI assistants browse, search, and read files from a Google Drive folder, supporting local stdio and remote HTTP deployments with tools like list_files, search_files, get_file_info, and read_file.

Category
Visit Server

README

Drive File Browser MCP

A Model Context Protocol (MCP) server that lets AI assistants — Claude Desktop, Claude Code, Cursor, opencode, or any MCP client — browse, search, and read files from a Google Drive folder.

Runs in two modes:

  • Local (stdio) — for desktop MCP clients
  • Remote (HTTP, Streamable) — deployed on Vercel: https://drive-file-browser-mcp.vercel.app/api/mcp

Tools Provided

Tool Description
list_files List files and subfolders in a Drive folder
search_files Search files by name (case-insensitive substring)
get_file_info Get metadata for a specific file (name, type, size, timestamps)
read_file Read file content — Google Docs export as markdown, Sheets as CSV, Slides as plain text; plain text files returned directly; binary files return a link

Remote Deployment (Vercel)

The server is live at:

https://drive-file-browser-mcp.vercel.app/api/mcp

It uses the stateless Streamable HTTP transport, so it works with any MCP client that supports remote HTTP servers. The endpoint is protected with a Bearer API key.

Connect a client

Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json):

{
  "mcpServers": {
    "drive-browser": {
      "type": "http",
      "url": "https://drive-file-browser-mcp.vercel.app/api/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_API_KEY>"
      }
    }
  }
}

Any HTTP client — send JSON-RPC over POST with headers Content-Type: application/json, Accept: application/json, text/event-stream, Authorization: Bearer <YOUR_API_KEY>:

curl -X POST https://drive-file-browser-mcp.vercel.app/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'

Health check (no auth): GET https://drive-file-browser-mcp.vercel.app/api/health

Deploy your own instance

  1. Fork/clone this repo, then:
npm install
npm i -g vercel
vercel login
vercel link --yes
# env vars:
echo "<your-api-key>" | vercel env add MCP_API_KEY production
echo "<your-drive-folder-id>" | vercel env add DRIVE_ROOT_FOLDER_ID production
echo "<service-account-json-contents>" | vercel env add GOOGLE_SERVICE_ACCOUNT_JSON production
vercel deploy --prod --yes
  1. Get a Google service account JSON (see below) and share your Drive folder with its client_email.

Environment Variables (Vercel)

Variable Description
GOOGLE_SERVICE_ACCOUNT_JSON The full service account JSON key (inline string) — required for Drive access
DRIVE_ROOT_FOLDER_ID Default folder ID the server browses
MCP_API_KEY Bearer token required on /api/mcp — leave unset to disable auth (not recommended)

Manage them in the Vercel dashboard: Project → Settings → Environment Variables.

Local Setup (stdio mode)

1. Create a Google service account

  1. Go to the Google Cloud Console and create (or select) a project.
  2. Enable the Google Drive API (APIs & Services → Library → search "Google Drive API" → Enable).
  3. Go to APIs & Services → Credentials → Create Credentials → Service account.
  4. Open the service account → Keys tab → Add key → Create new key → JSON. A .json key file downloads.
  5. Share the Drive folder with the service account's email (found in the JSON file as client_email, looks like xxx@xxx.iam.gserviceaccount.com) — right-click the folder in Drive → Share → enter that email → Viewer.

2. Install and build

git clone https://github.com/ashrafur02-sys/drive-file-browser-mcp.git
cd drive-file-browser-mcp
npm install
npm run build

3. Configure

Set environment variables (or copy .env.example to .env — note: .env files are NOT auto-loaded; set real env vars in your MCP client config, or point GOOGLE_SERVICE_ACCOUNT_JSON at a file path):

Variable Description
GOOGLE_SERVICE_ACCOUNT_JSON Inline service account JSON or a path to the JSON key file
DRIVE_ROOT_FOLDER_ID Default folder ID (or full URL) the server browses

Usage with MCP Clients

Add to your client's MCP configuration:

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "drive-browser": {
      "command": "node",
      "args": ["/absolute/path/to/drive-file-browser-mcp/dist/src/index.js"],
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_JSON": "/absolute/path/to/service-account.json",
        "DRIVE_ROOT_FOLDER_ID": "1TG4ssc_z0FgG2snDapoR_SRu3y16Wxm5"
      }
    }
  }
}

Claude Code / opencode:

{
  "mcpServers": {
    "drive-browser": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/drive-file-browser-mcp/dist/src/index.js"],
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_JSON": "/absolute/path/to/service-account.json",
        "DRIVE_ROOT_FOLDER_ID": "1TG4ssc_z0FgG2snDapoR_SRu3y16Wxm5"
      }
    }
  }
}

Once connected, ask your assistant things like:

  • "List the files in the Drive folder"
  • "Search for the press meet presentation"
  • "Read the corporate communication file"
  • "Get info about the file with ID ..."

Security Notes

  • The server uses read-only Drive scope (drive.readonly).
  • Never commit your service account key. It is gitignored by default.
  • Anyone you give the key file to gets read access to everything the service account can see — share the repo, not your key.

License

MIT

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