Skip to main content
Glama

Google Drive MCP Server

by ducla5

Google Drive MCP Server

A Model Context Protocol (MCP) server that provides AI agents with efficient access to Google Drive documents. The server downloads files locally, converts them to markdown, and offers selective content extraction to optimize context window usage.

Features

  • Document Processing: Convert Google Docs, PDFs, and Word documents to markdown

  • Selective Content Extraction: Extract specific sections, page ranges, or keyword-based content

  • Intelligent Caching: Local caching with LRU eviction and TTL-based expiration

  • Advanced Search: Search files by name, type, content, and metadata

  • Permission Management: Respect Google Drive permissions and sharing settings

  • MCP Protocol Compliance: Full integration with MCP-compatible AI agents

Project Structure

src/ ├── auth/ # Authentication management ├── cache/ # Caching system ├── content/ # Content processing pipeline ├── search/ # Search functionality ├── types/ # TypeScript interfaces and types └── index.ts # Main server entry point

Installation

npm install

Configuration

The server requires Google Drive API credentials. Create a config.json file or set environment variables:

Environment Variables

GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:8080/callback CACHE_DIR=./cache CACHE_MAX_SIZE=1GB CACHE_TTL=3600 LOG_LEVEL=info MAX_FILE_SIZE=100MB

Development

# Build the project npm run build # Start in development mode npm run dev # Type checking npm run type-check # Linting npm run lint

MCP Tools

The server exposes the following MCP tools:

  • drive_search_files: Search files on Google Drive

  • drive_get_file: Get file information and content

  • drive_get_content_chunk: Extract specific content portions

  • drive_get_file_metadata: Retrieve file metadata and permissions

  • drive_list_folder: List folder contents

  • drive_get_comments: Get file comments (if available)

Requirements

  • Node.js >= 18.0.0

  • Google Drive API credentials

  • TypeScript 5.5+

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables AI agents to efficiently access and process Google Drive documents by converting them to markdown and offering selective content extraction. Features intelligent caching, advanced search capabilities, and respect for Drive permissions to optimize context window usage.

  1. Features
    1. Project Structure
      1. Installation
        1. Configuration
          1. Environment Variables
        2. Development
          1. MCP Tools
            1. Requirements
              1. License

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/ducla5/gdriver-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server