Labsco
dudegladiator logo

Google Spreadsheet MCP

โ˜… 17

from dudegladiator

Full Google Sheets integration - read, write, format cells, create charts, use formulas, and manage spreadsheets.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Google Sheets MCP Server

A Model Context Protocol (MCP) server providing full Google Sheets functionality. Read, write, format cells, create charts, use formulas, and manage spreadsheets directly from Claude, Cursor, or any MCP-compatible client.

Why I Built This

I created this MCP server for my college assignments, where I frequently work with data in Google Sheets โ€” mostly financial sheets. Tasks like creating charts, writing formulas, formatting tables, and organizing data were repetitive and time-consuming. With this tool, I can automate all of that and focus on what actually matters โ€” logical thinking and analysis โ€” instead of doing the same manual work over and over again. :)

Features

CategoryCapabilities
Cell OperationsRead, write, batch operations, append rows, clear cells
FormulasFull support (=SUM(), =VLOOKUP(), =IF(), etc.)
Sheet ManagementCreate, delete, rename, duplicate sheets
FormattingBold, italic, colors, alignment, column widths, merge cells
ChartsBar, Line, Pie, Column, Area, Scatter charts
Data OperationsSort, find/replace, get last row
SharingShare with users or make public

Available Tools (27 Total)

Spreadsheet & Sheet Management

ToolDescriptionExample
get_spreadsheet_infoGet metadata and sheet list"Show me info about spreadsheet abc123"
create_spreadsheetCreate new spreadsheet"Create a spreadsheet called 'Budget 2024'"
list_sheetsList all sheets/tabs"What sheets are in this spreadsheet?"
create_sheetAdd a new sheet"Add a sheet called 'Summary'"
delete_sheetRemove a sheet"Delete the sheet with ID 12345"
rename_sheetRename a sheet"Rename sheet 0 to 'Data'"
duplicate_sheetCopy a sheet"Duplicate the main sheet"

Cell Operations

ToolDescriptionExample
read_cellsRead values from range"Read cells A1 to D10 from Sheet1"
write_cellsWrite values (supports formulas)"Write headers Name, Age, Score to A1"
batch_readRead multiple ranges at once"Read A1:A10 and C1:C10"
batch_writeWrite to multiple ranges"Write data to multiple locations"
append_rowsAdd rows at end of data"Append these new records"
clear_cellsClear a range"Clear cells B2:D10"
get_last_rowFind last row with data"What's the last row in column A?"

Row/Column Operations

ToolDescriptionExample
insert_rowsInsert empty rows"Insert 5 rows at row 10"
insert_columnsInsert empty columns"Insert 2 columns at column C"
delete_rowsDelete rows"Delete rows 5-10"
delete_columnsDelete columns"Delete column B"

Formatting

ToolDescriptionExample
format_cellsApply formatting"Make header row bold with blue background"
set_column_widthAdjust column width"Set column A width to 200 pixels"
merge_cellsMerge cell range"Merge cells A1:C1 for title"

Charts

ToolDescriptionExample
create_chartCreate embedded chart"Create a bar chart from sales data"
list_chartsList all charts"What charts exist in this spreadsheet?"
delete_chartRemove a chart"Delete chart 123456"

Data Operations

ToolDescriptionExample
sort_rangeSort data by column"Sort data by column B ascending"
find_replaceFind and replace text"Replace 'N/A' with '0' everywhere"

Sharing

ToolDescriptionExample
share_spreadsheetShare or make public"Make this spreadsheet public"

A1 Notation Reference

NotationDescription
Sheet1!A1:D10Cells A1 to D10 in Sheet1
Sheet1!A:AEntire column A in Sheet1
Sheet1!1:5Rows 1-5 in Sheet1
A1:B10Range in first visible sheet
'My Sheet'!A1Sheet name with spaces (use quotes)

Index Reference

  • Rows: 0-based in formatting (Row 1 = index 0)
  • Columns: 0-based (A=0, B=1, C=2, D=3...)
  • sheet_id: Numeric ID from list_sheets or get_spreadsheet_info

Common Formulas

=SUM(A1:A10)           Sum values
=AVERAGE(B:B)          Average entire column
=COUNT(A:A)            Count numbers
=COUNTA(A:A)           Count non-empty cells
=MAX(A1:A100)          Maximum value
=MIN(A1:A100)          Minimum value
=VLOOKUP(A1,B:C,2,0)   Lookup value
=IF(A1>100,"High","Low") Conditional
=CONCATENATE(A1," ",B1)  Join text
=TODAY()               Current date
=NOW()                 Current date/time

File Structure

spreadsheet-mcp/
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ credentials/
โ”‚   โ””โ”€โ”€ service-account.json  (your key, gitignored)
โ””โ”€โ”€ src/spreadsheet_mcp/
    โ”œโ”€โ”€ __init__.py
    โ”œโ”€โ”€ auth.py              # Google authentication
    โ”œโ”€โ”€ sheets_client.py     # API wrapper (1000+ lines)
    โ””โ”€โ”€ server.py            # MCP server (27 tools)

Author