mcp-google-gdrive 0.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +139 -41
  2. package/package.json +7 -3
  3. package/src/index.js +912 -332
package/README.md CHANGED
@@ -1,35 +1,104 @@
1
1
  # mcp-google-gdrive
2
2
 
3
- An [MCP](https://modelcontextprotocol.io) server for the Google Drive API. Lets AI assistants list, read, create, and manage files in Google Drive with automatic Google Workspace format conversion (Docs to Markdown, Sheets to CSV, Slides to plain text).
3
+ An [MCP](https://modelcontextprotocol.io/) server for Google Drive, Docs, Sheets, and Slides. Lets AI assistants manage files, folders, permissions, labels, and trash with full read/write access across multiple Google accounts. Includes automatic Workspace format conversion (Docs to Markdown, Sheets to CSV/JSON, Slides to text).
4
4
 
5
5
  ## Tools
6
6
 
7
- | Tool | Description | Status |
8
- |------|-------------|--------|
9
- | gdrive_list_files | List and search files with query filtering and pagination | Available |
10
- | gdrive_get_metadata | Get detailed file metadata by ID | Available |
11
- | gdrive_read_file | Read file content with automatic Workspace format conversion | Available |
12
- | gdrive_create_file | Create a new file with content | Available |
13
- | gdrive_create_folder | Create a new folder | Available |
14
- | gdrive_update_file | Update existing file content | Planned |
15
- | gdrive_delete_file | Trash or permanently delete a file | Planned |
16
- | gdrive_move_file | Move a file between folders | Planned |
17
- | gdrive_copy_file | Copy a file with optional rename | Planned |
18
- | gdrive_export_doc | Export Google Doc to Markdown, HTML, or PDF | Planned |
19
- | gdrive_export_sheet | Export Google Sheet to CSV or JSON | Planned |
20
- | gdrive_export_slides | Export Google Slides to text or PDF | Planned |
21
- | gdrive_create_doc | Create a Google Doc from Markdown | Planned |
22
- | gdrive_update_doc | Update a Google Doc with Markdown content | Planned |
7
+ ### Account Management
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `gdrive_list_accounts` | List all configured Google accounts with labels and emails |
12
+ | `gdrive_switch_account` | Set the active account for subsequent calls |
13
+ | `gdrive_add_account` | Generate an authorization URL to add a new Google account |
14
+
15
+ ### Files
16
+
17
+ | Tool | Description |
18
+ |------|-------------|
19
+ | `gdrive_list_files` | List files with optional search query and folder filtering |
20
+ | `gdrive_get_metadata` | Get detailed metadata for a file by ID |
21
+ | `gdrive_read_file` | Read file content with automatic Workspace format conversion |
22
+ | `gdrive_create_file` | Create a new file with optional OCR on image/PDF uploads |
23
+ | `gdrive_update_file` | Update a file's content, name, or description |
24
+ | `gdrive_copy_file` | Copy a file, optionally to a different folder |
25
+ | `gdrive_move_file` | Move a file to a different folder |
26
+ | `gdrive_search_files` | Full-text search across file names and content |
27
+
28
+ ### Folders
29
+
30
+ | Tool | Description |
31
+ |------|-------------|
32
+ | `gdrive_create_folder` | Create a new folder |
33
+ | `gdrive_list_folder` | List contents of a specific folder |
34
+ | `gdrive_delete_folder` | Delete a folder (trash or permanent) |
35
+
36
+ ### Trash
37
+
38
+ | Tool | Description |
39
+ |------|-------------|
40
+ | `gdrive_trash_file` | Move a file or folder to trash |
41
+ | `gdrive_untrash_file` | Restore a file or folder from trash |
42
+ | `gdrive_empty_trash` | Permanently delete all trashed files (irreversible) |
43
+ | `gdrive_list_trash` | List files currently in trash |
44
+
45
+ ### Permissions
46
+
47
+ | Tool | Description |
48
+ |------|-------------|
49
+ | `gdrive_share_file` | Share a file with a user, group, domain, or anyone |
50
+ | `gdrive_list_permissions` | List all permissions on a file or folder |
51
+ | `gdrive_update_permission` | Update a permission's role |
52
+ | `gdrive_remove_permission` | Remove a permission (unshare) |
53
+ | `gdrive_transfer_ownership` | Transfer file ownership to another user |
54
+
55
+ ### Labels
56
+
57
+ | Tool | Description |
58
+ |------|-------------|
59
+ | `gdrive_list_labels` | List available Drive labels |
60
+ | `gdrive_list_file_labels` | List labels applied to a file |
61
+ | `gdrive_set_file_labels` | Add, update, or remove labels on a file |
62
+
63
+ ### Google Docs
64
+
65
+ | Tool | Description |
66
+ |------|-------------|
67
+ | `gdrive_export_doc` | Export a Google Doc (markdown, html, text, docx, pdf) |
68
+ | `gdrive_create_doc` | Create a Google Doc from Markdown content |
69
+ | `gdrive_update_doc` | Replace a Google Doc's content with Markdown |
70
+
71
+ ### Google Sheets
72
+
73
+ | Tool | Description |
74
+ |------|-------------|
75
+ | `gdrive_create_sheet` | Create a new spreadsheet with named tabs |
76
+ | `gdrive_export_sheet` | Export a sheet to CSV, JSON, or XLSX |
77
+ | `gdrive_list_sheets` | List all sheets/tabs in a spreadsheet |
78
+ | `gdrive_read_sheet_range` | Read a specific range from any tab (A1 notation) |
79
+ | `gdrive_write_sheet_range` | Write data to a specific range |
80
+
81
+ ### Google Slides
82
+
83
+ | Tool | Description |
84
+ |------|-------------|
85
+ | `gdrive_create_slides` | Create a new presentation |
86
+ | `gdrive_export_slides` | Export slides to text, PDF, or PPTX |
87
+ | `gdrive_get_slide_thumbnail` | Get a thumbnail image URL for a specific slide |
23
88
 
24
89
  ## Prerequisites
25
90
 
26
- - Node.js 18 or later
27
- - A Google Cloud project with the Google Drive API enabled
91
+ - Node.js 18+
92
+ - A Google Cloud project with these APIs enabled:
93
+ - Google Drive API
94
+ - Google Docs API
95
+ - Google Sheets API
96
+ - Google Slides API
28
97
  - OAuth2 desktop application credentials
29
98
 
30
99
  ## Setup
31
100
 
32
- 1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/) and enable the Google Drive API
101
+ 1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/) and enable the Drive, Docs, Sheets, and Slides APIs
33
102
  2. Create OAuth2 credentials (Application type: Desktop app) and download the JSON file
34
103
  3. Save the credentials file:
35
104
 
@@ -42,21 +111,32 @@ chmod 600 ~/.config/mcp-google-gdrive/credentials.json
42
111
  4. Run the one-time authorization flow:
43
112
 
44
113
  ```bash
45
- npx mcp-google-gdrive --auth
114
+ npx mcp-google-gdrive --auth primary
46
115
  ```
47
116
 
48
- This opens a URL for Google consent. After granting access, paste the authorization code back into the terminal. The token is saved to `~/.config/mcp-google-gdrive/token.json`.
117
+ This prints a URL for Google consent. After granting access, paste the authorization code back into the terminal.
118
+
119
+ ### Multi-Account Setup
120
+
121
+ Add additional accounts with unique labels:
122
+
123
+ ```bash
124
+ npx mcp-google-gdrive --auth work
125
+ npx mcp-google-gdrive --auth personal
126
+ ```
127
+
128
+ Each account gets its own token file at `~/.config/mcp-google-gdrive/tokens/{label}.json`. Use the `account` parameter on any tool to specify which account to use, or call `gdrive_switch_account` to change the default.
49
129
 
50
130
  ## Configuration
51
131
 
52
- ### Claude Code
132
+ ### Gemini CLI
53
133
 
54
- Add to `~/.claude/settings.json`:
134
+ Add to `~/.gemini/settings.json`:
55
135
 
56
136
  ```json
57
137
  {
58
138
  "mcpServers": {
59
- "google-drive": {
139
+ "google-gdrive": {
60
140
  "command": "npx",
61
141
  "args": ["-y", "mcp-google-gdrive"]
62
142
  }
@@ -64,29 +144,31 @@ Add to `~/.claude/settings.json`:
64
144
  }
65
145
  ```
66
146
 
67
- ### VS Code / Cursor
147
+ ### watsonx Orchestrate
68
148
 
69
- Add to `.vscode/mcp.json`:
149
+ ```bash
150
+ orchestrate toolkits import --kind mcp \
151
+ --name google-gdrive \
152
+ --description "Google Drive, Docs, Sheets, Slides" \
153
+ --command "npx -y mcp-google-gdrive" \
154
+ --tools "*"
155
+ ```
70
156
 
71
- ```json
72
- {
73
- "servers": {
74
- "google-drive": {
75
- "command": "npx",
76
- "args": ["-y", "mcp-google-gdrive"]
77
- }
78
- }
79
- }
157
+ ### Claude Code
158
+
159
+ ```bash
160
+ claude mcp add -s user google-gdrive -- npx -y mcp-google-gdrive
80
161
  ```
81
162
 
82
- ### Gemini CLI
163
+ ### VS Code / Cursor
83
164
 
84
- Add to `~/.gemini/settings.json`:
165
+ Add to `.vscode/mcp.json` in your workspace:
85
166
 
86
167
  ```json
87
168
  {
88
169
  "mcpServers": {
89
- "google-drive": {
170
+ "google-gdrive": {
171
+ "type": "stdio",
90
172
  "command": "npx",
91
173
  "args": ["-y", "mcp-google-gdrive"]
92
174
  }
@@ -96,9 +178,25 @@ Add to `~/.gemini/settings.json`:
96
178
 
97
179
  ## Authentication
98
180
 
99
- The server uses OAuth2 for Google Drive access. On first run with `--auth`, it generates an authorization URL for browser-based consent. After authorization, tokens are stored locally at `~/.config/mcp-google-gdrive/token.json` with restricted file permissions (0600).
181
+ The server uses OAuth2 for Google Drive access. Credentials are stored locally:
182
+
183
+ - `~/.config/mcp-google-gdrive/credentials.json` — OAuth2 client (shared across accounts)
184
+ - `~/.config/mcp-google-gdrive/tokens/{label}.json` — Per-account tokens (chmod 600)
185
+ - `~/.config/mcp-google-gdrive/config.json` — Active account and account registry
186
+
187
+ Access tokens expire after one hour and are refreshed automatically using stored refresh tokens. Token refresh is transparent and requires no user interaction.
188
+
189
+ ### Migrating from v0.x
190
+
191
+ If upgrading from a single-account v0.x installation, the server automatically migrates your existing `token.json` to `tokens/primary.json` on first start.
192
+
193
+ ## Related MCP Servers
100
194
 
101
- Access tokens expire after one hour and are refreshed automatically using the stored refresh token. Token refresh is transparent and requires no user interaction.
195
+ - [mcp-redhat-account](https://github.com/sleepytimeshon/mcp-redhat-account) - Red Hat account management
196
+ - [mcp-redhat-knowledge](https://github.com/sleepytimeshon/mcp-redhat-knowledge) - Red Hat Knowledge Base search
197
+ - [mcp-redhat-manpage](https://github.com/sleepytimeshon/mcp-redhat-manpage) - RHEL man pages
198
+ - [mcp-redhat-subscription](https://github.com/sleepytimeshon/mcp-redhat-subscription) - Subscription management
199
+ - [mcp-redhat-support](https://github.com/sleepytimeshon/mcp-redhat-support) - Support case management
102
200
 
103
201
  ## License
104
202
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-google-gdrive",
3
- "version": "0.1.0",
4
- "description": "MCP server for Google Drive API with full file management and Workspace format conversion",
3
+ "version": "2.0.0",
4
+ "description": "MCP server for Google Drive, Docs, Sheets, and Slides with multi-account support, permissions, labels, and full CRUD",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "mcp-google-gdrive": "./src/index.js"
@@ -14,8 +14,12 @@
14
14
  "keywords": [
15
15
  "mcp",
16
16
  "google-drive",
17
+ "google-docs",
18
+ "google-sheets",
19
+ "google-slides",
17
20
  "google-workspace",
18
- "file-management"
21
+ "file-management",
22
+ "multi-account"
19
23
  ],
20
24
  "license": "MIT",
21
25
  "repository": {