# Google Drive MCP

## Google Drive MCP

### What This Does

Enables Claude Code to search, list, and read files from Google Drive.

### Source

* **Docker Hub:** <https://hub.docker.com/r/mcp/gdrive>
* **Docker:** `mcp/gdrive`
* **Alternative:** <https://github.com/felores/gdrive-mcp-server>

### Prerequisites

* Docker Desktop installed
* @theentourageai.com Google account
* Google Cloud Project with Drive API enabled

### Step 1: Create Local Config Folder

```bash
mkdir -p ~/.config/mcp/gdrive
```

### Step 2: Get Credentials

#### Create Google Cloud OAuth Credentials

1. Go to <https://console.cloud.google.com>
2. Log in with your @theentourageai.com account
3. Create a new project or select existing one
4. Enable required APIs:
   * Go to **APIs & Services → Library**
   * Enable **Google Drive API**
   * Enable **Google Sheets API** (optional, for sheet access)
   * Enable **Google Docs API** (optional, for doc access)

#### Create OAuth Client

1. Go to **APIs & Services → Credentials**
2. Click **Create Credentials → OAuth client ID**
3. Application type: **Desktop app**
4. Name: "Drive MCP"
5. Click **Create**
6. Click **Download JSON**

#### Configure OAuth Consent Screen

1. Go to **APIs & Services → OAuth consent screen**
2. User type: **Internal** (for Workspace accounts)
3. Fill in:
   * App name: "Drive MCP"
   * User support email: your @theentourageai.com email
   * Developer contact: your @theentourageai.com email
4. Add scopes:
   * `https://www.googleapis.com/auth/drive.readonly`
   * `https://www.googleapis.com/auth/drive.file` (optional, for write access)
5. Save

### Step 3: Save Credentials Locally

Move the downloaded OAuth JSON file:

```bash
mv ~/Downloads/client_secret_*.json ~/.config/mcp/gdrive/credentials.json
```

### Step 4: Pull Docker Image

```bash
docker pull mcp/gdrive
```

### Step 5: First Run (Authentication)

Run the auth command:

```bash
docker run -it --rm \
  -v ~/.config/mcp/gdrive/credentials.json:/gcp-oauth.keys.json \
  -v ~/.config/mcp/gdrive:/mcp-gdrive \
  mcp/gdrive auth /gcp-oauth.keys.json
```

1. A URL will appear in terminal
2. Open URL in browser
3. Log in with your @theentourageai.com account
4. Grant permissions
5. Copy the authorization code
6. Paste it back into terminal
7. Token will be saved to `~/.config/mcp/gdrive/`

### Step 6: Add to Claude Code

Add to `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "gdrive": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "${HOME}/.config/mcp/gdrive:/mcp-gdrive",
        "mcp/gdrive"
      ]
    }
  }
}
```

**Note:** If `${HOME}` doesn't expand, use absolute path:

```json
{
  "mcpServers": {
    "gdrive": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "/Users/yourname/.config/mcp/gdrive:/mcp-gdrive",
        "mcp/gdrive"
      ]
    }
  }
}
```

### Step 7: Verify It Works

Restart Claude Code and test:

```
Search my Google Drive for recent files
```

Expected: List of files from your Google Drive.

### Available Tools

| Tool     | Description                     |
| -------- | ------------------------------- |
| `search` | Search files by name or content |

### Troubleshooting

| Issue                      | Solution                                     |
| -------------------------- | -------------------------------------------- |
| "Access denied"            | Add your email as test user in OAuth consent |
| "File not found"           | Verify file sharing permissions              |
| Token expired              | Re-run auth command                          |
| "Insufficient permissions" | Check OAuth scopes include drive.readonly    |
| Can't read file            | Some file types may not be supported         |
| credentials.json not found | Check file is in `~/.config/mcp/gdrive/`     |
