Google Drive MCP server

Integrates with Google Drive to enable file listing, reading, and searching across various document formats, with OAuth authentication for secure access to user content.
Back to servers
Provider
Woojin Jeon
Release date
Mar 12, 2025
Language
TypeScript

This MCP server provides integration with Google Drive, allowing you to list, read, and search files directly from your Drive account. It automatically handles file type conversions for Google Workspace documents and provides access to all your Google Drive content through a standardized interface.

Installation

Prerequisites

Before using the Google Drive MCP server, you need to set up authentication with Google Cloud:

  1. Create a new Google Cloud project
  2. Enable the Google Drive API
  3. Configure an OAuth consent screen ("internal" is fine for testing)
  4. Add OAuth scope https://www.googleapis.com/auth/drive.readonly
  5. Create an OAuth Client ID for application type "Desktop App"
  6. Download the JSON file of your client's OAuth keys
  7. Rename the key file to gcp-oauth.keys.json

Building the Server

Build the server with either:

npm run build

or for development with automatic rebuilding:

npm run watch

Authentication Setup

To authenticate and save your credentials:

  1. Run the server with the authentication parameter:
    node ./dist auth
    
  2. A browser window will open automatically
  3. Complete the Google authentication process
  4. Credentials will be saved as .gdrive-server-credentials.json

Usage

Accessing Files

Files in Google Drive can be accessed using the format:

gdrive:///<file_id>

The server automatically handles file conversions:

  • Google Docs → Markdown
  • Google Sheets → CSV
  • Google Presentations → Plain text
  • Google Drawings → PNG
  • Other files → Native format

Searching for Files

You can search for files using the search tool:

  • Input: A search query string
  • Returns: File names and MIME types of matching files

Integration with Desktop Apps

Docker Integration

Authentication with Docker:

docker run -i --rm --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json -v mcp-gdrive:/gdrive-server -e GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json -e "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json" -p 3000:3000 mcp/gdrive auth

Open the URL displayed in your browser to complete authentication.

Server Configuration:

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

NPX Integration

{
  "mcpServers": {
    "gdrive": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-gdrive"
      ]
    }
  }
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later