Google Drive server
Google Drive 服务器
此 MCP 服务器与 Google Drive 集成,支持列出、读取和搜索文件,以及读写 Google Sheets。
本项目包含由 Anthropic, PBC 最初开发的代码,根据 MIT 许可证授权,代码来自此仓库。
组件
工具
gdrive_search
描述:在 Google Drive 中搜索文件。
输入:
query(字符串):搜索查询。pageToken(字符串,可选):下一页结果的令牌。pageSize(数字,可选):每页结果数(最大 100)。
输出:返回匹配文件的文件名和 MIME 类型。
gdrive_read_file
描述:读取 Google Drive 中文件的内容。
输入:
fileId(字符串):要读取的文件 ID。
输出:返回指定文件的内容。
gsheets_read
描述:从 Google 电子表格中读取数据,提供灵活的范围和格式选项。
输入:
spreadsheetId(字符串):要读取的电子表格 ID。ranges(字符串数组,可选):可选的 A1 表示法范围数组(例如['Sheet1!A1:B10'])。如果未提供,则读取整个工作表。sheetId(数字,可选):要读取的特定工作表 ID。如果未与范围一起提供,则读取第一个工作表。
输出:返回电子表格中的指定数据。
gsheets_update_cell
描述:更新 Google 电子表格中的单元格值。
输入:
fileId(字符串):电子表格的 ID。range(字符串):A1 表示法的单元格范围(例如'Sheet1!A1')。value(字符串):新的单元格值。
输出:确认指定单元格中的更新值。
资源
服务器提供对 Google Drive 文件的访问:
文件(
gdrive:///<file_id>)支持所有文件类型
Google Workspace 文件会自动导出:
文档 → Markdown
表格 → CSV
演示文稿 → 纯文本
绘图 → PNG
其他文件以其原始格式提供
Related MCP server: Google Drive server
开始使用
配置 OAuth 同意屏幕("内部"适用于测试)
添加 OAuth 范围
https://www.googleapis.com/auth/drive.readonly、https://www.googleapis.com/auth/spreadsheets为了允许与表格和文档交互,您还需要在已启用的 API 和服务部分中启用 Google Sheets API 和 Google Docs API。
创建 OAuth 客户端 ID,应用程序类型为"桌面应用"
下载客户端 OAuth 密钥的 JSON 文件
将密钥文件重命名为
gcp-oauth.keys.json,并放入您通过GDRIVE_CREDS_DIR指定的路径中(例如/Users/username/.config/mcp-gdrive)记下您的 OAuth 客户端 ID 和客户端密钥。它们必须作为环境变量与您的配置目录一起提供。
您还需要在项目中设置一个 .env 文件,包含以下字段。您可以在 Google Cloud 控制台的凭据部分找到客户端 ID 和客户端密钥。
GDRIVE_CREDS_DIR=/path/to/config/directory
CLIENT_ID=<CLIENT_ID>
CLIENT_SECRET=<CLIENT_SECRET>确保使用 npm run build 或 npm run watch 构建服务器。
身份验证
接下来,您需要运行 node ./dist/index.js 来触发身份验证步骤。
系统会提示您通过浏览器进行身份验证。您必须使用与 Google Cloud 项目同一组织中的账户进行身份验证。
您的 OAuth 令牌保存在由 GDRIVE_CREDS_DIR 环境变量指定的目录中。

与桌面应用一起使用
要将此服务器与桌面应用集成,请将以下内容添加到应用的服务器配置中:
{
"mcpServers": {
"gdrive": {
"command": "npx",
"args": ["-y", "@isaacphi/mcp-gdrive"],
"env": {
"CLIENT_ID": "<CLIENT_ID>",
"CLIENT_SECRET": "<CLIENT_SECRET>",
"GDRIVE_CREDS_DIR": "/path/to/config/directory"
}
}
}
}许可证
此 MCP 服务器根据 MIT 许可证授权。这意味着您可以自由使用、修改和分发软件,但需遵守 MIT 许可证的条款和条件。有关更多详细信息,请参阅项目仓库中的 LICENSE 文件。
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.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceIntegrates with Google Drive to enable listing, searching, and reading files, plus reading and writing to Google Sheets.9,027284MIT
- AlicenseNot gradedqualityDmaintenanceEnables listing, reading, and searching over files in Google Drive, with automatic export of Google Workspace files.4,9074MIT
- FlicenseAqualityCmaintenanceEnables AI assistants to interact with Google Drive, including reading, searching, listing folders, and uploading files.71
- AlicenseNot gradedqualityCmaintenanceEnables listing, searching, reading, writing, creating, and uploading files on Google Drive.23MIT
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.
Search, browse, and read your Dropbox files. Find documents by name or content, list folders, and…
Query your Google Sheets as structured JSON: list sheets and tabs, read schemas, filter rows.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/raulLopez-qualifyze/mcp-gdrive'
If you have feedback or need assistance with the MCP directory API, please join our Discord server