Skip to main content
Glama
Google Drive MCP Enhanced

Google Drive MCP Enhanced

by baljeet

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

Related MCP server: mcp-gdrive

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

  1. Go to Google Cloud Console

  2. Create a new project or select an existing one

  3. Enable the following APIs:

    • Google Drive API

    • Google Docs API

    • Google Sheets API

2. Create OAuth 2.0 Credentials

  1. Navigate to APIs & Services > Credentials

  2. Click Create Credentials > OAuth 2.0 Client ID

  3. Configure the consent screen if prompted

  4. Choose Desktop app as application type

  5. 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:

  1. Open your browser for Google OAuth

  2. Ask you to authorize the application

  3. Save tokens securely to ~/.local/share/google-drive-mcp/tokens.json

Available Tools

File Operations

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"
}

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.json with 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.json and 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:

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers