{"_id":"@emit-ia/gdrive-mcp-server","_rev":"2-72645892b7655569db16aeb66530c474","name":"@emit-ia/gdrive-mcp-server","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@emit-ia/gdrive-mcp-server","version":"1.0.1","keywords":["mcp","google-drive","gmail","google-workspace","api","server","model-context-protocol","ai","llm"],"author":{"name":"emit-ia"},"license":"MIT","_id":"@emit-ia/gdrive-mcp-server@1.0.1","maintainers":[{"name":"emit-ia","email":"Igor.almeida1993@gmail.com"}],"homepage":"https://github.com/emit-ia/gdrive-mcp#readme","bugs":{"url":"https://github.com/emit-ia/gdrive-mcp/issues"},"bin":{"gdrive-mcp-server":"dist/index.js"},"dist":{"shasum":"93cd50a64757acbcc8c81004f3d0436cbcf54dc4","tarball":"https://registry.npmjs.org/@emit-ia/gdrive-mcp-server/-/gdrive-mcp-server-1.0.1.tgz","fileCount":27,"integrity":"sha512-En7mTST71q1bfm2iL/2X1Yj/OpYxMRvVBwtLNXaw9ZpqlL4ryap+xSYW7cZUr5GrWGFEXdcx6UNuSAYVrGlQyA==","signatures":[{"sig":"MEUCIE0toyEMQxStYGpeKmOAPPpicRNsRlqWG9uYDslBCVV2AiEAsR0qLEqA9fNS2CLJC3azfDv04ekrQSDHUEsPOBUwzFk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":165650},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"b1f878b37b8e987e545cbc55dade5dc3fcc4c3c4","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"emit-ia","email":"Igor.almeida1993@gmail.com"},"repository":{"url":"git+https://github.com/emit-ia/gdrive-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Google Drive MCP Server - Model Context Protocol server for Google Drive and Gmail APIs","directories":{},"_nodeVersion":"20.19.2","dependencies":{"zod":"^3.22.4","dotenv":"^16.3.1","googleapis":"^128.0.0","@modelcontextprotocol/sdk":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.6.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/gdrive-mcp-server_1.0.1_1749749011732_0.978880436776346","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@emit-ia/gdrive-mcp-server","version":"1.0.2","description":"Google Drive MCP Server - Model Context Protocol server for Google Drive and Gmail APIs","main":"dist/index.js","type":"module","scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsx src/index.ts","prepare":"npm run build"},"bin":{"gdrive-mcp-server":"dist/index.js"},"keywords":["mcp","google-drive","gmail","google-workspace","api","server","model-context-protocol","ai","llm"],"author":{"name":"emit-ia"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/emit-ia/gdrive-mcp.git"},"homepage":"https://github.com/emit-ia/gdrive-mcp#readme","bugs":{"url":"https://github.com/emit-ia/gdrive-mcp/issues"},"dependencies":{"@modelcontextprotocol/sdk":"^0.4.0","googleapis":"^128.0.0","dotenv":"^16.3.1","zod":"^3.22.4"},"devDependencies":{"@types/node":"^20.10.0","typescript":"^5.3.0","tsx":"^4.6.0"},"engines":{"node":">=18.0.0"},"_id":"@emit-ia/gdrive-mcp-server@1.0.2","gitHead":"1896c8021e34ad09306b9ee305f4c352b41fa955","types":"./dist/index.d.ts","_nodeVersion":"20.19.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-hP4i79nY/KyjS+9uFh2ga3J2YeaM3NrFEub7/rL4pUkZpL+sOb18PFYSJr3STQD7ISWZo7cDZe00vnNr3rBx1g==","shasum":"3ac8ffb16db26104bfba3d7aa860f53fe494bef2","tarball":"https://registry.npmjs.org/@emit-ia/gdrive-mcp-server/-/gdrive-mcp-server-1.0.2.tgz","fileCount":27,"unpackedSize":187192,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD6pNDbEtvs0SA7LB9WbI4z+ywfnrEzVijkv0Een30OowIgEr9ayMu+g/veR8W3QrKDl4KEO8UIEj87pfA1yHpSLNU="}]},"_npmUser":{"name":"emit-ia","email":"Igor.almeida1993@gmail.com","actor":{"name":"emit-ia","email":"Igor.almeida1993@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"emit-ia","email":"Igor.almeida1993@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gdrive-mcp-server_1.0.2_1750263709301_0.39841826505776723"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-12T17:23:31.644Z","modified":"2025-06-18T16:21:49.669Z","1.0.1":"2025-06-12T17:23:31.963Z","1.0.2":"2025-06-18T16:21:49.478Z"},"bugs":{"url":"https://github.com/emit-ia/gdrive-mcp/issues"},"author":{"name":"emit-ia"},"license":"MIT","homepage":"https://github.com/emit-ia/gdrive-mcp#readme","keywords":["mcp","google-drive","gmail","google-workspace","api","server","model-context-protocol","ai","llm"],"repository":{"type":"git","url":"git+https://github.com/emit-ia/gdrive-mcp.git"},"description":"Google Drive MCP Server - Model Context Protocol server for Google Drive and Gmail APIs","maintainers":[{"name":"emit-ia","email":"Igor.almeida1993@gmail.com"}],"readme":"# Google Drive & Gmail MCP Server\r\n\r\nModel Context Protocol server for Google Drive and Gmail APIs with hybrid authentication.\r\n\r\n## Key Features\r\n\r\n- **Hybrid Authentication**: Service Account (Drive) + OAuth2 (Gmail)\r\n- **Automatic Token Management**: Prevents 6-month Gmail token expiration\r\n- **Complete API Coverage**: Full Google Drive and Gmail functionality\r\n- **Intelligent Rate Limiting**: Automatic Gmail API rate limit management\r\n- **Batch Processing**: Efficient processing of large Gmail accounts (34K+ messages)\r\n- **Smart Analysis**: Pre-built analysis tools for common Gmail operations\r\n\r\n## API Coverage\r\n\r\n**Google Drive**: Files, folders, sharing, search, comments, revisions, account info  \r\n**Gmail**: Messages, sending, search, read/unread, profile, token management\r\n\r\n## Installation\r\n\r\n```bash\r\n# Global installation\r\nnpm install -g gdrive-mcp-server\r\n\r\n# Or run directly with npx (recommended)\r\nnpx gdrive-mcp-server\r\n\r\n# Or local development\r\ngit clone https://github.com/igoralmeida1993/gdrive-mcp.git\r\ncd gdrive-mcp\r\nnpm install && npm run build\r\n```\r\n\r\n## Setup\r\n\r\n### 1. Google Cloud Console Setup\r\n\r\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/)\r\n2. Create a new project or select an existing one\r\n3. Enable the Google Drive API:\r\n   - Go to \"APIs & Services\" > \"Library\"\r\n   - Search for \"Google Drive API\"\r\n   - Click \"Enable\"\r\n\r\n### 2. Create Credentials\r\n\r\n**Service Account** (for Google Drive):\r\n1. Google Cloud Console > \"Credentials\" > \"Service Account\"\r\n2. Download JSON key, extract `client_email` and `private_key`\r\n\r\n**OAuth 2.0** (for Gmail):\r\n1. Google Cloud Console > \"Credentials\" > \"OAuth 2.0 Client IDs\"\r\n2. Desktop application type\r\n3. Generate refresh token via [OAuth Playground](https://developers.google.com/oauthplayground)\r\n\r\n> See [HYBRID-AUTH-SETUP.md](./HYBRID-AUTH-SETUP.md) for detailed steps.\r\n\r\n### 3. Configure Environment\r\n\r\n```bash\r\ncp env.example .env\r\n# Edit .env with your credentials\r\n```\r\n\r\n## Environment Variables (.env file)\r\n\r\n```bash\r\n# Google Drive & Gmail MCP Server Configuration\r\n# Get these from Google Cloud Console (https://console.cloud.google.com/)\r\n\r\n# OAuth 2.0 Credentials (REQUIRED for Gmail functionality)\r\nGOOGLE_CLIENT_ID=your_client_id_here.apps.googleusercontent.com\r\nGOOGLE_CLIENT_SECRET=your_client_secret_here\r\nGOOGLE_REDIRECT_URI=https://developers.google.com/oauthplayground\r\nGOOGLE_REFRESH_TOKEN=your_refresh_token_here\r\n\r\n# Service Account Credentials (REQUIRED for Google Drive functionality)\r\nGOOGLE_SERVICE_ACCOUNT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com\r\nGOOGLE_PRIVATE_KEY=\"-----BEGIN PRIVATE KEY-----\\nYour private key here\\n-----END PRIVATE KEY-----\"\r\n\r\n# MCP Server Configuration\r\nMCP_SERVER_NAME=gdrive-mcp-server\r\nMCP_SERVER_VERSION=1.0.0\r\n\r\n# Optional: Default folder to operate in (leave empty for root)\r\nDEFAULT_FOLDER_ID=\r\n\r\n# Optional: File size limits (in bytes)\r\nMAX_FILE_SIZE=104857600  # 100MB default\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Running the Server\r\n\r\n```bash\r\n# If installed globally\r\ngdrive-mcp-server\r\n\r\n# If running from source\r\nnpm start\r\n\r\n# For development\r\nnpm run dev\r\n```\r\n\r\n### 4. MCP Client Configuration\r\n\r\nClaude Desktop configuration:\r\n```json\r\n{\r\n  \"mcpServers\": {\r\n    \"google-workspace\": {\r\n      \"command\": \"npx\",\r\n      \"args\": [\"gdrive-mcp-server\"],\r\n      \"env\": {\r\n        \"GOOGLE_CLIENT_ID\": \"your_client_id\",\r\n        \"GOOGLE_CLIENT_SECRET\": \"your_client_secret\",\r\n        \"GOOGLE_REFRESH_TOKEN\": \"your_refresh_token\",\r\n        \"GOOGLE_SERVICE_ACCOUNT_EMAIL\": \"your-service-account@project.iam.gserviceaccount.com\",\r\n        \"GOOGLE_PRIVATE_KEY\": \"-----BEGIN PRIVATE KEY-----\\nYour private key\\n-----END PRIVATE KEY-----\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## Available Tools\r\n\r\n**Google Drive**: `gdrive_list_files`, `gdrive_get_file`, `gdrive_download_file`, `gdrive_upload_file`, `gdrive_update_file`, `gdrive_delete_file`, `gdrive_copy_file`, `gdrive_move_file`, `gdrive_create_folder`, `gdrive_get_folder_info`, `gdrive_share_file`, `gdrive_get_permissions`, `gdrive_remove_permission`, `gdrive_search`, `gdrive_get_recent_files`, `gdrive_get_comments`, `gdrive_add_comment`, `gdrive_get_revisions`, `gdrive_get_about`, `gdrive_empty_trash`\r\n\r\n**Gmail**: `gmail_list_messages`, `gmail_get_message`, `gmail_send_message`, `gmail_search_messages`, `gmail_mark_as_read`, `gmail_mark_as_unread`, `gmail_get_profile`, `gmail_check_token_status`, `gmail_refresh_token`, `gmail_batch_process_messages`, `gmail_smart_analysis`\r\n\r\n## Usage Examples\r\n\r\n```javascript\r\n// List Drive files\r\n{ \"tool\": \"gdrive_list_files\", \"arguments\": { \"maxResults\": 50 } }\r\n\r\n// Upload file\r\n{ \"tool\": \"gdrive_upload_file\", \"arguments\": { \"name\": \"test.txt\", \"content\": \"Hello\" } }\r\n\r\n// Send email\r\n{ \"tool\": \"gmail_send_message\", \"arguments\": { \"to\": \"user@example.com\", \"subject\": \"Test\", \"body\": \"Hello!\" } }\r\n\r\n// Search emails\r\n{ \"tool\": \"gmail_search_messages\", \"arguments\": { \"query\": \"is:unread\", \"maxResults\": 10 } }\r\n\r\n// Smart analysis for large accounts\r\n{ \"tool\": \"gmail_smart_analysis\", \"arguments\": { \"analysisType\": \"recent\", \"maxMessages\": 500, \"daysBack\": 7 } }\r\n\r\n// Batch process specific messages\r\n{ \"tool\": \"gmail_batch_process_messages\", \"arguments\": { \"messageIds\": [\"id1\", \"id2\"], \"batchSize\": 20 } }\r\n```\r\n\r\n## Security\r\n\r\n- Never commit `.env` files to version control\r\n- Use environment variables in production\r\n- Server automatically refreshes Gmail tokens\r\n- Use minimal required OAuth scopes\r\n\r\n## Troubleshooting\r\n\r\n### Common Issues\r\n\r\n- **\"Gmail requires OAuth2\"**: Set OAuth credentials in .env\r\n- **\"Drive requires Service Account\"**: Set Service Account credentials in .env\r\n- **Authentication Error**: Verify credentials and enable APIs in Google Cloud Console\r\n- **Token Expired**: Use `gmail_check_token_status` and `gmail_refresh_token`\r\n\r\n### Help\r\n\r\n- [HYBRID-AUTH-SETUP.md](./HYBRID-AUTH-SETUP.md) - Detailed setup guide\r\n- [Google Drive API Docs](https://developers.google.com/drive/api)\r\n- [Gmail API Docs](https://developers.google.com/gmail/api)\r\n\r\n## Development\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Run in development mode\r\nnpm run dev\r\n\r\n# Build\r\nnpm run build\r\n\r\n# Run tests (if available)\r\nnpm test\r\n```\r\n\r\n## License\r\n\r\nMIT License - see LICENSE file for details\r\n\r\n## License\r\n\r\nMIT\r\n\r\n ","readmeFilename":"README.md"}