Google Drive MCP

This MCP server integrates with Google Drive to allow listing, reading, and searching over files.

Visit Website
Google Drive MCP

Introduction

What is Google Drive MCP Server?

Google Drive MCP Server is a specialized implementation of the Model Context Protocol (MCP) designed to integrate with Google Drive. It allows users to list, read, and search files within Google Drive directly through an MCP client. The server automatically converts Google Workspace files (Docs, Sheets, Presentations, Drawings) into accessible formats like Markdown, CSV, plain text, and PNG, making it easier for Large Language Models (LLMs) and other tools to process the content.

Key Features

  • File Search: Search for files in Google Drive using natural language queries.
  • Content Conversion: Automatically converts Google Workspace files to accessible formats.
  • Direct Access: Provides direct access to files via gdrive:// URLs.
  • Cross-Platform Compatibility: Works seamlessly with MCP clients like Claude Desktop.
  • OAuth Integration: Secure authentication using Google's OAuth 2.0 framework.

How to Use Google Drive MCP Server

Getting Started

  1. Create a Google Cloud Project:

  2. Enable Google Drive API:

  3. Configure OAuth Consent Screen:

    • Go to the OAuth Consent Screen and configure it for "internal" use (or "external" if needed).
    • Add the OAuth scope: https://www.googleapis.com/auth/drive.readonly.
  4. Create OAuth Client ID:

    • Navigate to Credentials and create an OAuth Client ID for an application type of "Desktop App".
    • Download the JSON file containing your OAuth keys.
  5. Set Up the Server:

    • Rename the downloaded OAuth keys file to gcp-oauth.keys.json and place it in the root directory of your MCP server repository (e.g., servers/gcp-oauth.keys.json).
    • Build the server using npm run build or npm run watch.

Authentication

  1. Run Authentication Flow:
    • Execute the command: node ./dist auth.
    • This will open a browser window to complete the authentication process.
    • After authentication, credentials will be saved as .gdrive-server-credentials.json in the root directory.

Usage with Desktop App

  • Docker Configuration:
    {
      "mcpServers": {
        "gdrive": {
          "command": "docker",
          "args": [
            "run", "-i", "--rm",
            "-v", "mcp-gdrive:/gdrive-server",
            "-e", "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json",
            "mcp/gdrive"
          ]
        }
      }
    }