npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-drive-mcp-readonly

v1.3.0

Published

Google Drive MCP Server - Model Context Protocol server providing secure access to Google Drive, Docs, Sheets, and Slides through MCP clients e.g. Claude Desktop

Readme

Google Drive MCP Server - Read-Only Edition

🔒 Safe and Read-Only - No data modifications possible

A Model Context Protocol (MCP) server that provides secure, read-only integration with Google Drive, Docs, Sheets, and Slides. It allows Claude Desktop and other MCP clients to safely access and search your files without any risk of modification.

✨ Features

  • 🔍 Advanced Search: Search across your entire Google Drive
  • 📁 Folder Navigation: List and browse folder hierarchies
  • 📄 Read Google Docs: Access and display document content with text indices
  • 📊 Read Google Sheets: Retrieve spreadsheet data from specific ranges
  • 🎯 Read Google Slides: View presentation content and element structure
  • 🔐 Secure Authentication: OAuth 2.0 with automatic token refresh
  • ✅ Completely Read-Only: Zero risk of accidental data modification

🚀 Quick Start

Installation

npm install google-drive-mcp-readonly

Usage with Claude Desktop

Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "google-drive-readonly": {
      "command": "npx",
      "args": ["google-drive-mcp-readonly"],
      "env": {
        "GOOGLE_DRIVE_OAUTH_CREDENTIALS": "/path/to/gcp-oauth.keys.json"
      }
    }
  }
}

CLI Commands

# Show version
npx google-drive-mcp-readonly --version

# Show help
npx google-drive-mcp-readonly help

# Run authentication
npx google-drive-mcp-readonly auth

# Start the MCP server
npx google-drive-mcp-readonly start

📋 Available Tools (5 Read-Only Tools)

1. search - Search Google Drive

Find files across your entire Google Drive using search queries.

Input: { query: "budget 2024" }
Output: List of matching files with names, IDs, and MIME types

2. listFolder - Browse Folder Contents

List all files and subfolders within a specific folder with pagination support.

Input: { folderId: "folder_id", pageSize: 50 }
Output: Files with details, folder structure information

3. getGoogleSheetContent - Read Spreadsheet Data

Retrieve content from specific ranges in Google Sheets.

Input: { spreadsheetId: "sheet_id", range: "Sheet1!A1:C10" }
Output: Cell values formatted by row

4. getGoogleDocContent - Read Google Docs

Get document content with character indices for reference.

Input: { documentId: "doc_id" }
Output: Full document text with position markers

5. getGoogleSlidesContent - Read Presentations

View presentation structure and content with element IDs.

Input: { presentationId: "presentation_id" }
Output: Slide content, text, shapes, and element structure

📖 Usage Examples

Example 1: Search for Budget Documents

User: "Search for all budget-related files in my Drive"

Tool Call:
search({ query: "budget" })

Result:
Found 5 files:
- budget_2024.xlsx (ID: abc123)
- Q1_budget_plan.docx (ID: def456)
- team_budget_notes.txt (ID: ghi789)
...

Example 2: List Files in a Folder

User: "Show me all files in my Projects folder"

Tool Call:
listFolder({ folderId: "projects_folder_id" })

Result:
📁 Q1 Planning
📁 Q2 Planning
📄 Project Timeline.docx
📊 Budget Analysis.xlsx

Example 3: Read Spreadsheet Data

User: "Get the sales data from my spreadsheet"

Tool Call:
getGoogleSheetContent({
  spreadsheetId: "sheet_id",
  range: "Sales!A1:D100"
})

Result:
Row 1: Date, Product, Quantity, Revenue
Row 2: 2024-01-01, Widget A, 100, $5000
...

🔐 Security & Permissions

This version is completely read-only and safe to use:

Enabled Permissions:

  • Read Google Drive files and folders
  • Read Google Docs content
  • Read Google Sheets data
  • Read Google Slides presentations
  • Search across your Drive

Disabled Operations:

  • ❌ No file creation
  • ❌ No file modification
  • ❌ No file deletion
  • ❌ No folder creation
  • ❌ No renaming or moving
  • ❌ No document editing
  • ❌ No spreadsheet updates
  • ❌ No presentation changes

📋 Requirements

  • Node.js: Version 18 or higher (LTS recommended)
  • Google Cloud Project: With the following APIs enabled:
    • Google Drive API (read-only)
    • Google Docs API (read-only)
    • Google Sheets API (read-only)
    • Google Slides API (read-only)
  • OAuth 2.0 Credentials: Desktop application type

🔧 Google Cloud Setup

1. Create a Google Cloud Project

  • Go to the Google Cloud Console
  • Click "Select a project" > "New Project"
  • Name your project (e.g., "Google Drive MCP Read-Only")
  • Note the Project ID

2. Enable Required APIs

In your project, go to "APIs & Services" > "Library" and enable:

  • Google Drive API
  • Google Docs API
  • Google Sheets API
  • Google Slides API

3. Configure OAuth Consent Screen

  • Go to "APIs & Services" > "OAuth consent screen"
  • Fill in app name, support email, and developer contact
  • Choose "External" or "Internal" based on your needs
  • Add your email as a test user
  • Scopes to request (read-only):
    • https://www.googleapis.com/auth/drive.readonly
    • https://www.googleapis.com/auth/documents.readonly
    • https://www.googleapis.com/auth/spreadsheets.readonly
    • https://www.googleapis.com/auth/presentations.readonly

4. Create OAuth 2.0 Credentials

  • Go to "APIs & Services" > "Credentials"
  • Click "+ CREATE CREDENTIALS" > "OAuth client ID"
  • Application type: Desktop app
  • Download the JSON file and save as gcp-oauth.keys.json

📦 Installation Options

Option 1: NPX (Recommended - No Installation)

npx google-drive-mcp-readonly --version
npx google-drive-mcp-readonly help

Option 2: NPM Install

npm install google-drive-mcp-readonly

Then use:

npx google-drive-mcp-readonly start
google-drive-mcp --version  # if installed globally with -g

🔑 Configuration

Environment Variables

# Path to your OAuth credentials JSON file (required)
export GOOGLE_DRIVE_OAUTH_CREDENTIALS="/path/to/gcp-oauth.keys.json"

# Optional: Custom token storage location
export GOOGLE_DRIVE_MCP_TOKEN_PATH="/custom/path/tokens.json"

# Optional: Debug logging
export DEBUG="google-drive-mcp:*"

Token Storage

Authentication tokens are stored securely at:

  • $GOOGLE_DRIVE_MCP_TOKEN_PATH (if set)
  • $XDG_CONFIG_HOME/google-drive-mcp/tokens.json
  • ~/.config/google-drive-mcp/tokens.json (default)

🎯 Use Cases

Perfect For:

  • Accessing Google Drive files programmatically
  • Searching and discovering files
  • Reading documents, sheets, and presentations
  • Browsing folder structures
  • Creating summaries from your files
  • Safe information retrieval

Not Suitable For:

  • Modifying or creating files
  • Deleting files
  • Automating file creation workflows
  • Data modification tasks

🐛 Troubleshooting

"OAuth credentials not found"

Ensure your gcp-oauth.keys.json exists or GOOGLE_DRIVE_OAUTH_CREDENTIALS env var is set.

"API not enabled"

Go to Google Cloud Console > APIs & Services > Library and enable the required APIs.

"Authentication failed"

Make sure:

  1. OAuth credential type is "Desktop app"
  2. Your email is added as a test user
  3. You have Read-only scopes configured

Debug Mode

Enable detailed logging:

export DEBUG=google-drive-mcp:*
npx google-drive-mcp-readonly start

📄 License

MIT - See LICENSE file for details

🙋 Support