google drive.com
google drive.com logo

Google Drive

Integrates with Google Drive API to enable file listing, searching, and reading for document retrieval and content analy...

Created byApr 22, 2025

Google Drive MCP Server

A powerful Model Context Protocol (MCP) server that provides seamless integration with Google Drive, allowing AI models to search, list, and read files from Google Drive.

Features

Tools

1. `gdrive_search`

Search for files in your Google Drive with powerful full-text search capabilities.
  • Input:
  • Output: List of files with:

2. `gdrive_read_file`

Read file contents directly using a Google Drive file ID.
  • Input:
  • Output: File contents with appropriate format conversion

Automatic File Format Handling

The server intelligently handles different Google Workspace file types:
  • Google Docs Markdown
  • Google Sheets CSV
  • Google Presentations Plain text
  • Google Drawings PNG
  • Text/JSON files UTF-8 text
  • Other files Base64 encoded

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • A Google Cloud Project
  • A Google Workspace or personal Google account

Detailed Google Cloud Setup

  1. Create a Google Cloud Project
  1. Enable the Google Drive API
  1. Configure OAuth Consent Screen
  1. Create OAuth Client ID
  1. Set Up Credentials in Project

Installation

Authentication

  1. Create a credentials directory and place your OAuth keys:
  1. Run the authentication command:
  1. Complete the OAuth flow in your browser
  1. Credentials will be saved in credentials/.gdrive-server-credentials.json

Usage

As a Command Line Tool

Integration with Desktop App

Add this configuration to your app's server settings:
Replace path/to/gdrive-mcp-server with the actual path to your installation directory.

Example Usage

  1. Search for files:
  1. Read file contents:

Security

  • All sensitive credentials are stored in the credentials directory
  • OAuth credentials and tokens are excluded from version control
  • Read-only access to Google Drive
  • Secure OAuth 2.0 authentication flow

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This MCP server is licensed under the MIT License. See the LICENSE file for details.

Troubleshooting

If you encounter issues:
  1. Verify your Google Cloud Project setup
  1. Ensure all required OAuth scopes are enabled
  1. Check that credentials are properly placed in the credentials directory
  1. Verify file permissions and access rights in Google Drive

Additional Resources

Google Drive MCP Server

A powerful Model Context Protocol (MCP) server that provides seamless integration with Google Drive, allowing AI models to search, list, and read files from Google Drive.

Features

Tools

1. `gdrive_search`

Search for files in your Google Drive with powerful full-text search capabilities.
  • Input:
  • Output: List of files with:

2. `gdrive_read_file`

Read file contents directly using a Google Drive file ID.
  • Input:
  • Output: File contents with appropriate format conversion

Automatic File Format Handling

The server intelligently handles different Google Workspace file types:
  • Google Docs Markdown
  • Google Sheets CSV
  • Google Presentations Plain text
  • Google Drawings PNG
  • Text/JSON files UTF-8 text
  • Other files Base64 encoded

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • A Google Cloud Project
  • A Google Workspace or personal Google account

Detailed Google Cloud Setup

  1. Create a Google Cloud Project
  1. Enable the Google Drive API
  1. Configure OAuth Consent Screen
  1. Create OAuth Client ID
  1. Set Up Credentials in Project

Installation

Authentication

  1. Create a credentials directory and place your OAuth keys:
  1. Run the authentication command:
  1. Complete the OAuth flow in your browser
  1. Credentials will be saved in credentials/.gdrive-server-credentials.json

Usage

As a Command Line Tool

Integration with Desktop App

Add this configuration to your app's server settings:
Replace path/to/gdrive-mcp-server with the actual path to your installation directory.

Example Usage

  1. Search for files:
  1. Read file contents:

Security

  • All sensitive credentials are stored in the credentials directory
  • OAuth credentials and tokens are excluded from version control
  • Read-only access to Google Drive
  • Secure OAuth 2.0 authentication flow

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This MCP server is licensed under the MIT License. See the LICENSE file for details.

Troubleshooting

If you encounter issues:
  1. Verify your Google Cloud Project setup
  1. Ensure all required OAuth scopes are enabled
  1. Check that credentials are properly placed in the credentials directory
  1. Verify file permissions and access rights in Google Drive

Additional Resources