mcp-gsheets 1.6.0 β 1.7.1
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.
- package/README.md +102 -27
- package/dist/index.js +16130 -9521
- package/package.json +17 -16
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
12
|
-

|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
A Model Context Protocol (MCP) server for Google Sheets API integration. Enables reading, writing, and managing Google Sheets documents directly from your MCP client (e.g., Claude Code, Claude Desktop, Cursor, etc.).
|
|
@@ -23,7 +23,7 @@ A Model Context Protocol (MCP) server for Google Sheets API integration. Enables
|
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
|
26
|
-
- [Node.js](https://nodejs.org/)
|
|
26
|
+
- [Node.js](https://nodejs.org/) v20 or higher
|
|
27
27
|
- [Google Cloud Project](https://console.cloud.google.com) with Sheets API enabled
|
|
28
28
|
- Service Account with JSON key file
|
|
29
29
|
- [npm](https://www.npmjs.com/)
|
|
@@ -313,40 +313,70 @@ npm run dev # Watch mode with auto-reload
|
|
|
313
313
|
## π Available Tools
|
|
314
314
|
|
|
315
315
|
### Reading Data
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
|
|
317
|
+
| Tool | Description | Key Parameters |
|
|
318
|
+
|------|-------------|----------------|
|
|
319
|
+
| `sheets_get_values` | Read cell values from a single range | `spreadsheetId`, `range` (A1 notation), `valueRenderOption` |
|
|
320
|
+
| `sheets_batch_get_values` | Read cell values from multiple ranges in one request | `spreadsheetId`, `ranges` (array of A1 ranges) |
|
|
321
|
+
| `sheets_get_metadata` | Get spreadsheet metadata: title, locale, sheets list with IDs, row/column counts | `spreadsheetId` |
|
|
322
|
+
| `sheets_check_access` | Verify that the service account can access a spreadsheet | `spreadsheetId` |
|
|
320
323
|
|
|
321
324
|
### Writing Data
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
|
|
326
|
+
| Tool | Description | Key Parameters |
|
|
327
|
+
|------|-------------|----------------|
|
|
328
|
+
| `sheets_update_values` | Write values to a single range (overwrites existing content) | `spreadsheetId`, `range`, `values` (2D array), `valueInputOption` |
|
|
329
|
+
| `sheets_batch_update_values` | Write values to multiple ranges in one request | `spreadsheetId`, `data` (array of `{range, values}`), `valueInputOption` |
|
|
330
|
+
| `sheets_append_values` | Append rows after the last row of an existing table. **Default `insertDataOption` is `OVERWRITE`** β set `INSERT_ROWS` to push existing rows down | `spreadsheetId`, `range`, `values`, `valueInputOption`, `insertDataOption` |
|
|
331
|
+
| `sheets_clear_values` | Clear all values in a range (preserves formatting) | `spreadsheetId`, `range` |
|
|
332
|
+
| `sheets_insert_rows` | Insert blank or pre-filled rows at a specific position | `spreadsheetId`, `range` (anchor), `rows`, `position` (BEFORE/AFTER), `values` |
|
|
333
|
+
| `sheets_insert_link` | Insert a hyperlink formula into a cell | `spreadsheetId`, `range`, `url`, `label` |
|
|
334
|
+
| `sheets_insert_date` | Insert a date/datetime value formatted correctly into a cell | `spreadsheetId`, `range`, `date`, `format` |
|
|
327
335
|
|
|
328
336
|
### Sheet Management
|
|
329
|
-
- `sheets_insert_sheet` - Add new sheet
|
|
330
|
-
- `sheets_delete_sheet` - Remove sheet
|
|
331
|
-
- `sheets_duplicate_sheet` - Copy sheet
|
|
332
|
-
- `sheets_copy_to` - Copy to another spreadsheet
|
|
333
|
-
- `sheets_update_sheet_properties` - Update sheet settings
|
|
334
337
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
| Tool | Description | Key Parameters |
|
|
339
|
+
|------|-------------|----------------|
|
|
340
|
+
| `sheets_create_spreadsheet` | Create a new Google Sheets file | `title`, `sheets` (optional initial sheet configs) |
|
|
341
|
+
| `sheets_insert_sheet` | Add a new sheet tab to an existing spreadsheet | `spreadsheetId`, `title`, `index` |
|
|
342
|
+
| `sheets_delete_sheet` | Remove a sheet tab by its numeric sheet ID | `spreadsheetId`, `sheetId` |
|
|
343
|
+
| `sheets_duplicate_sheet` | Copy a sheet within the same spreadsheet | `spreadsheetId`, `sheetId`, `newSheetName`, `insertSheetIndex` |
|
|
344
|
+
| `sheets_copy_to` | Copy a sheet to a different spreadsheet | `spreadsheetId`, `sheetId`, `destinationSpreadsheetId` |
|
|
345
|
+
| `sheets_update_sheet_properties` | Rename a sheet, change tab colour, toggle grid lines, etc. | `spreadsheetId`, `sheetId`, `properties` |
|
|
346
|
+
| `sheets_batch_delete_sheets` | Delete multiple sheet tabs in one request | `spreadsheetId`, `sheetIds` (array) |
|
|
338
347
|
|
|
339
348
|
### Cell Formatting
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
349
|
+
|
|
350
|
+
| Tool | Description | Key Parameters |
|
|
351
|
+
|------|-------------|----------------|
|
|
352
|
+
| `sheets_format_cells` | Apply background colour, font style, alignment and number format to a range | `spreadsheetId`, `range`, `format` |
|
|
353
|
+
| `sheets_batch_format_cells` | Apply different formats to multiple ranges in one request | `spreadsheetId`, `requests` (array of `{range, format}`) |
|
|
354
|
+
| `sheets_update_borders` | Set or remove borders on a range (style, width, colour per side) | `spreadsheetId`, `range`, `borders` |
|
|
355
|
+
| `sheets_merge_cells` | Merge a range of cells | `spreadsheetId`, `range`, `mergeType` (MERGE_ALL / MERGE_COLUMNS / MERGE_ROWS) |
|
|
356
|
+
| `sheets_unmerge_cells` | Unmerge previously merged cells in a range | `spreadsheetId`, `range` |
|
|
357
|
+
| `sheets_add_conditional_formatting` | Add a conditional formatting rule (gradient or boolean) to a range | `spreadsheetId`, `range`, `rule` |
|
|
345
358
|
|
|
346
359
|
### Charts
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
|
|
361
|
+
| Tool | Description | Key Parameters |
|
|
362
|
+
|------|-------------|----------------|
|
|
363
|
+
| `sheets_create_chart` | Create a bar, line, pie, column or other chart on a sheet | `spreadsheetId`, `sheetId`, `chartSpec`, `position` |
|
|
364
|
+
| `sheets_update_chart` | Modify an existing chart's spec or position | `spreadsheetId`, `chartId`, `chartSpec`, `position` |
|
|
365
|
+
| `sheets_delete_chart` | Remove a chart from a spreadsheet | `spreadsheetId`, `chartId` |
|
|
366
|
+
|
|
367
|
+
### Read / Snapshot Tools
|
|
368
|
+
|
|
369
|
+
| Tool | Description | Key Parameters |
|
|
370
|
+
|------|-------------|----------------|
|
|
371
|
+
| `sheets_get_merged_cells` | Return all merged cell ranges for a sheet, with A1 notation and raw GridRange coordinates | `spreadsheetId`, `sheetName` |
|
|
372
|
+
| `sheets_get_sheet_dimensions` | Return column widths, row heights, frozen column/row counts, and hidden flags for every column and row | `spreadsheetId`, `sheetName` |
|
|
373
|
+
| `sheets_get_sheet_formatting` | Read raw cell formatting (background colour, font, borders, alignment, number format) for a range without returning cell values | `spreadsheetId`, `range` |
|
|
374
|
+
| `sheets_get_conditional_formatting` | Read all conditional formatting rules and banded (alternating-colour) ranges defined on a sheet | `spreadsheetId`, `sheetName` |
|
|
375
|
+
| `sheets_get_sheet_structure` | Lightweight structural metadata only β no per-cell data. Returns dimensions, frozen rows/cols, tab colour, column widths, row heights, hidden columns/rows, and all merges in A1 notation. Single fast API call | `spreadsheetId`, `sheetName` |
|
|
376
|
+
| `sheets_get_formatting_compact` | Read cell formatting for a range and return it as compact A1Rangeβformat pairs (run-length encoded). Identical adjacent cells are collapsed into rectangular ranges β reduces output by 90 %+ compared to per-cell data | `spreadsheetId`, `sheetName`, `range`, `useEffectiveFormat`, `fields` |
|
|
377
|
+
| `sheets_get_full_sheet_snapshot` | Master one-shot tool β returns all structural and formatting metadata (merges, dimensions, conditional formatting, and optionally cell formatting) in a single API call. Supports `fields` filter and `compactMode` to limit response size | `spreadsheetId`, `sheetName`, `includeFormattingRange`, `fields`, `compactMode` |
|
|
378
|
+
| `sheets_get_basic_filter` | Read the Basic Filter (AutoFilter) configuration for a sheet, including filtered range, sort specs, and per-column filter criteria (hidden values, conditions, colour filters) | `spreadsheetId`, `sheetName` |
|
|
379
|
+
| `sheets_get_data_validation` | Read data validation rules (checkboxes, dropdowns, custom formulas) from a sheet or range. Returns compact run-length-encoded list of unique rules grouped by cell ranges | `spreadsheetId`, `sheetName`, `range` |
|
|
350
380
|
|
|
351
381
|
## π§ Code Quality
|
|
352
382
|
|
|
@@ -426,6 +456,51 @@ Use `sheets_get_metadata` to list all sheets with their IDs.
|
|
|
426
456
|
|
|
427
457
|
## π Tool Details
|
|
428
458
|
|
|
459
|
+
### sheets_get_sheet_structure
|
|
460
|
+
|
|
461
|
+
Returns lightweight structural/dimensional metadata for a sheet without any per-cell data. Much faster and cheaper than `sheets_get_full_sheet_snapshot` when you only need layout information.
|
|
462
|
+
|
|
463
|
+
**Parameters:**
|
|
464
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
465
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
466
|
+
|
|
467
|
+
**Returns:** `sheetName`, `sheetId`, `sheetIndex`, `tabColor`, `tabColorStyle`, `dimensions` (`rowCount`, `columnCount`), `frozen` (`rowCount`, `columnCount`), `columnWidths` (array of pixel sizes), `rowHeights` (array of pixel sizes), `hiddenColumns` (0-based indices), `hiddenRows` (0-based indices), `mergeCount`, `merges` (A1 notation array)
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
### sheets_get_formatting_compact
|
|
472
|
+
|
|
473
|
+
Read cell formatting for a range and return it as compact A1Range β format pairs. Adjacent cells with identical formatting are collapsed into rectangular ranges (run-length encoded), reducing output by 90 %+ compared to per-cell data.
|
|
474
|
+
|
|
475
|
+
**Parameters:**
|
|
476
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
477
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
478
|
+
- `range` (required): Range without sheet prefix, e.g. `"A1:Z85"`
|
|
479
|
+
- `useEffectiveFormat` (optional): `false` (default) = userEnteredFormat (only explicit overrides, smaller output); `true` = effectiveFormat (all inherited defaults)
|
|
480
|
+
- `fields` (optional): Array of format field names to include, e.g. `["backgroundColor", "textFormat", "borders"]`
|
|
481
|
+
|
|
482
|
+
**Returns:** `{ range, formatType, rangeCount, data: { "A1:C3": { backgroundColor: {...} }, ... } }`
|
|
483
|
+
|
|
484
|
+
**Supported fields:** `backgroundColor`, `backgroundColorStyle`, `textFormat`, `horizontalAlignment`, `verticalAlignment`, `wrapStrategy`, `textRotation`, `numberFormat`, `padding`, `borders`
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
### sheets_get_full_sheet_snapshot
|
|
489
|
+
|
|
490
|
+
Master one-shot tool that returns all structural and formatting metadata in a single API call.
|
|
491
|
+
|
|
492
|
+
**Parameters:**
|
|
493
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
494
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
495
|
+
- `includeFormattingRange` (optional): If provided (e.g. `"A1:Z100"`), per-cell formatting is included in the response
|
|
496
|
+
- `useEffectiveFormat` (optional): Use effectiveFormat instead of userEnteredFormat when including cell formatting (default: `false`)
|
|
497
|
+
- `fields` (optional): Array of format field names to return, e.g. `["backgroundColor", "textFormat"]` β reduces API transfer size and response size
|
|
498
|
+
- `compactMode` (optional): When `true`, identical adjacent cells are collapsed into rectangular ranges (RLE). Reduces a typical 85Γ28 sheet from ~60 000 lines to ~500 lines (default: `false`)
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
429
504
|
### sheets_insert_rows
|
|
430
505
|
|
|
431
506
|
Insert new rows at a specific position in a spreadsheet with optional data.
|