Skip to main content
Glama

Google MCP Server

Production-grade MCP server for complete Google Workspace integration with Gmail, Calendar, Sheets, Docs, and Drive.

Features

  • 28 Tools for comprehensive Google Workspace access

  • Production-grade error handling with automatic retries

  • Binary file support for Drive operations

  • Rate limit handling with exponential backoff

  • Input validation and query sanitization

  • OAuth 2.0 with automatic token refresh

Related MCP server: google-connections-mcp

Supported Services

Gmail (7 tools)

  • gmail_search - Search emails with advanced queries

  • gmail_send - Send emails with attachments (dry-run by default)

  • gmail_reply_latest - Reply to most recent thread

  • gmail_create_draft - Create email drafts

  • gmail_get_thread - Get full thread conversation

  • gmail_label_threads - Apply/remove labels

  • gmail_search_unread_from - Find unread from sender/domain

Calendar (6 tools)

  • calendar_get_agenda - Get upcoming events

  • calendar_create_meeting - Create calendar events with Google Meet

  • calendar_quick_add - Natural language event creation

  • calendar_reschedule_event - Move events to new times

  • calendar_delete_event - Delete calendar events

  • calendar_find_slots - Find available time slots

Sheets (5 tools)

  • sheets_create - Create new spreadsheets

  • sheets_read - Read spreadsheet data

  • sheets_append - Append rows to sheets

  • sheets_update - Update specific cells

  • sheets_search - Find spreadsheets by name

Docs (4 tools)

  • docs_create - Create new documents

  • docs_read - Read document content

  • docs_update - Add/edit text in documents

  • docs_search - Find documents by name

Drive (6 tools)

  • drive_list - List files in folders

  • drive_search - Search all files

  • drive_download - Download files (text/binary, max 10MB)

  • drive_upload - Upload files from path/content/base64

  • drive_share - Share files with users

  • drive_create_folder - Create folders

Installation

Quick Start

Get started in 10 minutes - see QUICKSTART.md

Prerequisites

  • Node.js >= 20.0.0

  • Google Cloud Project with OAuth credentials (5-minute setup in QUICKSTART.md)

Install from npm

npm install -g @chieflatif/google-mcp

Authenticate

GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com" \
GOOGLE_CLIENT_SECRET="your-client-secret" \
npx @chieflatif/google-mcp setup-oauth

Follow the browser prompt to grant permissions. Tokens are saved to ~/.mcp-google/tokens.json.

That's it! Now configure your AI client below.

Usage with AI Clients

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "google-mcp": {
      "command": "npx",
      "args": ["-y", "@chieflatif/google-mcp"],
      "env": {
        "MCP_CORE_TOOLS": "1",
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "google-mcp": {
      "command": "npx",
      "args": ["-y", "@chieflatif/google-mcp"],
      "env": {
        "MCP_CORE_TOOLS": "1",
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

ChatGPT Desktop

Edit ChatGPT Desktop config file:

  • macOS: ~/Library/Application Support/ChatGPT/config.json

  • Windows: %APPDATA%\ChatGPT\config.json

{
  "mcpServers": {
    "google-mcp": {
      "command": "npx",
      "args": ["-y", "@chieflatif/google-mcp"],
      "env": {
        "MCP_CORE_TOOLS": "1",
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Restart your AI client and start using Google Workspace via natural language:

  • "What's on my calendar today?"

  • "Read my Master Task List spreadsheet"

  • "Send email to colleague@example.com about meeting"

  • "Create a new doc called 'Project Plan'"

  • "Search my Drive for Q4 planning documents"

Configuration Modes

"MCP_CORE_TOOLS": "1"

24 essential tools for full read/write access to all services

Full Mode (All tools)

// Remove MCP_CORE_TOOLS or set to "0"

28 tools including advanced calendar features

Minimal Mode (Fastest)

"MCP_MINIMAL_TOOLS": "1"

5 tools for basic read operations only

Error Handling

All tools return standardized error responses:

{
  status: 'error',
  error: 'Human-readable message',
  code: 'ERROR_CODE',
  retryable: boolean,
  details: {...}
}

Error Codes

  • RATE_LIMIT_EXCEEDED - Retry after a few moments (auto-retried 3x)

  • AUTH_FAILED - Re-authenticate with Google

  • NOT_FOUND - Invalid resource ID

  • INVALID_REQUEST - Check parameters

  • SERVER_ERROR - Google server issue (auto-retried)

  • FILE_TOO_LARGE - File exceeds 10MB limit

Security Features

  • ✅ Input validation on all parameters

  • ✅ Query sanitization to prevent injection

  • ✅ OAuth scopes limited to required permissions

  • ✅ Tokens stored locally with automatic refresh

  • ✅ Dry-run mode for destructive operations

  • ✅ File size limits to prevent memory issues

Troubleshooting

Authentication Errors

# Re-run OAuth setup
GOOGLE_CLIENT_ID="..." GOOGLE_CLIENT_SECRET="..." \
node scripts/setup-oauth.js

Rate Limit Errors

The server automatically retries with exponential backoff. If persistent:

Binary File Download Issues

Files >10MB will return FILE_TOO_LARGE error. For large files:

  • Use Google Drive web interface

  • Or split into smaller chunks

Development

# Run in development mode
npm run dev

# Build TypeScript
npm run build

# Test authentication
npm run test:auth

API Limits

Google Workspace API quotas (per project):

  • Gmail: 2,500 quota units/day

  • Calendar: 1,000,000 requests/day

  • Sheets: 300 requests/minute

  • Docs: 300 requests/minute

  • Drive: 12,000 requests/minute

The server implements automatic retry with exponential backoff for rate limits.

License

MIT

Contributing

Issues and PRs welcome! This is production-grade software intended for public use.

Support


Status: Production Ready
Version: 0.2.0
Last Updated: 2025-10-30

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