MCP ExplorerExplorer

Google Drive Mcp Client

@cellwebbon 10 months ago
1 MIT
FreeCommunity
AI Systems
A client for Google Drive using MCP to interact with files via natural language.

Overview

What is Google Drive Mcp Client

google-drive-mcp-client is a Model Context Protocol (MCP) client for Google Drive that allows users to interact with their Google Drive files using natural language through Claude.

Use cases

Use cases include automating file management tasks, querying file information using natural language, and integrating Google Drive functionalities into applications.

How to use

To use google-drive-mcp-client, set up a virtual environment, install the required dependencies, configure Google Drive API credentials, and run the client using shell scripts or Hatch.

Key features

Key features include natural language interaction with Google Drive files, support for listing files, and the ability to run in a Docker environment.

Where to use

google-drive-mcp-client can be used in various fields such as software development, data management, and automation tasks that require file handling in Google Drive.

Content

Google Drive MCP Client

This is a Model Context Protocol (MCP) client for Google Drive that allows you to interact with your Google Drive files using natural language through Claude.

Setup

Note: This project requires Python 3.10 or newer.

  1. Create a virtual environment and install dependencies:
# Create and activate virtual environment
uv venv
source .venv/bin/activate  # On macOS/Linux
# On Windows use: .venv\Scripts\activate

# Install required packages
uv pip install mcp anthropic python-dotenv google-auth google-auth-oauthlib google-api-python-client
  1. Set up Google Drive API credentials:

    • Go to the Google Cloud Console
    • Create a new project
    • Enable the Google Drive API
    • Create OAuth credentials (OAuth client ID)
    • Download the credentials as JSON and save it as credentials.json in this directory
  2. Create a .env file with your Anthropic API key:

ANTHROPIC_API_KEY=your_api_key_here
GOOGLE_CREDENTIALS_PATH=path/to/your/service_account_credentials.json  # Optional

Docker Setup

Follow these instructions to set up the project using Docker:

  1. Install Docker and Docker Compose on your system.
  2. Clone this repository.
  3. Run docker-compose up to start the services.
  4. Access the application at http://localhost:8080.

For more details, refer to the original README.docker.md file.

Usage

Using Shell Scripts

Run the client with the provided shell script:

./run.sh

Using Hatch (Recommended)

Alternatively, if you prefer using Hatch:

# Install Hatch if you don't have it
pipx install hatch

# Create a Hatch environment and run the application
hatch shell
python client.py gdrive_server.py

On first run, the app will open a browser window for you to authenticate with your Google account and grant the necessary permissions.

Available Tools

This MCP server provides the following tools:

  • list_files: List files in your Google Drive
  • search_files: Search for files by name or content
  • get_file_content: View the content of text files, Google Docs, and Google Sheets
  • get_file_metadata: View detailed metadata about a file
  • list_folders: List folders in your Google Drive

Example Queries

Try asking questions like:

  • “Show me my recent documents”
  • “Search for files containing ‘project plan’”
  • “What’s in my Google Drive?”
  • “Show me the content of file XYZ”
  • “List all folders in my drive”

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers