Google Drive MCP Server

Google Drive MCP Server

A read-only Model Context Protocol server that enables LLMs to search, list, and read files from Google Drive and shared drives. It automatically converts Google Workspace documents like Docs, Sheets, and Slides into Markdown, CSV, and plain text formats for easy processing.

Category
访问服务器

README

Google Drive MCP Server

A read-only Model Context Protocol server that gives LLM-powered tools (Claude Code CLI, Cursor, Claude Desktop, etc.) access to your Google Drive.

Search, list, and read files — including automatic export of Google Docs (as Markdown), Sheets (as CSV), and Slides (as plain text). Works with both personal drives and shared drives.

Quick start

1. Install

git clone https://github.com/wagnerlabs/gdrive-mcp.git
cd gdrive-mcp
npm install
npm run build

2. Set up Google Cloud credentials

  1. Go to Google Cloud Console
  2. Create a project (e.g. gdrive-mcp) or select an existing one
  3. Enable the Google Drive API
    • Navigate to APIs & Services > Library
    • Search for "Google Drive API" and click Enable
  4. Configure the OAuth consent screen
    • Navigate to APIs & Services > OAuth consent screen and click Get started
    • Enter an app name (e.g. gdrive-mcp), select your email as the support email, and click Next
    • Audience: select Internal (Workspace users) or External (personal Gmail), then click Next
    • Contact Information: enter your email and click Next
    • Finish: check the policy agreement box and click Create
  5. Add the Drive scope
    • In the left sidebar, go to Data Access
    • Click Add or remove scopes
    • Add: https://www.googleapis.com/auth/drive.readonly
    • Save
  6. Create OAuth credentials
    • In the left sidebar, go to Clients and click Create Client
    • Application type: Desktop app
    • Name: gdrive-mcp (this is just a console label to help you identify this client later)
    • Click Create
    • Download the JSON file and save it to the credentials/ folder at the root of this repo:
      gdrive-mcp/credentials/gcp-oauth.keys.json
      

3. Authenticate

node dist/index.js auth

A browser window will open for Google sign-in. After approval the token is saved to credentials/.gdrive-server-credentials.json.

4. Add to your MCP client

Claude Code CLI

claude mcp add --scope user wagnerlabs-gdrive -- node /absolute/path/to/gdrive-mcp/dist/index.js

The --scope user flag installs the server globally, so the MCP server will be available in Claude Code as wagnerlabs-gdrive from any directory you run Claude Code in.

To remove:

claude mcp remove wagnerlabs-gdrive

Cursor

Add to .cursor/mcp.json in any project (or globally):

{
  "mcpServers": {
    "gdrive": {
      "command": "node",
      "args": ["/absolute/path/to/gdrive-mcp/dist/index.js"]
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "gdrive": {
      "command": "node",
      "args": ["/absolute/path/to/gdrive-mcp/dist/index.js"]
    }
  }
}

Tools

All tools are read-only.

Tool Description
gdrive_search Search files using full-text search or Drive query syntax
gdrive_get_file Get detailed metadata for a file by ID
gdrive_read_file Read file content (Docs → Markdown, Sheets → CSV, Slides → plain text)
gdrive_list_files List files in a folder with sorting and pagination

File format handling

When reading files, Google Workspace documents are automatically exported:

Source format Exported as
Google Docs Markdown
Google Sheets CSV (first sheet)
Google Slides Plain text
Google Drawings PNG (metadata only)
Text files (.txt, .json, .js, etc.) Read directly as UTF-8
Binary files (images, PDFs, etc.) Returns metadata with browser link

Configuration

Credential paths can be customized via environment variables:

Variable Default Description
GDRIVE_OAUTH_PATH credentials/gcp-oauth.keys.json Path to OAuth client secret
GDRIVE_CREDENTIALS_PATH credentials/.gdrive-server-credentials.json Path to saved token

Updating

After pulling new changes, rebuild and the MCP server will pick up the update on next launch — no need to re-register it:

cd /path/to/gdrive-mcp
git pull
npm install
npm run build

Development

# Install dependencies
npm install

# Run in dev mode (uses tsx, no build step)
npm run dev

# Build
npm run build

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选