Logo di Google Spreadsheet MCP

Google Spreadsheet MCP

Community
dudegladiator

MCP Server for Google Sheets - read, write, format cells, create charts, and more

Autoredudegladiator
Repositoryspreadsheet-mcp
LinguaPython
Fork
7
Stelle
18
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Google Spreadsheet MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    18 stelle e 7 fork nel repository collegato.

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

Quick Start

1. Install

bash
cd /path/to/spreadsheet-mcp
uv sync

2. Google Cloud Setup (Free, One-Time)

  1. Create Project: Go to Google Cloud Console → New Project
  2. Enable APIs:
  3. Create Service Account:
    • Go to APIs & Services → Credentials → Create Credentials → Service Account
    • Download JSON key → Save as credentials/service-account.json
  4. Share Spreadsheets: Share your sheets with the service account email (found in JSON)

3. Run

bash
uv run spreadsheet-mcp

MCP Client Configuration

Claude Desktop

Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{
  "mcpServers": {
    "google-sheets": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Claude Code (CLI)

Add to your project's .mcp.json file:

json
{
  "mcpServers": {
    "google-sheets": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Cursor

Add to Cursor's MCP settings (Settings → MCP → Add Server):

json
{
  "mcpServers": {
    "google-sheets": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Or add to ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "google-sheets": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Gemini CLI

For Gemini CLI with MCP support, add to your MCP configuration:

json
{
  "mcpServers": {
    "google-sheets": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Using with npx (Alternative)

If you prefer npx over uv:

json
{
  "mcpServers": {
    "google-sheets": {
      "command": "npx",
      "args": [
        "-y",
        "uv",
        "--directory",
        "/path/to/spreadsheet-mcp",
        "run",
        "spreadsheet-mcp"
      ]
    }
  }
}

Note: Replace /path/to/spreadsheet-mcp with the actual path where you cloned this repository.

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"

Usage Examples

Example 1: Create a Sales Report

User: Create a sales report in spreadsheet abc123

Claude will:
1. get_spreadsheet_info("abc123") - Check existing sheets
2. create_sheet("abc123", "Sales Report") - Create new sheet
3. write_cells("abc123", "Sales Report!A1", '[["Product", "Q1", "Q2", "Q3", "Q4", "Total"]]')
4. write_cells("abc123", "Sales Report!A2", '[["Widget", 100, 150, 200, 180, "=SUM(B2:E2)"]]')
5. format_cells(..., bold=True, background_color="#4285F4") - Format header
6. create_chart(..., "COLUMN", "Quarterly Sales") - Add chart

Example 2: Analyze Existing Data

User: Summarize the data in Sheet1

Claude will:
1. read_cells("abc123", "Sheet1!A1:Z1") - Read headers
2. get_last_row("abc123", "Sheet1", "A") - Find data extent
3. read_cells("abc123", "Sheet1!A1:D100") - Read all data
4. Provide summary and insights

Example 3: Format a Table

User: Make the spreadsheet look professional

Claude will:
1. format_cells(..., bold=True, background_color="#1a73e8", font_color="#FFFFFF") - Header
2. set_column_width(..., 150) - Adjust widths
3. format_cells(..., alignment="CENTER") - Center data

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

Troubleshooting

ErrorSolution
"Service account credentials not found"Check credentials/service-account.json exists
"403 Forbidden"Share spreadsheet with service account email
"API not enabled"Enable Sheets & Drive APIs in Google Cloud Console
"Quota exceeded"Wait a minute, you're hitting rate limits

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)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

License

MIT

Usa MCP Google Spreadsheet MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Google Spreadsheet MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Google Spreadsheet MCP come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Google Spreadsheet MCP.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "spreadsheet-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Google Spreadsheet MCP, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Google Spreadsheet MCP.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Google Spreadsheet MCP per aiutarmi con questa attività?
Google Spreadsheet MCP
Certo. Ho letto.
Ecco cosa ho trovato con Google Spreadsheet MCP.

Domande frequenti

A cosa serve il server MCP Google Spreadsheet MCP?

Google Spreadsheet MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Google Spreadsheet MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Google Spreadsheet MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Google Spreadsheet MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Google Spreadsheet MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Google Spreadsheet MCP MCP a TypingMind?

Google Spreadsheet MCP funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Google Spreadsheet MCP MCP in TypingMind?

Google Spreadsheet MCP mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Google Spreadsheet MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Google Spreadsheet MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇