modelscope·@felores/gdrive-mcp-server
启用与Google Drive的集成,以列出、读取和搜索文件,支持各种文件类型,并对Google Workspace文件提供自动导出功能。
一个强大的模型上下文协议(MCP)服务器,提供与Google Drive的无缝集成,允许AI模型在Google Drive中搜索、列出和读取文件。
gdrive_search使用强大的全文搜索功能在您的Google Drive中搜索文件。
{
"query": "string (您的搜索查询)"
}
gdrive_read_file直接使用Google Drive文件ID读取文件内容。
{
"file_id": "string (Google Drive文件ID)"
}
服务器智能处理不同的Google Workspace文件类型:
创建 Google Cloud 项目
启用 Google Drive API
配置 OAuth 同意屏幕
https://www.googleapis.com/auth/drive.readonly创建 OAuth 客户端 ID
在项目中设置凭据
# 创建凭据目录
mkdir credentials
# 移动并重命名下载的 JSON 文件
mv path/to/downloaded/client_secret_*.json credentials/gcp-oauth.keys.json
# Clone the repository
git clone https://github.com/felores/gdrive-mcp-server.git
cd gdrive-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
创建一个凭据目录并将您的 OAuth 密钥放入其中:
mkdir credentials
# 将下载的 OAuth JSON 文件移动到凭据目录,并命名为 gcp-oauth.keys.json
运行身份验证命令:
node dist/index.js auth
在浏览器中完成 OAuth 流程
凭据将保存在 credentials/.gdrive-server-credentials.json 中
# Start the server
node dist/index.js
将以下配置添加到您的应用程序服务器设置中:
{
"mcpServers": {
"gdrive": {
"command": "node",
"args": ["path/to/gdrive-mcp-server/dist/index.js"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/gcp-oauth.keys.json",
"MCP_GDRIVE_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/.gdrive-server-credentials.json"
}
}
}
}
将 path/to/gdrive-mcp-server 替换为实际的安装目录路径。
搜索文件:
// 搜索包含“季度报告”的文档
const result = await gdrive_search({ query: "quarterly report" });
读取文件内容:
// 使用其 ID 读取特定文件
const contents = await gdrive_read_file({ file_id: "your-file-id" });
credentials 目录中欢迎贡献!请随时提交 Pull Request。
此 MCP 服务器基于 MIT 许可证发布。详情请参见 LICENSE 文件。
如果您遇到问题:
credentials 目录中暂无描述。
MCP服务器用于与Google产品交互。
一个MCP服务器,它能够保存和分享克劳德桌面端的对话,允许用户通过网页界面私密存储聊天记录或将其公开。
一种模型上下文协议服务器,它为与Notion的API交互提供了标准化接口,使用户能够列出数据库、创建页面并在其Notion工作区中进行搜索。
语言类型:英语 翻译结果:谷歌表格
一种模型上下文协议服务器,允许创建和管理多个防篡改的JSON数据库,支持CRUD操作、查询功能以及云端同步,以便与他人共享数据库。