gdrive-mcp
Provides tools for interacting with Google Drive through a shared Google account, enabling search, metadata retrieval, file listing, reading/exporting content, folder creation, uploads, updates, moves, copies, deletions/trashing, permission management, and shared drive discovery.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gdrive-mcpfind the latest quarterly report in my Google Drive"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gdrive-mcp
Single-tenant Google Drive MCP server, Streamable HTTP only. It exposes one shared Google Drive identity over the Model Context Protocol so an MCP client (e.g. MCP Inspector, Claude Code) can search, read, write, and share Drive files through tools.
No stdio transport: the server speaks Streamable HTTP exclusively (POST /mcp for client messages, GET /mcp for the SSE stream, DELETE /mcp to terminate a session).
Prerequisites
Node.js >= 22 (see
enginesinpackage.json).A Google Cloud project with the Google Drive API enabled and an OAuth client of type "Desktop app". Note the client ID and client secret — you need them for setup.
Related MCP server: gdrive-mcp-server
Setup
Install dependencies:
npm installRun the interactive OAuth setup (needs
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRETin the environment). It prints an authorization URL, you grant Drive access in the browser, paste back the code, and it prints aGOOGLE_REFRESH_TOKEN:GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=... npm run auth:setupCopy the printed
GOOGLE_REFRESH_TOKENinto a.envfile (see.env.examplefor all variables):GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=... GOOGLE_REFRESH_TOKEN=... PORT=3000 API_KEY= DRIVE_INLINE_LIMIT_MB=10 LOG_LEVEL=info CORS_ORIGINS=
Run
npm run devThis starts the server on port 3000 (or $PORT). Endpoints:
POST /mcp— JSON-RPC client messages (initialize, tools/list, tools/call, …).GET /mcp— SSE stream for server-to-client notifications.DELETE /mcp— terminate the session.GET /healthz— health check, returns{"ok":true}.
Uncaught /mcp errors before response headers return scrubbed JSON {error} with 500 (all methods); after SSE headers start the stream is torn down.
Connect MCP Inspector to http://localhost:3000/mcp.
Docker
docker build -t gdrive-mcp .
docker run -p 3000:3000 --env-file .env gdrive-mcpThe image builds with npm run build, installs production dependencies only, and runs as the non-root app user (node dist/src/main.js).
Tools
Tool | Description |
| Pass-through Drive query; default |
|
|
|
|
| Metadata + content; Workspace files auto-exported; binary → base64 + |
| Explicit export; |
|
|
| Small = single-shot; >5MB = resumable via |
| Metadata and/or content update |
| Default = trash; permanent requires |
|
|
|
|
| Single tool for sharing; blocks |
|
|
Security notes
Single shared Drive identity. The server acts as one Google account (the OAuth refresh token holder). All MCP clients share that identity — there is no per-user auth.
Trash-by-default.
drive_deletemoves files to trash unless called with bothpermanent:trueandconfirmPermanent:true.Ownership transfer blocked.
drive_permissionsrejectsrole:ownerunless the call explicitly passesallowOwnershipTransfer:true.API_KEYrequired when set. WhenAPI_KEYis set, all/mcprequests requireAuthorization: Bearer <key>(no localhost exemption).Secrets (client secret, refresh token, API key) never appear in tool output or error messages.
Error messages are scrubbed; assert error codes/isError, not exact message text.
Test
npm testIntegration round-trip (folder → upload → read → update → move → copy → trash → cleanup) against a real Drive account. Set credentials plus a scratch folder, then:
GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=... GOOGLE_REFRESH_TOKEN=... TEST_FOLDER_ID=... npm run test:integrationWithout credentials the integration suite skips cleanly (gate test asserts the skip, exit 0).
This server cannot be deployed
Maintenance
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Cloud file relay: chunked uploads, folders, share links, inline text reads, ZIP packing.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceA read-only Google Drive MCP server that allows searching files, reading file content (with auto-export for Google Docs, Sheets, Slides), and retrieving file metadata via OAuth authentication.15 npm2-
- FlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI assistants to interact with a user's Google Drive, including listing, searching, reading, creating, updating, and deleting files, with authentication via Google OAuth.-
- AlicenseAqualityBmaintenanceA read/write MCP server for Google Drive, Docs & Sheets with bounded reads, gated mutations, and consistent argument naming.26MIT
- FlicenseNot gradedqualityBmaintenanceA read-only MCP server that exposes a configured Google Drive folder to MCP clients, enabling them to list, search, and extract content from various file formats like Excel, CSV, PDF, DOCX, and images.-