Google Sheets MCP server

Integrates with Google Sheets API to enable direct creation, reading, and editing of spreadsheets for data analysis and collaborative document management
Back to servers
Provider
Matt Kummer
Release date
Apr 08, 2025
Language
TypeScript
Stats
42 stars

The Google Sheets MCP server provides a Model Context Protocol connector that enables AI agents to interact directly with Google Sheets spreadsheets, allowing them to read, write, and manipulate spreadsheet data programmatically.

Installation

Follow these steps to set up the Google Sheets MCP server:

  1. Clone the repository:

    git clone https://github.com/mkummer225/google-sheets-mcp
    cd google-sheets-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    
  4. Set up OAuth credentials:

  5. Start the MCP server:

    npm run start
    

    You'll be prompted to authenticate your Google account when necessary.

Configuration

To configure your AI agent to use the Google Sheets MCP server, add the following to your configuration:

{
    "mcpServers": {
    "google-sheets-mcp": {
      "command": "node",
      "args": [
        "/{path_to_dir}/google-sheets-mcp/dist/index.js"
      ]
    }
  }
}

After configuration, you can specify a spreadsheetId to work with or ask your agent to create a new spreadsheet.

Available Actions

Authentication

  • refresh_auth: Re-authenticate your Google Account when credentials expire

Spreadsheet Management

  • create_spreadsheet: Create a new Google Spreadsheet
  • rename_doc: Rename a Google Spreadsheet

Sheet Operations

  • list_sheets: List all sheets/tabs in a Google Spreadsheet
  • create_sheet: Create a new sheet/tab in a Google Spreadsheet
  • rename_sheet: Rename a sheet/tab in a spreadsheet

Reading Data

  • read_all_from_sheet: Read all data from a specified sheet
  • read_headings: Read the column headings from a sheet
  • read_rows: Read specific rows from a sheet
  • read_columns: Read specific columns from a sheet

Writing and Editing Data

  • edit_cell: Edit a single cell in a sheet
  • edit_row: Edit an entire row in a sheet
  • edit_column: Edit an entire column in a sheet
  • insert_row: Insert a new row at specified position
  • insert_column: Insert a new column at specified position

Each of these actions can be invoked by your AI agent to interact with Google Sheets documents after the MCP server is properly configured and running.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later