Google Drive MCP Server
Google Drive 服务器
该 MCP 服务器与 Google Drive 集成,允许列出、读取和搜索文件,以及读取和写入 Google Sheets 的能力。
该项目包含最初由 Anthropic、PBC 开发的代码,根据此 repo的 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: manus-mcp
入门
配置 OAuth 同意屏幕(“内部”适合测试)
添加 OAuth 范围
https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/spreadsheets为应用程序类型“桌面应用程序”创建 OAuth 客户端 ID
下载客户端 OAuth 密钥的 JSON 文件
将密钥文件重命名为
gcp-oauth.keys.json并将其放入使用GDRIVE_CREDS_DIR指定的路径(即/Users/username/.config/mcp-gdrive)记下您的 OAuth 客户端 ID 和客户端密钥。它们必须与您的配置目录一起作为环境变量提供。
确保使用npm run build或npm run watch构建服务器。
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 drive-mcp:
npx -y @smithery/cli install @rishipradeep-think41/drive-mcp --client claude验证
在向 Google API 发出请求之前,系统会提示您使用浏览器进行身份验证。您必须使用与您的 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
- -licenseNot gradedqualityAmaintenanceThis MCP server integrates with Google Drive to allow listing, reading, and searching over files.4,90789,748MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables interaction with Google Drive through the Google Cloud API. It allows users to list, read, and upload files directly from MCP-compatible clients like manus.im or Cursor.
- AlicenseBqualityDmaintenanceMCP server for Google Drive integration with file management, search, sharing, and full CRUD operations.155192MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with Google Sheets, providing tools to list sheets, read data from cell ranges, and write data to cell ranges.3MIT
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for Google search results via SERP API
A MCP server built for developers enabling Git based project management with project and personal…
Appeared in Searches
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/rishipradeep-think41/drive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server