leo-gdrive-mcp
Allows creating Google Docs and exporting them as Markdown, with a plain-text fallback when Markdown export is unavailable.
Provides tools to list, read, update, and upload files in Google Drive, scoped to files created by the integration, and to create folders.
Allows creating Google Sheets and exporting them as CSV.
Click on "Install 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., "@leo-gdrive-mcplist my Google Drive files"
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.
leo-gdrive-mcp
Google Drive as Leo tools, over MCP — create, read, update, and list Leo-created files, with Docs exported as Markdown and Sheets as CSV.
This is a port of the compiled leo-gdrive package. It provides two tools:
Tool | Actions |
|
|
|
|
Drive scope
Both tools operate under the drive.file scope. Leo can only see files it
created — it cannot browse or search the user's existing Drive. This is a
deliberate restriction, not a limitation to work around.
Related MCP server: Google Drive MCP Server
Token delivery
This package is tool-driven, not provider-driven. The hub injects a single-use
grant handle (_oauth_grant) into every tool call. The server exchanges it for
a Google access token once per invocation:
POST {LEO_API_URL}/graph/v1/oauth/exchange
Authorization: Bearer {LEO_PACKAGE_TOKEN}
body: {"grant": "<_oauth_grant value>"}
-> 200 {"access_token": "..."}A missing _oauth_grant means the user has not connected their Google account,
or this package is not in their allowed packages. The hub withheld the grant
deliberately — the right response is a clear error, not a retry.
Reading files
read detects the file's MIME type first and then either exports or downloads:
Google Docs — exported as Markdown, with a text/plain fallback for accounts where Markdown export returns 400.
Google Sheets — exported as CSV.
Everything else — downloaded raw. Binary files report their byte count rather than returning mojibake.
Writing files
create_doc and create_sheet use Drive's multipart upload with the
corresponding Google-native MIME type in the metadata; Drive converts the
plain-text or CSV body on ingest. upload stores a file as-is. update
replaces the media of an existing file using a PATCH request.
The multipart boundary is random per call so document content cannot collide with it and corrupt the upload.
Development
npm install
node test.js # no network neededThe test covers what fails quietly:
Query escaping. A name with
'or\in a Driveqclause breaks the query or allows injection.escapeQescapes both, and the test verifies both in isolation and combined.Native MIME detection. Getting this wrong means attempting a raw download of a file with no binary body, which Drive rejects. The test covers the full
application/vnd.google-apps.*prefix and confirms non-Google types are rejected.Export MIME mapping. Docs have a fallback (Markdown can 400); Sheets do not. The test pins every case including unknown future types.
Page size clamping. Default 25, max 100. Non-numbers, NaN, and out-of-range values are all tested.
Parents helper. An empty array and an absent key mean different things to Drive; omit the key when there is no folder.
Publishing
./store/publish.sh # live
./store/publish.sh draft # stage for review at admin.leoconnect.ioNeeds a Cloudflare login with D1:Edit on the leo-store database.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.
Give Claude only the Google Drive files you choose. Every action logged.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
An agent-first office suite Claude & ChatGPT read and write over one MCP URL.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceIntegrates with Google Drive to enable listing, searching, and reading files, plus reading and writing to Google Sheets.1,397283MIT
- AlicenseNot gradedqualityAmaintenanceEnables management of Google Drive files, Docs, Sheets, Slides, and Calendar events through natural language using the MCP protocol.12,825207MIT
- AlicenseNot gradedqualityBmaintenanceEnables reading and searching Google Drive files, Google Docs, and Google Sheets via a CLI or MCP server, with support for section-based content extraction and Markdown import.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables management of Google Drive files, Docs, Sheets, and Slides through natural language using MCP, with support for file operations, search, and shared drives.13MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheBananaStand/leo-gdrive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server