Get the FREE Ultimate OpenClaw Setup Guide →

gmail-drive

MCP Server that connects Claude AI to Gmail & Google Drive for intelligent email management, file organization, and productivity analytics. Transform your inbox chaos into an AI-powered productivity system.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio smitpatel-31-gmail-drive-mcp-server node path/to/server.js \
  --env REDIRECT_URI="http://localhost:8080/oauth2callback" \
  --env OAUTH2_SCOPES="https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/drive" \
  --env GOOGLE_CLIENT_ID="Your Google OAuth client ID" \
  --env GOOGLE_CLIENT_SECRET="Your Google OAuth client secret" \
  --env OAUTH2_CALLBACK_PORT="8080"

How to use

This MCP server integrates Gmail, Google Calendar, and Google Drive capabilities into Claude, enabling natural-language driven workflows that manage emails, calendar events, and drive files. You can trigger actions such as sending emails, creating calendar events with Meet links, and generating or organizing documents in Drive, all as part of multi-step automations. The server acts as the brain that discovers appropriate tools, authenticates with Google services, coordinates the service calls, and returns concise results to Claude for user-facing responses.

To use it, authorize the MCP server with Google OAuth2 for the Gmail, Calendar, and Drive scopes. Once authenticated, invoke tool calls from Claude like create_meeting, send_email, create_document, or project_setup to perform composite workflows (e.g., “Create a meeting at 2 PM, invite the team, and generate a notes doc.”). The MCP server handles token management, API requests, and formatting of responses so Claude can present a clear summary and next steps to users.

How to install

Prerequisites:

  • Node.js 18+ installed on your machine or server
  • Access to Google Cloud Console to create OAuth2 credentials for Gmail, Calendar, and Drive APIs
  • Network access to Google APIs from your runtime environment

Installation steps:

  1. Clone the repository: git clone https://github.com/your-org/gmail-drive-mcp-server.git cd gmail-drive-mcp-server

  2. Install dependencies: npm install

  3. Create Google OAuth2 credentials:

  4. Configure environment variables:

    • Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET with the credentials obtained above
    • Optionally adjust OAUTH2_CALLBACK_PORT if not using 8080
  5. Run the server: npm run start

    or if using a direct node start script

    node path/to/server.js

  6. Visit the authorization URL produced by the server to grant access to Gmail, Calendar, and Drive.

  7. In Claude, start using the MCP-enabled capabilities via the configured server name (gmail-drive).

Additional notes

Tips:

  • Ensure OAuth scopes include Gmail, Calendar, and Drive to enable full workflow capabilities.
  • If you encounter rate limits or authentication errors, verify that refresh tokens are being stored securely and that the redirect URI exactly matches what’s configured in Google Cloud Console.
  • Use project_setup workflows to initialize common structures (meeting + notes doc + invites) in a single command.
  • Monitor logs for tool discovery messages from Claude to understand which tool handlers (Email Tools, Calendar Tools, Drive Tools) are being invoked.
  • For production, consider deploying behind a reverse proxy and securing the OAuth callback endpoint with TLS.
  • If you need to adjust capabilities, modify the Tool Handlers mappings (EmailTools, CalendarTools, DriveTools, WorkflowTools) and their associated schemas as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers