Get the FREE Ultimate OpenClaw Setup Guide →

gdrive

Efficient implementation of the Google Drive MCP server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio felores-gdrive-mcp-server node path/to/gdrive-mcp-server/dist/index.js \
  --env MCP_GDRIVE_CREDENTIALS="path/to/gdrive-mcp-server/credentials/.gdrive-server-credentials.json" \
  --env GOOGLE_APPLICATION_CREDENTIALS="path/to/gdrive-mcp-server/credentials/gcp-oauth.keys.json"

How to use

This MCP server exposes Google Drive capabilities as MCP tools. The gdrive_search tool lets you perform full-text searches across the files in your Google Drive and returns a list of files with metadata such as file name, MIME type, ID, last modified time, and size. The gdrive_read_file tool retrieves the contents of a file given its Google Drive file ID, returning the content in an appropriate format (e.g., Markdown for Google Docs, CSV for Sheets, plain text for Presentations, PNG for Drawings, UTF-8 text for text/json files, or Base64 for other binary files). The server automatically handles converting many Google Workspace formats into usable outputs to streamline model workflows. You can interact with these tools from your application by calling gdrive_search and gdrive_read_file as needed, then use the returned data within your MCP-enabled AI pipeline.

How to install

Prerequisites:\n- Node.js 16 or higher\n- npm or yarn\n- A Google Cloud Project with Drive API enabled\n- A Google account (Workspace or personal) for OAuth setup\n\nInstallation steps:\n1) Clone the repository and install dependencies:\nbash\ngit clone https://github.com/felores/gdrive-mcp-server.git\ncd gdrive-mcp-server\nnpm install\n\n\n2) Build the project:\nbash\nnpm run build\n\n\n3) Prepare OAuth credentials as described in the README (create credentials directory, place the downloaded JSON as gcp-oauth.keys.json, and obtain the credentials file for the server). Example steps:\nbash\n# Create credentials directory (if not present)\nmkdir -p credentials\n# Move your downloaded OAuth JSON file to credentials directory as gcp-oauth.keys.json\nmv path/to/downloaded/client_secret_*.json credentials/gcp-oauth.keys.json\n\n\n4) Authenticate the server to obtain and save tokens:\nbash\nnode dist/index.js auth\n\nFollow the browser-based OAuth flow. The credentials will be saved to credentials/.gdrive-server-credentials.json.\n\n5) Run the server:\nbash\nnode dist/index.js\n\nOr configure the MCP integration to use the provided node command and the path to dist/index.js as shown in the mcp_config.\n

Additional notes

Tips and notes:\n- Ensure the GOOGLE_APPLICATION_CREDENTIALS path points to your OAuth client JSON and that MCP_GDRIVE_CREDENTIALS points to the saved server credentials file.\n- The server uses a read-only Google Drive scope for safety. Make sure the OAuth consent screen and scopes include https://www.googleapis.com/auth/drive.readonly.\n- If you encounter issues, verify that credentials are correctly placed in the credentials directory and that file permissions allow reads by the running process.\n- When deploying, consider securing environment variables and avoiding hard-coded paths in production.\n- The npm_package field is null for this server since it is not published as an npm package in this context.

Related MCP Servers

Sponsor this space

Reach thousands of developers