npm @piotr-agier/google-drive-mcpstdioupdated 18d ago
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.
Google Drive MCP 能做什么?
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: 116 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"]
}
}
}
Restart the client after saving its configuration. Claude Desktop paths and HTTP examples are documented in Client configuration.
4. Make a first tool call
Ask your client:
Run authGetStatus and tell me which Google account is active.
Then try a read-only Drive request:
Search my Google Drive for files modified in the last seven days.
If the identity is wrong or search returns no files, use the troubleshooting guide.
What you can do
Organize Drive
Find PDF files in /Reports, create an Archive folder there, and move files older
than one year into it.
Build a report
Create a Google Sheet for monthly results, summarize it in a Google Doc, and
create a short Google Slides presentation from the summary.
Edit a document
Find the "Project Plan" document, replace the old launch date, format the new
date in bold, and add a comment describing the change.
Prepare a meeting
Create a Calendar event with a Google Meet link and attach the project brief
from Drive.
Documentation
Every section that used to live in this README is now in one of these guides.
| Guide | Contents |
|---|---|
| Setup | Requirements, Google Cloud APIs, OAuth credentials, and installation |
| Client configuration | Supported transports and client configuration |
| Authentication | Local OAuth, multi-account, service accounts, external tokens, and scopes |
| Configuration | CLI flags, environment variables, defaults, and precedence |
| Deployment | Docker, Streamable HTTP, team mode, and reverse-proxy security |
| Tool reference | All Drive, Docs, Sheets, Slides, Calendar, and account tools |
| Troubleshooting | Authentication, API, identity, Docker, and rate-limit problems |
| Development | Repository structure, build commands, tests, and contributions |
Security
- Never commit OAuth credentials, service-account keys, access tokens, refresh tokens, or
tokens.json. - Use the narrowest OAuth scopes that support the tools you need.
- Keep the default HTTP bind address on
127.0.0.1unless the server is protected by TLS and access control. - Use team mode for shared deployments so every request is authenticated as its caller.
- Treat
team-store.jsonas a secret because it contains members' Google refresh tokens.
See Authentication and Deployment for the complete security and identity model.
Development and support
See the development guide to build and test the project.
- Report defects and request features in GitHub Issues.
- Review released changes in the changelog.
- Contributions are welcome through pull requests.
License
Acknowledgments
- Built on the Model Context Protocol.
- Uses the Google APIs Node.js Client.
安装
把 Google Drive MCP 添加到你的客户端。选择你正在使用的那个。
claude mcp add google-drive-mcp -- npx -y @piotr-agier/google-drive-mcpcodex mcp add google-drive-mcp -- npx -y @piotr-agier/google-drive-mcpamp mcp add google-drive-mcp -- npx -y @piotr-agier/google-drive-mcp{
"mcpServers": {
"google-drive-mcp": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"google-drive-mcp": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"google-drive-mcp","command":"npx","args":["-y","@piotr-agier/google-drive-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"google-drive-mcp": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"google-drive-mcp": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"google-drive-mcp": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"google-drive-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"google-drive-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @piotr-agier/google-drive-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
评分
39 / 100
不完整
- 文档25/25
- 维护19/25
- 可信度6/20
- 能力0/15
- 安装体验12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 10 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 2.6.0最新 | 2026年8月21日 |