Google Drive 服务器
该 MCP 服务器与 Google Drive 集成,允许列出、读取和搜索文件。
成分
工具
- 搜索
- 在 Google Drive 中搜索文件
- 输入:
query
(字符串):搜索查询 - 返回匹配文件的文件名和 MIME 类型
资源
该服务器提供对 Google Drive 文件的访问:
- 文件(
gdrive:///<file_id>
)- 支持所有文件类型
- Google Workspace 文件会自动导出:
- 文档 → Markdown
- 表格 → CSV
- 演示文稿 → 纯文本
- 图纸 → PNG
- 其他文件以其原始格式提供
入门
- 创建新的 Google Cloud 项目
- 启用 Google Drive API
- 配置 OAuth 同意屏幕(“内部”适合测试)
- 添加 OAuth 范围
https://www.googleapis.com/auth/drive.readonly
- 为应用程序类型“桌面应用程序”创建 OAuth 客户端 ID
- 下载客户端 OAuth 密钥的 JSON 文件
- 将密钥文件重命名为
gcp-oauth.keys.json
并将其放入此 repo 的根目录中(即servers/gcp-oauth.keys.json
)
确保使用npm run build
或npm run watch
构建服务器。
验证
要验证并保存凭据:
- 使用
auth
参数运行服务器:node ./dist auth
- 这将在您的系统浏览器中打开身份验证流程
- 完成身份验证过程
- 凭证将保存在此 repo 的根目录中(即
servers/.gdrive-server-credentials.json
)
与桌面应用程序一起使用
要将此服务器与桌面应用程序集成,请将以下内容添加到应用程序的服务器配置中:
Docker
验证:
假设您已在 Google Cloud 上完成 OAuth 应用程序的设置,您现在可以使用以下命令对服务器进行身份验证,将/path/to/gcp-oauth.keys.json
替换为您的 OAuth 密钥文件的路径:
该命令将打印出一个 URL,供您在浏览器中打开。在浏览器中打开此 URL 并完成身份验证过程。凭据将保存在mcp-gdrive
卷中。
一旦通过身份验证,您就可以在应用程序的服务器配置中使用该服务器:
NPX
与 VS Code 一起使用
为了快速安装,请使用下面的一键安装按钮之一。
如需手动安装,请将以下 JSON 块添加到 VS Code 中的“用户设置 (JSON)”文件中。您可以按下Ctrl + Shift + P
并输入Preferences: Open User Settings (JSON)
来执行此操作。
或者,您可以将其添加到工作区中名为.vscode/mcp.json
的文件中。这样您就可以与其他人共享该配置。
请注意
.vscode/mcp.json
文件中不需要mcp
键。
NPX
Docker
执照
此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
该 MCP 服务器与 Google Drive 集成,允许列出、读取和搜索文件。
Related MCP Servers
- -securityAlicense-qualityEnables integration with Google Drive for listing, reading, and searching over files, supporting various file types with automatic export for Google Workspace files.Last updated -1,9719JavaScriptMIT License
- -securityAlicense-qualityIntegrates with Google Drive to enable listing, searching, and reading files, plus reading and writing to Google Sheets.Last updated -9186TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that integrates with SerpApi to retrieve search results from multiple search engines including Google, Bing, Yahoo, and others, enabling fast access to both live and archived search data.Last updated -Python
- -securityAlicense-qualityThis MCP server integrates with Google Drive to allow listing, reading, and searching files, as well as the ability to read and write to Google Sheets.Last updated -91JavaScriptMIT License