home / mcp / gdrive mcp server

Gdrive MCP Server

Provides access to Google Drive data via an MCP server, including search, doc contents, comments, and notes.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "benjamine-gdrive-mcp": {
      "command": "bunx",
      "args": [
        "--bun",
        "gdrive-mcp"
      ],
      "env": {
        "YOUR_CLIENT_ID": "<YOUR_CLIENT_ID>"
      }
    }
  }
}

This MCP server provides programmatic access to Google Drive, letting you search for files, fetch document contents, manage and reply to comments, and insert stylized notes directly into Google Docs. It enables you to build tooling and automations that interact with Drive data through a local MCP client without exposing credentials in your config files.

How to use

You interact with this server through an MCP client. The server exposes tools to search Drive, retrieve Google Doc contents, manage comments, and insert or update note blocks inside documents. Use a local MCP configuration to connect, run, and test the server, then issue requests from your MCP client to perform actions such as searching for documents, reading full doc text, listing and replying to comments, and inserting notes.

How to install

Prerequisites: you need a modern runtime and a way to install dependencies. You will also need Google OAuth2 credentials for Drive and Docs APIs.

Step by step commands to set up and run locally:

bunx --bun -p gdrive-mcp gdrive-mcp-auth YOUR_CLIENT_ID YOUR_CLIENT_SECRET
```

This runs a setup flow that opens your browser for Google authorization and stores credentials securely in your system keychain.

To test the server after setup, run:

```
bunx --bun gdrive-mcp
```
```}]},{

Configuration and how it runs (local MCP)

The server is configured for a local MCP client. Credentials are stored securely in your system keychain and are not embedded in configuration files.

{
  "mcpServers": {
    "gdrive": {
      "type": "local",
      "command": ["bunx", "--bun", "gdrive-mcp"]
    }
  }
}

Available tools and what they do

- search_drive: Search Google Drive for files and documents using a text query with optional filters. Returns basic metadata for matching items.

- get_doc_contents: Retrieve the full text content of a Google Doc by URL or document ID.

- list_doc_comments: List all comment threads on a Google Doc, including quoted text and replies.

- create_doc_comment: Create an unanchored comment on a Google Doc.

- reply_to_comment: Add a reply to an existing comment thread.

- insert_doc_note: Insert auto-numbered styled note blocks into document content to simulate anchored notes.

- update_doc_note: Update the text of an existing note by its number.

- remove_doc_note: Remove a note by its number from the document.

OAuth setup and credentials handling

You create Google OAuth2 credentials for Drive and Docs APIs, then run the setup flow so the server can obtain tokens securely. The credentials are stored in your system keychain.

Testing the server

After the OAuth setup completes, run the MCP server locally to test it.

bunx --bun gdrive-mcp

Security and credential storage

Credentials are stored securely in your system keychain (macOS Keychain, Linux libsecret, or Windows Credential Manager) and are not saved in plaintext config files.

Troubleshooting

If you encounter authorization errors, ensure you’ve created your own OAuth2 credentials and re-run the setup flow with your client ID and secret.

If you run into token or permission issues, remove prior app permissions in your Google account and re-run the setup to authorize again.

How it works

The server uses a browser-based OAuth2 flow to obtain refresh tokens, stores them securely in the keychain, and uses those tokens to obtain access tokens at runtime to call Google Drive and Docs APIs.

Development

Linting and formatting use the Biome toolchain. You can run checks, format code, and lint as part of development.

Available tools

search_drive

Search Google Drive for files and documents using text queries with optional filters.

get_doc_contents

Retrieve the full text content of a Google Doc by URL or document ID.

list_doc_comments

List all comment threads on a Google Doc with details.

create_doc_comment

Create an unanchored comment on a Google Doc.

reply_to_comment

Reply to an existing comment thread on a Google Doc.

insert_doc_note

Insert an auto-numbered styled note block into document content.

update_doc_note

Update the text of an existing note by its number.

remove_doc_note

Remove a note from the document by its number.