Google Drive MCP Enhanced
Enhanced Google Drive MCP server with comprehensive comment, suggestion, and sharing support
Installation
npx google-drive-mcp-enhancedAsk AI about Google Drive MCP Enhanced
Powered by Claude Β· Grounded in docs
I know everything about Google Drive MCP Enhanced. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Google Drive MCP Enhanced
A comprehensive Model Context Protocol (MCP) server for Google Drive with enhanced collaboration features including full comment support, suggestions, and sharing management.
Features
Core Capabilities
- File Operations: Search, list, read, create, delete, and move files
- Google Docs: Read and update document content
- Google Sheets: Read and update spreadsheet data
- Comments β: Create, read, update, delete, reply, resolve comments on Docs and Sheets
- Suggestions: Create, list, accept, and reject suggestions in Google Docs
- Sharing: Manage file permissions and create shareable links
Key Differentiators
This implementation stands out from existing Google Drive MCP servers by providing:
- β Full comment support for both Google Docs and Sheets
- β Comment anchoring (text selection in Docs, cell references in Sheets)
- β Comment threads with replies
- β Comment resolution workflow
- β Comprehensive sharing and permissions management
- β Suggestion tracking for collaborative editing
Installation
Prerequisites
- Node.js 18 or higher
- Google Cloud Project with Drive, Docs, and Sheets APIs enabled
- OAuth 2.0 credentials (see Setup Guide below)
Install Dependencies
cd google-drive-mcp-enhanced
npm install
Build
npm run build
Setup
1. Create Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the following APIs:
- Google Drive API
- Google Docs API
- Google Sheets API
2. Create OAuth 2.0 Credentials
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Configure the consent screen if prompted
- Choose Desktop app as application type
- Download the credentials JSON file
3. Set Environment Variables
export GOOGLE_CLIENT_ID="your-client-id"
export GOOGLE_CLIENT_SECRET="your-client-secret"
Or create a .env file:
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
4. Configure MCP Client
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"google-drive-enhanced": {
"command": "node",
"args": ["/path/to/google-drive-mcp-enhanced/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}
5. First Run - Authentication
On first run, the server will:
- Open your browser for Google OAuth
- Ask you to authorize the application
- Save tokens securely to
~/.local/share/google-drive-mcp/tokens.json
Available Tools
File Operations
gdrive_search
Search for files with optional filters.
{
"query": "meeting notes",
"mimeType": "application/vnd.google-apps.document",
"maxResults": 10
}
gdrive_list_folder
List contents of a folder.
{
"folderId": "folder-id-here",
"pageSize": 50
}
gdrive_read_file
Read file metadata and content.
{
"fileId": "file-id-here"
}
gdrive_create_file
Create a new file.
{
"name": "New Document",
"mimeType": "application/vnd.google-apps.document",
"parentId": "folder-id"
}
gdrive_delete_file
Delete a file.
{
"fileId": "file-id-here"
}
gdrive_move_file
Move a file to different folder.
{
"fileId": "file-id-here",
"newParentId": "folder-id"
}
Google Docs Operations
gdocs_read
Read document content.
{
"documentId": "doc-id-here"
}
gdocs_update
Update document content.
{
"documentId": "doc-id-here",
"text": "New content",
"startIndex": 1,
"endIndex": 10
}
Google Sheets Operations
gsheets_get_metadata
Get spreadsheet metadata.
{
"spreadsheetId": "sheet-id-here"
}
gsheets_read
Read sheet data.
{
"spreadsheetId": "sheet-id-here",
"range": "Sheet1!A1:D10"
}
gsheets_update
Update sheet data.
{
"spreadsheetId": "sheet-id-here",
"range": "Sheet1!A1:B2",
"values": [["Name", "Email"], ["John", "john@example.com"]]
}
Comment Operations β
gdrive_create_comment
Create a comment on a file. For Docs, optionally anchor to text selection. For Sheets, anchor to cell.
{
"fileId": "file-id-here",
"content": "This needs revision",
"startIndex": 10,
"endIndex": 50
}
For Sheets:
{
"fileId": "sheet-id-here",
"content": "Check this value",
"cellReference": "A1"
}
gdrive_list_comments
List all comments on a file.
{
"fileId": "file-id-here",
"resolvedOnly": false
}
gdrive_get_comment
Get specific comment details.
{
"fileId": "file-id-here",
"commentId": "comment-id"
}
gdrive_update_comment
Update comment content.
{
"fileId": "file-id-here",
"commentId": "comment-id",
"content": "Updated comment text"
}
gdrive_delete_comment
Delete a comment.
{
"fileId": "file-id-here",
"commentId": "comment-id"
}
gdrive_reply_to_comment
Add a reply to a comment thread.
{
"fileId": "file-id-here",
"commentId": "comment-id",
"content": "I agree with this"
}
gdrive_resolve_comment
Mark a comment as resolved.
{
"fileId": "file-id-here",
"commentId": "comment-id"
}
gdrive_reopen_comment
Reopen a resolved comment.
{
"fileId": "file-id-here",
"commentId": "comment-id"
}
Sharing Operations
gdrive_share_file
Share a file with a user, group, or domain.
{
"fileId": "file-id-here",
"emailAddress": "user@example.com",
"type": "user",
"role": "writer",
"sendNotificationEmail": true,
"emailMessage": "Check out this document"
}
gdrive_create_share_link
Create a shareable link.
{
"fileId": "file-id-here",
"role": "reader"
}
gdrive_list_permissions
List all permissions for a file.
{
"fileId": "file-id-here"
}
gdrive_update_permission
Update an existing permission.
{
"fileId": "file-id-here",
"permissionId": "permission-id",
"role": "commenter"
}
gdrive_remove_permission
Remove a permission.
{
"fileId": "file-id-here",
"permissionId": "permission-id"
}
Suggestion Operations
gdocs_create_suggestion
Create a suggestion in a document.
{
"fileId": "doc-id-here",
"type": "insert",
"content": "suggested text",
"startIndex": 10
}
gdocs_list_suggestions
List pending suggestions.
{
"fileId": "doc-id-here"
}
gdocs_accept_suggestion
Accept a suggestion.
{
"fileId": "doc-id-here",
"suggestionId": "suggestion-id"
}
gdocs_reject_suggestion
Reject a suggestion.
{
"fileId": "doc-id-here",
"suggestionId": "suggestion-id"
}
Usage Examples
See EXAMPLES.md for detailed usage examples.
Security
- OAuth tokens are stored securely in
~/.local/share/google-drive-mcp/tokens.jsonwith 0600 permissions - Automatic token refresh when expired
- PKCE flow for enhanced OAuth security
Troubleshooting
Authentication Issues
- Ensure GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET are set correctly
- Delete
~/.local/share/google-drive-mcp/tokens.jsonand re-authenticate - Check that all required APIs are enabled in Google Cloud Console
Permission Errors
- Verify OAuth consent screen has the correct scopes
- Re-authenticate to grant missing permissions
Rate Limiting
- The server implements automatic retry with exponential backoff
- Consider reducing request frequency if hitting rate limits
License
MIT
Contributing
Contributions welcome! Please open an issue or pull request.
Acknowledgments
Built with:
- @modelcontextprotocol/sdk - Official MCP SDK
- googleapis - Google APIs Node.js client
