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
访问服务器

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选