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
-
Create a Google Cloud Project:
- Visit the Google Cloud Console to create a new project.
- Note: If the link fails to load, ensure your network allows access to Google services, or try accessing Google Cloud Console directly.
-
Enable Google Drive API:
- Navigate to the APIs & Services Library and enable the Google Drive API for your project.
-
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
.
-
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.
-
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
ornpm run watch
.
- Rename the downloaded OAuth keys file to
Authentication
- 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.
- Execute the command:
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" ] } } }