home / mcp / google drive mcp server
Efficient implementation of the Google Drive MCP server
Configuration
View docs{
"mcpServers": {
"felores-gdrive-mcp-server": {
"command": "node",
"args": [
"path/to/gdrive-mcp-server/dist/index.js"
],
"env": {
"MCP_GDRIVE_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/.gdrive-server-credentials.json",
"GOOGLE_APPLICATION_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/gcp-oauth.keys.json"
}
}
}
}You run a Google Drive MCP Server to let AI models search, list, and read files from Google Drive with automatic format handling. This server gives you simple, programmable access to Drive data via the MCP protocol, so your apps can discover documents, read file contents, and work with various Google Workspace formats without manual parsing.
You interact with the server through an MCP client. Start the server locally and connect your client to the provided MCP endpoint. Use the available tools to search for files across Google Drive and to read the contents of a file by its Drive ID. The server automatically converts documents to friendly formats: Docs become Markdown, Sheets become CSV, Presentations become plain text, Drawings become PNG, and other text-like files become UTF-8 text. Other binary files are delivered as Base64 when needed.
Common workflows include locating documents by full-text search and retrieving file contents for ingestion or preview. You can perform searches across your Drive space and then request the content of specific files using their Google Drive file IDs. The server handles format conversion behind the scenes so your application can work with consistent data formats.
Prerequisites you need before installing the server:
• Node.js (v16 or higher)
• npm or yarn
• A Google Cloud Project
• A Google Workspace or personal Google account
Install and build the server with the following steps.
Prepare OAuth credentials to authorize the server to access Google Drive. Place the downloaded OAuth JSON file into a credentials directory and run the authentication flow to obtain and save access tokens.
Run the authentication flow to generate and store credentials locally.
{
"mcpServers": {
"gdrive": {
"type": "stdio",
"name": "gdrive",
"command": "node",
"args": ["path/to/gdrive-mcp-server/dist/index.js"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/gcp-oauth.keys.json",
"MCP_GDRIVE_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/.gdrive-server-credentials.json"
}
}
}
}Start the server from your project directory after building: run the stdio configuration shown above in your MCP client. The server will listen for MCP requests and respond to search and read operations against Google Drive.
Ensure your Google Cloud project is set up correctly and that Drive API access is enabled. Verify that the credentials directory contains the correct keys and that the OAuth flow has completed successfully. Check file permissions and Google Drive access rights if you encounter authorization issues.
Search for files in Google Drive with full-text search capabilities. Input is a query string; output includes file name, MIME type, file ID, last modified time, and size.
Read file contents from Google Drive using a file ID. Output is the file contents with appropriate format conversion based on file type.