Google Sheets MCP server

Integrates with Google Sheets to enable spreadsheet creation, editing, and formatting capabilities through specialized Python tools built with FastMCP framework, requiring Google Cloud OAuth authentication.
Back to servers
Provider
akchro
Release date
Mar 16, 2025
Language
Python

This MCP server provides integration between Language Learning Models (LLMs) and Google Sheets, allowing models to interact with spreadsheets directly. With this integration, models can list, create, copy spreadsheets, as well as write, edit and fill cells.

Installation Setup

Prerequisites

Before installing the Google Sheets MCP server, you need to set up Google Cloud credentials:

  1. Create a new Google Cloud project at the Google Cloud Console
  2. Enable the Google Drive API in the API Library
  3. Configure an OAuth consent screen at the Credentials page
    • Setting it to "internal" is sufficient for testing purposes
  4. Create an OAuth Client ID for a "Desktop App" application type here
  5. Download the JSON file containing your OAuth client credentials

Setting Up the Server

Once you have your Google Cloud credentials:

  1. Download the repository
  2. Rename your downloaded credentials file to credentials.json
  3. Place this file in the root directory of the server
mv ~/Downloads/your-credentials-file.json ./credentials.json

Using the Google Sheets MCP Server

Authentication

When you first run the server, it will prompt you to authenticate with your Google account. Follow the authentication flow to grant the necessary permissions to the application.

Available Capabilities

The MCP server provides the following capabilities for LLMs to interact with Google Sheets:

  • List Spreadsheets: View all available spreadsheets in the user's Google Drive
  • Create Spreadsheets: Generate new spreadsheets with specified names and content
  • Copy Spreadsheets: Duplicate existing spreadsheets to a new location
  • Cell Operations: Write, edit, and fill cells with data

Example Usage

To use the Google Sheets MCP server with an LLM, the model can make requests through the MCP protocol. Here are some typical operations:

  • To list all spreadsheets:

    List all my Google Sheets spreadsheets
    
  • To create a new spreadsheet:

    Create a new spreadsheet called "Budget 2023"
    
  • To modify cell content:

    Write "Monthly Expenses" in cell A1 of the "Budget 2023" spreadsheet
    
  • To copy a spreadsheet:

    Copy my "Budget 2023" spreadsheet to "Budget 2024"
    

Best Practices

  • Make sure your OAuth consent screen includes all the email addresses that will be used for testing if you selected "external" access
  • Keep your credentials.json file secure and never share it publicly
  • Use specific commands when working with spreadsheets to avoid ambiguity

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