Home / MCP / Google Drive MCP Server

Google Drive MCP Server

Interfaces with Google Drive to list, read, and search files, exporting Workspace formats as needed.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "gdrive_docker": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "--mount",
                "type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json",
                "-v",
                "mcp-gdrive:/gdrive-server",
                "-e",
                "GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json",
                "-e",
                "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json",
                "-p",
                "3000:3000",
                "mcp/gdrive",
                "auth"
            ],
            "env": {
                "GDRIVE_OAUTH_PATH": "/gcp-oauth.keys.json",
                "GDRIVE_CREDENTIALS_PATH": "/gdrive-server/credentials.json"
            }
        }
    }
}

This MCP server connects to Google Drive to list, read, and search files, exporting Google Workspace files into usable formats. It lets you query Drive data and access a wide range of file types through a simple, MCP-friendly interface.

How to use

You can run the Google Drive MCP Server either via Docker or with NPX, then connect your MCP client to browse, read, and search Drive files. Use the built-in search capability to find files by query, and access a variety of file formats, including exported Workspace documents when applicable.

How to install

Prerequisites you need before you begin:

  • Node.js and npm are installed on your system
  • Docker is installed and running if you plan to use the Docker option
  • A Google Cloud project with Drive API access is set up for OAuth credentials

1) Create a new Google Cloud project and enable the Google Drive API.

2) Configure an OAuth consent screen. Set the user type to internal for testing.

3) Add the scope https://www.googleapis.com/auth/drive.readonly.

4) Create an OAuth Client ID for application type Desktop App.

5) Download the JSON file with your client’s OAuth keys.

6) Rename the key file to gcp-oauth.keys.json and place it at servers/gcp-oauth.keys.json in your repository.

7) If you plan to use the Docker approach, you will authenticate with a command that mounts the key file and sets credentials for Drive access.

Windows, macOS, and Linux setup examples

Docker authentication command (example):
```
docker run -i --rm --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
  -v mcp-gdrive:/gdrive-server \
  -e GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json \
  -e GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json \
  -p 3000:3000 mcp/gdrive auth
```
This command prints a URL to open in your browser; complete the authentication flow and credentials will be saved in the mcp-gdrive volume. After authentication, you can start using the server in your MCP client configuration.

Additional setup with NPX

NPX start command (example):
```
{
  "mcpServers": {
    "gdrive": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gdrive"]
    }
  }
}
```
This config fetches and runs the server directly through NPX for quick testing.

Available tools

search

Search for files in Google Drive using a query and return matching file names and MIME types.