home / mcp / google drive mcp server
Model Context Protocol (MCP) Server for reading from Google Drive and editing Google Sheets
Configuration
View docs{
"mcpServers": {
"isaacphi-mcp-gdrive": {
"command": "npx",
"args": [
"-y",
"@isaacphi/mcp-gdrive"
],
"env": {
"CLIENT_ID": "<CLIENT_ID>",
"CLIENT_SECRET": "<CLIENT_SECRET>",
"GDRIVE_CREDS_DIR": "/path/to/config/directory"
}
}
}
}This MCP server connects with Google Drive to list, read, and search files, and to read and write Google Sheets. It enables you to access Drive data and Sheets content directly from your MCP client, turning Drive and Sheets into programmable data sources for automation and workflow integration.
You integrate the Google Drive MCP server into your setup by configuring it as an MCP server within your client. Once running, you can search Drive for files, read file contents, and read or update data in Google Sheets. Authenticate once with a browser-based flow, and your OAuth token is stored for subsequent uses.
Prerequisites: you need Node.js and npm installed on your system. You also need access to a Google Cloud project with Drive and Sheets APIs enabled and a set of OAuth credentials.
Steps to install and run the server locally:
1. Create a new Google Cloud project and enable the Drive API and Sheets API.
2. Create OAuth credentials for a Desktop App and download the JSON file.
3. Rename the credentials file to gcp-oauth.keys.json and place it in your chosen config directory, e.g. /Users/you/.config/mcp-gdrive.
4. Set environment variables for your client ID, client secret, and the credentials directory. Create a .env file with:
GDRIVE_CREDS_DIR=/path/to/config/directory
CLIENT_ID=<CLIENT_ID>
CLIENT_SECRET=<CLIENT_SECRET>Build and start the server using your normal Node workflow if applicable. Then run the authentication flow to authorize access to your Google Workspace data.
To wire this server into a desktop app, include the MCP server configuration that runs via npx and passes your Google OAuth credentials.
{
"mcpServers": {
"gdrive": {
"command": "npx",
"args": ["-y", "@isaacphi/mcp-gdrive"],
"env": {
"CLIENT_ID": "<CLIENT_ID>",
"CLIENT_SECRET": "<CLIENT_SECRET>",
"GDRIVE_CREDS_DIR": "/path/to/config/directory"
}
}
}
}Search for files in Google Drive using a query, returning matching file names and MIME types.
Read the contents of a file from Google Drive by specifying its fileId.
Read data from a Google Spreadsheet with optional ranges and sheet targeting.
Update a single cell in a Google Spreadsheet by providing the fileId, cell range, and new value.