@cl0ud95/google-workspace-mcp
v1.2.2
Published
MCP server for Google Drive and Sheets via Apps Script proxy
Maintainers
Readme
Google Workspace MCP
MCP server for Google Drive and Sheets, backed by a Google Apps Script proxy running in the client's Google account.
How It Works
Agent Container → MCP Server (stdio) → HTTP → Apps Script (Google) → Drive/Sheets API- Apps Script runs in the client's Google account — handles auth via Google session, scopes all operations to a configurable root folder
- MCP Server (this repo) translates MCP tool calls into HTTP requests to the Apps Script URL
- No credentials in the container — just a URL and API key env var
Setup
1. Deploy the Apps Script
- Go to script.google.com and create a new project
- Replace the default
Code.gswith the contents ofapps-script/Code.gs - Configure script properties (File > Project properties > Script properties):
ROOT_FOLDER_ID— the Google Drive folder ID that scopes all operations (copy from the URL:https://drive.google.com/drive/folders/{THIS_IS_THE_ID})APPS_SCRIPT_API_KEY— a secret key of your choosing (e.g. a random string)
- Deploy as web app:
- Click Deploy > New deployment
- Type: Web app
- Execute as: Me
- Who has access: Anyone
- Copy the resulting URL
2. Configure the MCP Server
{
"mcpServers": {
"google-apps": {
"command": "node",
"args": ["/path/to/google-workspace-mcp/dist/index.js"],
"env": {
"GOOGLE_APPS_SCRIPT_URL": "https://script.google.com/macros/s/{YOUR_SCRIPT_ID}/exec",
"GOOGLE_APPS_SCRIPT_API_KEY": "your-api-key-here"
}
}
}
}3. Verify
curl "https://script.google.com/macros/s/{YOUR_SCRIPT_ID}/exec?action=drive_list&api_key=your-api-key-here"Should return a JSON response with { "success": true, ... }.
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| GOOGLE_APPS_SCRIPT_URL | Yes | — | Deployed Apps Script web app URL |
| GOOGLE_APPS_SCRIPT_API_KEY | Yes | — | Must match APPS_SCRIPT_API_KEY in Script Properties |
| GOOGLE_SERVICES | No | drive,sheets | Comma-separated list of enabled services |
| GOOGLE_READONLY | No | false | If true, only read tools are registered |
| GOOGLE_TIMEOUT | No | 30000 | HTTP timeout in ms |
Service Filtering
Only register tools the agent needs — saves context tokens:
"GOOGLE_SERVICES": "sheets" // Only Sheets tools
"GOOGLE_SERVICES": "drive,sheets" // Both (default)
"GOOGLE_SERVICES": "drive" // Only Drive toolsRead-Only Mode
For agents that should only observe, not modify:
"GOOGLE_READONLY": "true"Tools
Drive (12 tools)
| Tool | R/W | Description |
|------|-----|-------------|
| drive_list_files | R | List files in folder (paginated) |
| drive_get_file | R | Get file metadata |
| drive_read_file | R | Read text file content (truncates at 1MB) |
| drive_download | R | Get download URL for binary files |
| drive_search | R | Search files by name in root tree |
| drive_tree | R | Get folder tree structure |
| drive_create_folder | W | Create folder |
| drive_create_file | W | Create text file |
| drive_update_file | W | Update file content |
| drive_move_file | W | Move file to different folder |
| drive_rename_file | W | Rename file/folder |
| drive_delete_file | W | Trash file/folder |
Sheets (12 tools)
| Tool | R/W | Description |
|------|-----|-------------|
| sheets_list | R | List all spreadsheets in root folder tree |
| sheets_get_info | R | Get spreadsheet metadata and sheets |
| sheets_get_sheet | R | Get specific sheet/tab metadata |
| sheets_read_cell | R | Read single cell |
| sheets_read_range | R | Read range (truncates at 10k rows) |
| sheets_read_all | R | Read entire sheet |
| sheets_write_cell | W | Write single cell |
| sheets_write_range | W | Write 2D array to range |
| sheets_append_row | W | Append row to end of sheet |
| sheets_clear_range | W | Clear range values |
| sheets_create_sheet | W | Create new sheet/tab |
| sheets_create_spreadsheet | W | Create new spreadsheet file |
| sheets_delete_sheet | W | Delete sheet/tab |
Sheets tools accept either spreadsheet_id (direct file ID) or spreadsheet_name (searches root folder tree).
NanoClaw Agent Config
Add to clients/{client}/agents/{agent}/.mcp.json:
{
"mcpServers": {
"google-apps": {
"command": "node",
"args": ["/path/to/google-workspace-mcp/dist/index.js"],
"env": {
"GOOGLE_APPS_SCRIPT_URL": "https://script.google.com/macros/s/{SCRIPT_ID}/exec",
"GOOGLE_APPS_SCRIPT_API_KEY": "your-api-key-here",
"GOOGLE_SERVICES": "sheets",
"GOOGLE_READONLY": "true"
}
}
}
}Build
npm install
npm run build