{"_id":"@arvoretech/google-drive-mcp","_rev":"4-b19eb5a706d695b055bcf3c166f46979","name":"@arvoretech/google-drive-mcp","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@arvoretech/google-drive-mcp","version":"1.0.0","keywords":["mcp","google-drive","google-workspace","drive","oauth","llm","ai","arvore"],"author":{"name":"Arvore"},"license":"MIT","_id":"@arvoretech/google-drive-mcp@1.0.0","maintainers":[{"name":"joao.barros.arvore","email":"joao.barros@arvore.com.br"},{"name":"ricardoraposorfox","email":"ricardorbxx1@gmail.com"},{"name":"vitor.piovezan","email":"vitor.piovezan@arvore.com.br"}],"homepage":"https://github.com/arvoreeducacao/arvore-mcp-servers#readme","bugs":{"url":"https://github.com/arvoreeducacao/arvore-mcp-servers/issues"},"bin":{"google-drive-mcp":"dist/index.js"},"dist":{"shasum":"5e0b937d0b6ec7b57b41cefe915ca3318e633f0c","tarball":"https://registry.npmjs.org/@arvoretech/google-drive-mcp/-/google-drive-mcp-1.0.0.tgz","fileCount":16,"integrity":"sha512-KKCJ3HE/9YP7tzwhzOBD9KyaO7PQX/C6gjiRbWfbFcYeO+dDG8eMnaA5fp0Z67n22nUyXNgbZDDsF0ZUk8H7FA==","signatures":[{"sig":"MEUCIQDLea+uIGwJkYzO2OIwTejf6hZXPjDjYsAFWN65LaR8+wIgfcPvm2gll41t2ieC13fx2cOjHIdT8U+Niwu2cyDiZgE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114294},"main":"dist/index.js","type":"module","gitHead":"d7bfd16041bda645304e2cedbbb8b799c5e227b0","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/**/*.ts","test":"vitest run --passWithNoTests","build":"tsc","start":"node dist/index.js","lint:fix":"eslint src/**/*.ts --fix","test:cov":"vitest run --coverage --passWithNoTests","prepublishOnly":"pnpm build"},"_npmUser":{"name":"joao.barros.arvore","email":"joao.barros@arvore.com.br"},"repository":{"url":"git+https://github.com/arvoreeducacao/arvore-mcp-servers.git","type":"git","directory":"packages/google-drive"},"_npmVersion":"10.9.4","description":"Google Drive MCP Server — list, search, download, upload, and manage Google Drive files via OAuth user flow","directories":{},"_nodeVersion":"22.21.1","dependencies":{"zod":"^3.22.4","@modelcontextprotocol/sdk":"~1.22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/google-drive-mcp_1.0.0_1780499143270_0.147294915334387","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-03T15:05:43.089Z","modified":"2026-06-16T21:13:12.767Z","1.0.0":"2026-06-03T15:05:43.421Z"},"bugs":{"url":"https://github.com/arvoreeducacao/arvore-mcp-servers/issues"},"author":{"name":"Arvore"},"license":"MIT","homepage":"https://github.com/arvoreeducacao/arvore-mcp-servers#readme","keywords":["mcp","google-drive","google-workspace","drive","oauth","llm","ai","arvore"],"repository":{"url":"git+https://github.com/arvoreeducacao/arvore-mcp-servers.git","type":"git","directory":"packages/google-drive"},"description":"Google Drive MCP Server — list, search, download, upload, and manage Google Drive files via OAuth user flow","maintainers":[{"email":"joao.barros@arvore.com.br","name":"joao.barros.arvore"},{"email":"rafasouza@protonmail.com","name":"rafsouza"},{"email":"pedro.adas@gmail.com","name":"pedro.adas"},{"email":"guilhermebscontact@gmail.com","name":"guilhermebs"},{"email":"ricardorbxx1@gmail.com","name":"ricardoraposorfox"},{"email":"jvgcunha2002@gmail.com","name":"jott4"},{"email":"vitor.piovezan@arvore.com.br","name":"vitor.piovezan"}],"readme":"# @arvoretech/google-drive-mcp\n\nMCP server for Google Drive — list, search, download, upload, and manage files from your AI assistant. OAuth user flow (no service account required).\n\n## Tools\n\n| Tool                   | Description                                                                                              |\n| ---------------------- | -------------------------------------------------------------------------------------------------------- |\n| `files_list`           | List/search files using Drive query syntax (`name contains 'X'`, `mimeType=...`, `'<id>' in parents`)    |\n| `files_get`            | Get a file's metadata                                                                                    |\n| `files_download`       | Download a file to an absolute local path. Supports Google Docs/Sheets/Slides export                     |\n| `files_upload`         | Upload a local file (with optional folder destination)                                                   |\n| `files_update_content` | Replace the content of an existing file with bytes from a local path                                     |\n| `files_create_folder`  | Create a folder                                                                                          |\n| `files_move`           | Move and/or rename                                                                                       |\n| `files_delete`         | Trash (default) or permanently delete (gated)                                                            |\n| `files_share`          | Add a permission (gated by `GDRIVE_MCP_ALLOW_SHARE=true`)                                                |\n| `extract_images`       | Download image files and return them as image content blocks for the model to analyze (Slack/Linear style) |\n| `about_get`            | Authenticated user info + storage quota                                                                  |\n\nShared Drives are supported by default — calls use `supportsAllDrives=true` and `corpora=allDrives` so files in Shared Drives appear in `files_list`.\n\n## Setup\n\n### 1. Create OAuth Client in Google Cloud Console\n\n1. Open the [Cloud Console](https://console.cloud.google.com/apis/credentials)\n2. Select or create a project\n3. Enable the [Drive API](https://console.cloud.google.com/apis/library/drive.googleapis.com)\n4. Open **OAuth consent screen**:\n   - User type: **External**\n   - Add yourself under **Test users** (required while the app is in testing mode)\n5. Open **Credentials** → **Create Credentials** → **OAuth client ID**:\n   - Application type: **Desktop app**\n   - Save the `client_id` and `client_secret`\n\n### 2. Authorize\n\n```bash\nexport GDRIVE_MCP_CLIENT_ID=\"your-client-id\"\nexport GDRIVE_MCP_CLIENT_SECRET=\"your-client-secret\"\n\nnpx @arvoretech/google-drive-mcp auth login\n```\n\nThis opens your browser, you sign in and approve the Drive scope, and the MCP captures the refresh token. Credentials are encrypted at rest (AES-256-GCM) with the key stored in:\n\n- macOS: the system keychain (`security` utility, service `arvoretech-google-drive-mcp`)\n- Other platforms: a file at `~/.config/arvoretech-google-drive-mcp/.encryption_key` (mode 0600)\n\n### 3. Use as MCP server\n\nAdd to your MCP client config (Kiro, Claude Desktop, Cursor, etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"google-drive\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arvoretech/google-drive-mcp\"],\n      \"env\": {\n        \"GDRIVE_MCP_CLIENT_ID\": \"your-client-id\",\n        \"GDRIVE_MCP_CLIENT_SECRET\": \"your-client-secret\",\n        \"GDRIVE_MCP_ALLOW_SHARE\": \"false\",\n        \"GDRIVE_MCP_ALLOW_PERMANENT_DELETE\": \"false\"\n      }\n    }\n  }\n}\n```\n\n## Subcommands\n\n| Command                          | Description                              |\n| -------------------------------- | ---------------------------------------- |\n| `google-drive-mcp auth login`    | Browser-based OAuth flow                 |\n| `google-drive-mcp auth logout`   | Revoke refresh token and clear credentials |\n| `google-drive-mcp auth status`   | Print current auth status                |\n| `google-drive-mcp` (no args)     | Run as MCP stdio server                  |\n\n## Environment Variables\n\n| Variable                              | Required | Description                                                            |\n| ------------------------------------- | -------- | ---------------------------------------------------------------------- |\n| `GDRIVE_MCP_CLIENT_ID`                | Yes      | OAuth client ID from Google Cloud Console                              |\n| `GDRIVE_MCP_CLIENT_SECRET`            | Yes      | OAuth client secret                                                    |\n| `GDRIVE_MCP_ALLOW_SHARE`              | No       | Set to `true` to enable `files_share`                                  |\n| `GDRIVE_MCP_ALLOW_PERMANENT_DELETE`   | No       | Set to `true` to allow `files_delete` with `permanent=true`            |\n| `GDRIVE_MCP_REFRESH_TOKEN`            | No       | Bypass the token store and use a refresh token directly (CI / Docker) |\n| `GDRIVE_MCP_CONFIG_DIR`               | No       | Override config directory (default: `~/.config/arvoretech-google-drive-mcp`) |\n| `GDRIVE_MCP_REDIRECT_PORT`            | No       | Force a specific port for the OAuth callback (default: random)         |\n| `GDRIVE_MCP_LOGIN_HINT`               | No       | Pre-fill the email address in the consent screen                       |\n\n## OAuth Scopes\n\nThe MCP requests the full Drive scope (`https://www.googleapis.com/auth/drive`) so it can read, create, modify, and delete files. To restrict access, edit `DEFAULT_SCOPES` in `src/oauth.ts` before `auth login` and re-authorize. Common alternatives:\n\n- `https://www.googleapis.com/auth/drive.file` — only files created or opened by this app\n- `https://www.googleapis.com/auth/drive.readonly` — read-only access\n\n## Downloading Google-native files\n\nGoogle Docs, Sheets, Slides, and Drawings are exported on download. Pass `exportMimeType` to `files_download` (defaults below):\n\n| Drive type     | Default export                                                                                |\n| -------------- | --------------------------------------------------------------------------------------------- |\n| Google Docs    | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (.docx)             |\n| Google Sheets  | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (.xlsx)                   |\n| Google Slides  | `application/vnd.openxmlformats-officedocument.presentationml.presentation` (.pptx)           |\n| Google Drawing | `image/png`                                                                                    |\n\nOther useful export types: `application/pdf`, `text/csv`, `text/plain`, `text/html`, `application/rtf`, `application/zip`.\n\n## Headless / CI usage\n\nFor environments without a browser or keychain (Docker, EKS, GitHub Actions):\n\n1. Run `google-drive-mcp auth login` once on a machine with a browser.\n2. Read the refresh token from the saved credentials and pass it through:\n\n```bash\nexport GDRIVE_MCP_CLIENT_ID=\"...\"\nexport GDRIVE_MCP_CLIENT_SECRET=\"...\"\nexport GDRIVE_MCP_REFRESH_TOKEN=\"1//0g...\"\ngoogle-drive-mcp\n```\n\nWhen `GDRIVE_MCP_REFRESH_TOKEN` is set, the disk store is bypassed entirely.\n\n## Development\n\n```bash\npnpm install\npnpm build\npnpm test\npnpm lint\n```\n\n## Security notes\n\n- Refresh tokens are long-lived. Treat them like passwords.\n- The encryption key never leaves your machine — it lives in the macOS keychain or a `0600` file.\n- `files_share` is gated behind `GDRIVE_MCP_ALLOW_SHARE` so an agent can't grant access without you opting in.\n- `files_delete` with `permanent=true` is gated behind `GDRIVE_MCP_ALLOW_PERMANENT_DELETE`. Default is trash (reversible).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}