Integrate with Google Drive to search, read, and edit files and spreadsheets seamlessly with this MCP server
The Google Drive MCP Server (GDrive Server) integrates seamlessly with Model Context Protocol (MCP), allowing various AI applications—such as Claude Desktop, Continue, Cursor—to interact with Google Drive files and Google Sheets. By leveraging the power of MCP, this server provides a standardized mechanism for these AI tools to access, read, write, and perform advanced operations on file systems. This integration is particularly valuable for developers looking to enhance their AI workflows by enabling richer data interactions in cloud environments.
The GDrive Server exposes key features through the Model Context Protocol (MCP), including:
These tools enable detailed operations over Google Drive and Sheets:
gdrive_search
query
string, returns file name and MIME type.gdrive_read_file
fileId
, provides file content in response.gsheets_read
spreadsheetId
and optional parameter settings for cells or sheet ID, outputs the requested data.gsheets_update_cell
fileId
), specifies range
, and sets updated value
.The GDrive Server is designed to fit within the broader framework of MCP, ensuring seamless interoperability with other server implementations. It includes several core components that handle interactions with Google Drive:
gdrive_search(query="important file", pageToken=previous_token)
gdrive_read_file(fileId="unique_file_id")
Files from Google Drive can be accessed using the MDR (Model Context Resource) scheme:
gdrive:///<file_id
> paths, with native formats like Markdown, CSV, PNG exports where applicable.To set up and utilize the GDrive Server, you need to configure several dependencies. Here’s a step-by-step guide:
Create a New Google Cloud Project: Navigate to the Google Cloud Console.
Enable Required APIs:
Configure OAuth Credentials:
Set OAuth Scopes: Enable the necessary scopes like https://www.googleapis.com/auth/drive.readonly
and https://www.googleapis.com/auth/spreadsheets
.
Generate an OAuth Client ID: Use the Google Cloud Console to create a "Desktop App" style client.
Download Credentials:
gcp-oauth.keys.json
.Set Up Configuration Environment:
GDRIVE_CREDS_DIR=/path/to/config/directory
CLIENT_ID=<CLIENT_ID>
CLIENT_SECRET=<CLIENT_SECRET>
echo "
> GDRIVE_CREDS_DIR=/path/to/config/directory
> CLIENT_ID=$CLIENT_ID
> CLIENT_SECRET=$CLIENT_SECRET
" >> .env
Build and Run the Server:
npm run build
or npm run watch
.node ./dist/index.js
.Technical Implementation:
Claude Desktop, a leading AI tool for data analysts, connects to the GDrive Server through MCP. By using gsheets_read
, it retrieves dataset summaries and analyzes trends to make informed decisions.
Technical Implementation: Cursor, an editor-friendly AI assistant, integrates with Google Drive via gdrive_read_file
to fetch and update document contents in real-time during drafting sessions. This ensures live collaboration on documents without manual sync steps.
The table below outlines compatibility across various MCP clients:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
MCP offers a robust architecture that ensures high performance and broad compatibility across different MCP servers. This matrix summarizes key points:
To tailor the GDrive Server to specific needs, users can modify environment variables during setup. For enhanced security and performance, consider implementing:
Q: Does this server support all file types?
A: Yes, it supports a wide range of formats including native and exported types like Markdown, CSV, PNG.
Q: Can I use this with other cloud services beyond Google Drive?
A: Currently, only Google Drive is supported, as detailed in the configuration steps.
Q: Are there any security risks associated with using this server?
A: Ensure you follow best practices for securing OAuth credentials and data flows to mitigate risks.
Q: How can I contribute to this project?
A: Contributions are welcome; check the contributing guidelines in the repository for details.
Q: What happens if my Google Cloud project is misused or compromised?
A: Regularly monitor your API keys and permissions to prevent misuse. Report any issues to Google support immediately.
For developers interested in contributing, the following guidelines are key:
Explore the broader MCP ecosystem featuring multiple integrations, tools, and frameworks:
By leveraging the Google Drive MCP Server, AI developers can build powerful solutions that integrate seamlessly with diverse tools and services.
Note: The GDrive MCP server is designed to empower AI applications through enhanced interaction capabilities with cloud storage. It provides robust security protocols and comprehensive API support making it a critical component in modern data-driven ecosystems.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Set up MCP Server for Alpha Vantage with Python 312 using uv and MCP-compatible clients