Skip to content

nikith-bv/MCP-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Google Drive MCP Server

A basic MCP server for reading files from Google Drive.

This project exposes Google Drive content through an MCP server built with FastMCP. It uses Google Application Default Credentials locally and a Google Cloud service account when deployed to Cloud Run.

The application has been containerized, stored in Google Artifact Registry, and deployed on Google Cloud Run.

Hosted MCP Endpoint

You can try the deployed MCP server using this endpoint:

https://claude-drive-mcp-1016616131697.us-central1.run.app/mcp

Add this URL as a remote MCP server in any AI agent or MCP-compatible client that supports streamable HTTP MCP servers.

Features

  • List files from Google Drive
  • Search files by full-text query
  • Read supported Drive files as text
  • Supports Google Docs, Google Sheets, Google Slides, plain text, JSON, CSV, and Microsoft Word .docx files
  • Preserves hyperlinks from .docx files as Markdown links
  • Uses Google Drive read-only access

MCP Tools

The server exposes three MCP tools:

list_files

Lists files from Google Drive.

Optional inputs:

  • folder_id: list files inside a specific Google Drive folder
  • name_contains: filter files by name

Returns:

  • id
  • name
  • mimeType
  • modifiedTime

read_file

Reads the content of a supported Google Drive file by file ID.

Supported formats include:

  • Google Docs
  • Text files
  • JSON files
  • CSV files
  • Microsoft Word .docx files

Unsupported binary files return a short placeholder message instead of raw bytes.

search_files

Performs a full-text search across files available to the authenticated account or service account.

Returns up to 20 matching files.

Requirements

  • Python 3.12 or later
  • Google Cloud SDK
  • Access to a Google Cloud project
  • Google Drive API enabled
  • A Google service account with access to the required Drive files

Python dependencies are listed in requirements.txt.

Local Setup

Install dependencies:

pip install -r requirements.txt

Authenticate with Google Application Default Credentials:

gcloud auth application-default login

Run the server:

python server.py

By default, the server runs on port 8080. You can override this with the PORT environment variable.

Docker

Build the container:

docker build -t google-drive-mcp .

Run the container:

docker run -p 8080:8080 google-drive-mcp

Google Cloud Deployment

This server is designed to run on Google Cloud Run.

Typical deployment flow:

  1. Enable the Google Drive API in your Google Cloud project.
  2. Create or configure a Google service account.
  3. Share the required Google Drive files or folders with that service account.
  4. Build the Docker image.
  5. Push the image to Google Artifact Registry.
  6. Deploy the image to Google Cloud Run.
  7. Attach the service account to the Cloud Run service.

On Cloud Run, authentication is handled automatically by Google Cloud using the attached service account.

Environment Variables

Variable Description Default
PORT Port used by the MCP HTTP server 8080

Project Structure

.
|-- Dockerfile
|-- README.md
|-- requirements.txt
`-- server.py

Notes

  • The server uses the Google Drive read-only scope: https://www.googleapis.com/auth/drive.readonly
  • The service account must have access to the files or folders you want the MCP server to read.
  • The MCP server runs with the streamable-http transport.

About

A remote Model Context Protocol (MCP) server that exposes a Google Drive folder to any MCP-compliant AI client β€” Claude Desktop, GitHub Copilot, Gemini, and more. Deployed serverlessly on Google Cloud Run. (Can Run without an OAuth authenication) - Run it in Github copilot or Claude Desktop πŸ™‚πŸ™‚

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors