mcp-google-gdrive 0.1.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 (5) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/SPEC.md +917 -0
  4. package/package.json +35 -0
  5. package/src/index.js +487 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shon Stephens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # mcp-google-gdrive
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).
4
+
5
+ ## Tools
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 |
23
+
24
+ ## Prerequisites
25
+
26
+ - Node.js 18 or later
27
+ - A Google Cloud project with the Google Drive API enabled
28
+ - OAuth2 desktop application credentials
29
+
30
+ ## Setup
31
+
32
+ 1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/) and enable the Google Drive API
33
+ 2. Create OAuth2 credentials (Application type: Desktop app) and download the JSON file
34
+ 3. Save the credentials file:
35
+
36
+ ```bash
37
+ mkdir -p ~/.config/mcp-google-gdrive
38
+ cp ~/Downloads/client_secret_*.json ~/.config/mcp-google-gdrive/credentials.json
39
+ chmod 600 ~/.config/mcp-google-gdrive/credentials.json
40
+ ```
41
+
42
+ 4. Run the one-time authorization flow:
43
+
44
+ ```bash
45
+ npx mcp-google-gdrive --auth
46
+ ```
47
+
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`.
49
+
50
+ ## Configuration
51
+
52
+ ### Claude Code
53
+
54
+ Add to `~/.claude/settings.json`:
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "google-drive": {
60
+ "command": "npx",
61
+ "args": ["-y", "mcp-google-gdrive"]
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ ### VS Code / Cursor
68
+
69
+ Add to `.vscode/mcp.json`:
70
+
71
+ ```json
72
+ {
73
+ "servers": {
74
+ "google-drive": {
75
+ "command": "npx",
76
+ "args": ["-y", "mcp-google-gdrive"]
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ ### Gemini CLI
83
+
84
+ Add to `~/.gemini/settings.json`:
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "google-drive": {
90
+ "command": "npx",
91
+ "args": ["-y", "mcp-google-gdrive"]
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ ## Authentication
98
+
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).
100
+
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.
102
+
103
+ ## License
104
+
105
+ MIT