@franciscpd/drive-mcp-server
v1.0.0
Published
MCP server for Google Drive, Docs, Sheets, and Slides — manage files, documents, spreadsheets, and presentations via AI agents
Maintainers
Readme
@franciscpd/drive-mcp-server
A Model Context Protocol (MCP) server for Google Drive, Docs, Sheets, and Slides. Manage files, documents, spreadsheets, and presentations through AI agents — powered by 3 environment variables.
Quick Start
npx -y @franciscpd/drive-mcp-serverSet these environment variables:
| Variable | Description |
|----------|-------------|
| GOOGLE_DRIVE_CLIENT_ID | OAuth2 client ID from Google Cloud Console |
| GOOGLE_DRIVE_CLIENT_SECRET | OAuth2 client secret |
| GOOGLE_DRIVE_REFRESH_TOKEN | OAuth2 refresh token (see Setup Guide) |
| LOG_LEVEL | (optional) Logging verbosity: debug, info, warn, error (default: info) |
Setup Guide
1. Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project (or select an existing one)
- Note your project name for the next steps
2. Enable APIs
Navigate to APIs & Services → Library and enable each of the following:
Drive API
- Search for "Google Drive API"
- Click Enable
Docs API
- Search for "Google Docs API"
- Click Enable
Sheets API
- Search for "Google Sheets API"
- Click Enable
Slides API
- Search for "Google Slides API"
- Click Enable
3. Create OAuth2 Credentials
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen:
- User type: External (or Internal for Workspace)
- Add the scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/documentshttps://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/presentations
- Add your email as a test user
- Application type: Web application
- Add
https://developers.google.com/oauthplaygroundas an authorized redirect URI - Save your Client ID and Client Secret
4. Get a Refresh Token
- Go to Google OAuth2 Playground
- Click the gear icon (top right) and check Use your own OAuth credentials
- Enter your Client ID and Client Secret
- In the left panel, select these scopes:
- Drive API v3 →
https://www.googleapis.com/auth/drive - Google Docs API v1 →
https://www.googleapis.com/auth/documents - Google Sheets API v4 →
https://www.googleapis.com/auth/spreadsheets - Google Slides API v1 →
https://www.googleapis.com/auth/presentations
- Drive API v3 →
- Click Authorize APIs and grant access
- Click Exchange authorization code for tokens
- Copy the Refresh token
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": ["-y", "@franciscpd/drive-mcp-server"],
"env": {
"GOOGLE_DRIVE_CLIENT_ID": "your-client-id",
"GOOGLE_DRIVE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_DRIVE_REFRESH_TOKEN": "your-refresh-token",
"LOG_LEVEL": "debug"
}
}
}
}Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": ["-y", "@franciscpd/drive-mcp-server"],
"env": {
"GOOGLE_DRIVE_CLIENT_ID": "your-client-id",
"GOOGLE_DRIVE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_DRIVE_REFRESH_TOKEN": "your-refresh-token",
"LOG_LEVEL": "debug"
}
}
}
}Generic MCP Client
GOOGLE_DRIVE_CLIENT_ID=your-client-id \
GOOGLE_DRIVE_CLIENT_SECRET=your-client-secret \
GOOGLE_DRIVE_REFRESH_TOKEN=your-refresh-token \
LOG_LEVEL=debug \
npx -y @franciscpd/drive-mcp-serverThe server communicates over stdio using the MCP protocol.
Tools
Drive
| Tool | Description |
|------|-------------|
| drive_search | Search files across Google Drive using query syntax |
| drive_list | List files and folders in a specific folder |
| drive_create_folder | Create a new folder in Google Drive |
| drive_upload | Upload a text file to Google Drive |
| drive_read | Read file content (exports Docs as Markdown, Sheets as CSV, Slides as plain text) |
| drive_delete | Move a file or folder to trash (soft delete) |
| drive_move | Move a file to a different folder |
| drive_copy | Copy a file with optional new name and parent |
| drive_rename | Rename a file or folder |
| drive_share | Share a file or folder with a user by email |
| drive_list_shared_drives | List available Shared Drives |
Docs
| Tool | Description |
|------|-------------|
| docs_create | Create a new Google Doc with optional initial content |
| docs_read | Read document content as plain text with paragraph indices |
| docs_insert_text | Insert text at a specific position |
| docs_delete_text | Delete a range of text |
| docs_list_comments | List all comments on a document |
| docs_add_comment | Add a comment to a document |
Sheets
| Tool | Description |
|------|-------------|
| sheets_create | Create a new spreadsheet with optional initial data |
| sheets_read | Read cell values from a range (A1 notation) |
| sheets_update | Update cell values in a range (literal text, no formula execution) |
| sheets_list | List all sheets (tabs) in a spreadsheet |
Slides
| Tool | Description |
|------|-------------|
| slides_create | Create a new Google Slides presentation |
| slides_read | Read presentation content including objectIds and text |
| slides_add_slide | Add a new slide with optional layout |
| slides_insert_text | Insert or replace text in a slide shape |
Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Start the server
npm startLicense
MIT
