Skip to main content

Google Drive MCP Server

An MCP server for managing files and folders in Google Drive, integrating seamlessly with AI assistants using the Model Context Protocol.

Features

  • List Files/Folders: Search and list files with advanced query support.
  • Get Metadata: Retrieve detailed information about specific files or folders.
  • Manage Folders: Create new folders and organize content.
  • Organize Content: Move, copy, and delete (or trash) files.
  • Trash Management: List trashed items and restore by file ID or name.
  • Export: Export Google Docs, Sheets, and Slides to formats like PDF or DOCX.

Installation

Prerequisites

  • Python 3.9 or higher.
  • A Google Cloud Project with the Drive API enabled.
  • OAuth2 credentials (Client ID and Client Secret).
  • OAuth scope: ["https://www.googleapis.com/auth/drive"].

Local Setup

  1. Install dependencies:

    pip install -e .
    
  2. Run the server:

    python main.py --access-token <TOKEN> --refresh-token <REFRESH_TOKEN> --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>
    

Configuration

Add the following to your MCP host configuration (e.g., mcp-config.json):

{
  "mcpServers": {
    "barie-google-drive-mcp": {
      "command": "uvx",
      "args": [
        "barie-google-drive-mcp",
        "--access-token",
        "YOUR_ACCESS_TOKEN",
        "--refresh-token",
        "YOUR_REFRESH_TOKEN",
        "--client-id",
        "YOUR_CLIENT_ID",
        "--client-secret",
        "YOUR_CLIENT_SECRET"
      ]
    }
  }
}

Tools

  • list_files: Search and list files.
  • get_file_metadata: Get file details.
  • create_folder: Create a new folder.
  • delete_file: Delete or trash a file.
  • move_file: Move a file to a new folder.
  • copy_file: Copy a file.
  • export_file: Export Google Workspace files and return base64 content with metadata.
  • list_trashed_files: List files/folders currently in trash.
  • restore_file: Restore trashed files/folders by fileId or name.

Restore Tool Behavior

restore_file supports two modes:

  1. Restore by ID:
{ "fileId": "FILE_ID" }
  1. Restore by name:
{
  "name": "report",
  "exactMatch": false,
  "restoreAllMatches": false
}

Notes:

  • Provide either fileId or name.
  • When restoring by name and multiple files match, only the first is restored unless restoreAllMatches is true.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barie_google_drive_mcp-0.1.5.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barie_google_drive_mcp-0.1.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file barie_google_drive_mcp-0.1.5.tar.gz.

File metadata

  • Download URL: barie_google_drive_mcp-0.1.5.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for barie_google_drive_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 311c9d9a74b7d3696736ccc4af618f1b50217083a594bda923abcfe5155684a1
MD5 3c0d2d6fa287bd4e77916e0cff6eab03
BLAKE2b-256 b6b1b67ac432cee62b1afb594c5136e29b609ae0f75489cc9acdddb645a48753

See more details on using hashes here.

File details

Details for the file barie_google_drive_mcp-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for barie_google_drive_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 467b3e070b788cd6c618fd7a336f8f20b0c8054223fd26dc1e417cf68e24ebac
MD5 455eecc4d79dccc75e560e8a4395dd6a
BLAKE2b-256 b08851109bdccaca6fa177c0b1c3446090b1b946d205e78178b85105b1116f71

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 files

0.1.4

2 files

0.1.3

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page