
一款模型上下文协议(MCP)服务器,提供与 Google Drive、文档、表格、幻灯片和日历的安全集成。
概览
通过一个自托管服务器,将MCP客户端连接到Google Drive、Docs、表格、幻灯片和日历。搜索和整理文件,创建和编辑Workspace内容,管理共享,并自动化多步骤工作流程,同时保持对每次通话使用的Google身份和凭证的控制。 - 116 个工具涵盖文件管理、共享驱动器、权限、修订、富文档编辑、表格格式化、幻灯片创作和日历事件。- 个人桌面客户端使用 Stdio,托管集成使用 Streamable HTTP 或共享服务的 OAuth 保护团队模式。- 本地 OAuth 支持多个 Google 账户和按工具选择账户;也支持服务账户和外部管理的 OAuth 令牌。- 工具可暴露针对操作,可选的 gdrive:/// 资源接口支持直接读取和发现。- 凭证和令牌保留在您操作的环境中。
概述(AI 翻译)
通过一个自托管服务器,将MCP客户端连接到Google Drive、Docs、表格、幻灯片和日历。搜索和整理文件,创建和编辑Workspace内容,管理共享,并自动化多步骤工作流程,同时保持对每次通话使用的Google身份和凭证的控制。
为什么是这个服务器
- 硬盘优先工作流程: 130个工具涵盖文件管理、共享硬盘、权限、修订、丰富文档编辑、表格格式化、幻灯片制作和日历事件。
- 本地或托管: 个人桌面客户端使用 stdio,托管集成使用 Streamable HTTP 或共享服务 OAuth 保护的团队模式。
- **身份控制:**本地OAuth支持多个Google账户和每个工具的账户选择;同时也支持服务账户和外部管理的OAuth令牌。
- 代理友好访问: 工具暴露有针对操作,而可选的
gdrive:///资源接口支持直接读取和发现。 - 开放且自托管: 凭证和令牌会保留在你操作的环境中。
该项目仍专注于深度 Drive 和编辑器工作流程,而非试图暴露所有 Google Workspace API。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Drive MCP Server
Connect an MCP client to Google Drive, Docs, Sheets, Slides, and Calendar through one self-hosted server. Search and organize files, create and edit Workspace content, manage sharing, and automate multi-step workflows while keeping control of the Google identity and credentials used for every call.
Why this server
- Drive-first workflows: 130 tools cover file management, Shared Drives, permissions, revisions, rich Docs editing, Sheets formatting, Slides authoring, and Calendar events.
- Local or hosted: use stdio for a personal desktop client, Streamable HTTP for a hosted integration, or OAuth-protected team mode for a shared service.
- Identity control: local OAuth supports multiple Google accounts and per-tool account selection; service accounts and externally managed OAuth tokens are also supported.
- Agent-friendly access: tools expose targeted operations, while the optional
gdrive:///resource interface supports direct reading and discovery. - Open and self-hosted: credentials and tokens stay in the environment you operate.
This project remains focused on deep Drive and editor workflows rather than attempting to expose every Google Workspace API.
Client compatibility
Compatibility is determined by the transport and authentication flow a client supports.
| Client type | Transport | Recommended mode |
|---|---|---|
| Claude Desktop | stdio | Local OAuth |
| Other local MCP clients, including Gemini CLI | stdio | Local OAuth |
| claude.ai custom connectors | Streamable HTTP | Team mode |
| Other remote MCP clients | Streamable HTTP | Single identity behind access control, or team mode with OAuth 2.1 |
See Client configuration for configuration examples and transport requirements.
Quick start
1. Create Google OAuth credentials
In a Google Cloud project:
- Enable the Drive, Docs, Sheets, Slides, and Calendar APIs.
- Configure the OAuth consent screen and add your Google account as a test user when the app is in testing.
- Create an OAuth client with application type Desktop app.
- Download the JSON file and save it as:
~/.config/google-drive-mcp/gcp-oauth.keys.json
The setup guide has the complete Google Cloud walkthrough and alternative credential locations.
2. Authenticate
npx -y @piotr-agier/google-drive-mcp auth
Complete the Google consent flow in the browser. Tokens are stored by default at ~/.config/google-drive-mcp/tokens.json.
3. Add the server to your MCP client
For clients that use the common mcpServers configuration shape:
{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": ["-y", "@piotr-agier/google-drive-mcp"]
}
}
}
安装
npx -y @piotr-agier/google-drive-mcp配置
{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": ["-y", "@piotr-agier/google-drive-mcp"]
}
}
}