This MCP server integrates with Google Drive, allowing you to search files, read file contents, and work with Google Sheets documents. It provides a structured way to interact with your Google Drive content through the Model Context Protocol.
The server provides access to Google Drive files using the format gdrive:///<file_id>
and supports automatic file format conversion:
Before installing the MCP Google Drive server, you'll need to set up a Google Cloud project with the necessary APIs:
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/spreadsheets
Install the package:
npm install @isaacphi/mcp-gdrive
Create a configuration directory:
mkdir -p ~/.config/mcp-gdrive
Move your OAuth credentials file to the configuration directory:
mv ~/Downloads/client_secret_*.json ~/.config/mcp-gdrive/gcp-oauth.keys.json
Create a .env
file with your configuration:
GDRIVE_CREDS_DIR=~/.config/mcp-gdrive
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secret
Build the server:
npm run build
To complete setup, you need to authenticate with Google:
Start the server for the first time:
node ./dist/index.js
A browser window will open asking you to authenticate with your Google account
Complete the authentication process
Your OAuth token will be saved in your configuration directory
Once configured, you can start the server by running:
node ./dist/index.js
To integrate this server with an MCP-compatible desktop application, add the following to your app's server configuration:
{
"mcpServers": {
"gdrive": {
"command": "npx",
"args": ["-y", "@isaacphi/mcp-gdrive"],
"env": {
"CLIENT_ID": "your-client-id",
"CLIENT_SECRET": "your-client-secret",
"GDRIVE_CREDS_DIR": "/path/to/config/directory"
}
}
}
}
// Search for Google Docs files containing "meeting notes"
const searchResults = await gdrive_search({
query: "name contains 'meeting notes' and mimeType = 'application/vnd.google-apps.document'",
pageSize: 10
});
// Read the contents of a file by its ID
const fileContents = await gdrive_read_file({
fileId: "1aBcDeFgHiJkLmNoPqRsTuVwXyZ"
});
// Read data from a Google Sheet
const sheetData = await gsheets_read({
spreadsheetId: "1aBcDeFgHiJkLmNoPqRsTuVwXyZ",
ranges: ["Sheet1!A1:D10"]
});
// Update a cell in a Google Sheet
const updateResult = await gsheets_update_cell({
fileId: "1aBcDeFgHiJkLmNoPqRsTuVwXyZ",
range: "Sheet1!B5",
value: "Updated value"
});
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "gdrive" '{"command":"npx","args":["-y","@isaacphi/mcp-gdrive"],"env":{"CLIENT_ID":"<CLIENT_ID>","CLIENT_SECRET":"<CLIENT_SECRET>","GDRIVE_CREDS_DIR":"/path/to/config/directory"}}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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"
}
}
}
}
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.
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect