Gdrive MCP Server
Google Drive MCP Server
Installation
npx gdrive-mcp-serverAsk AI about Gdrive MCP Server
Powered by Claude ยท Grounded in docs
I know everything about Gdrive MCP Server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Google Drive MCP Server โ๏ธ
This project implements a Model Context Protocol (MCP) server that provides tools and resources for interacting with Google Drive. It allows for programmatic access to Google Drive functionalities, enabling other MCP-compatible agents or systems to manage files and folders.
Table of Contents
Current Features โจ
The server currently provides the following functionalities:
- File and Folder Listing ๐: List files and folders within a specified Google Drive folder, including the root.
- File Creation ๐: Create new files with specified content in a given Google Drive path.
- DOCX File Creation ๐: Create new
.docxfiles with specified content in a given Google Drive path. - Folder Suggestion ๐ก: Suggests a Google Drive folder based on the content name.
Project Structure ๐๏ธ
The project follows a standard Go project layout:
cmd/server/: Contains the main application entry point for the MCP server.configs/: Stores configuration files, such as the Google Service Account credentials.internal/: Reserved for private application and library code that should not be imported by other applications.pkg/driveapi/: Contains reusable library code for interacting with the Google Drive API. This includes client setup, file operations, folder management, and suggestion logic.
Setup Instructions ๐ ๏ธ
To set up and run the Google Drive MCP Server, follow these steps:
Prerequisites โ
- Go (version 1.18 or higher)
- Docker or Podman (for running the MCP server)
- Google Cloud Project with Google Drive API enabled
- Service Account Key (JSON file) for authentication with Google Drive API
Configuration โ๏ธ
-
Enable Google Drive API:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to "APIs & Services" > "Library".
- Search for "Google Drive API" and enable it.
-
Create a Service Account:
- In the Google Cloud Console, go to "APIs & Services" > "Credentials".
- Click "Create Credentials" > "Service Account".
- Follow the steps to create a new service account.
- Grant the service account appropriate roles (e.g., "Drive File Organizer" or "Drive Editor") to access Google Drive.
-
Generate a Service Account Key:
- After creating the service account, click on its email address.
- Go to the "Keys" tab and click "Add Key" > "Create new key".
- Select "JSON" as the key type and click "Create".
- A JSON file will be downloaded. Rename it to
credentials.jsonand place it in theconfigs/directory of this project.
-
Share Google Drive Folders/Files with Service Account:
- The service account needs explicit access to the Google Drive folders/files it will interact with. Share the relevant folders/files with the service account's email address (found in the
credentials.jsonfile).
- The service account needs explicit access to the Google Drive folders/files it will interact with. Share the relevant folders/files with the service account's email address (found in the
Running the Server ๐
-
Build the Docker Image:
docker build -t gdrive-mcp-server .or
podman build -t gdrive-mcp-server . -
Run the MCP Server:
docker run --rm -i -e GOOGLE_APPLICATION_CREDENTIALS=/app/configs/credentials.json -v $(pwd)/configs:/app/configs gdrive-mcp-serveror
podman run --rm -i -e GOOGLE_APPLICATION_CREDENTIALS=/app/configs/credentials.json -v $(pwd)/configs:/app/configs gdrive-mcp-serverEnsure that
$(pwd)/configscorrectly points to the directory containing yourcredentials.jsonfile.
Usage ๐ก
Once the server is running, you can interact with it using an MCP-compatible client. The server exposes various tools for Google Drive operations. Refer to the MCP client documentation for details on how to call these tools.
Planned Features ๐ฎ
- File Update: Update existing files in Google Drive.
- File Deletion: Delete files from Google Drive.
- Folder Creation: Create new folders in Google Drive.
- File Search: Advanced search capabilities for files based on various criteria (name, type, content).
- Permissions Management: Manage file and folder permissions.
- Webhooks/Notifications: Integrate with Google Drive change notifications.
Contributing ๐ค
We welcome contributions to the Google Drive MCP Server! If you have suggestions, bug reports, or want to contribute code, please open an issue or submit a pull request on the GitHub repository.
License ๐
This project is licensed under the MIT License - see the LICENSE file for details.
