$git clone https://github.com/xing5/mcp-google-sheets---
| 1 | <div align="center"> |
| 2 | <!-- Main Title Link --> |
| 3 | <b>mcp-google-sheets</b> |
| 4 | |
| 5 | <!-- Description Paragraph --> |
| 6 | <p align="center"> |
| 7 | <i>Your AI Assistant's Gateway to Google Sheets! </i>📊 |
| 8 | </p> |
| 9 | |
| 10 | [](https://pypi.org/project/mcp-google-sheets/) |
| 11 | [](https://pepy.tech/projects/mcp-google-sheets) |
| 12 |  |
| 13 |  |
| 14 | </div> |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## 🤔 What is this? |
| 19 | |
| 20 | `mcp-google-sheets` is a Python-based MCP server that acts as a bridge between any MCP-compatible client (like Claude Desktop) and the Google Sheets API. It allows you to interact with your Google Spreadsheets using a defined set of tools, enabling powerful automation and data manipulation workflows driven by AI. |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## 🚀 Quick Start (Using `uvx`) |
| 25 | |
| 26 | Essentially the server runs in one line: `uvx mcp-google-sheets@latest`. |
| 27 | |
| 28 | This command will automatically download the latest code and run it. **We recommend always using `@latest`** to ensure you have the newest version with the latest features and bug fixes. |
| 29 | |
| 30 | _Refer to the [ID Reference Guide](#-id-reference-guide) for more information about the IDs used below._ |
| 31 | |
| 32 | 1. **☁️ Prerequisite: Google Cloud Setup** |
| 33 | * You **must** configure Google Cloud Platform credentials and enable the necessary APIs first. We strongly recommend using a **Service Account**. |
| 34 | * ➡️ Jump to the [**Detailed Google Cloud Platform Setup**](#-google-cloud-platform-setup-detailed) guide below. |
| 35 | |
| 36 | 2. **🐍 Install `uv`** |
| 37 | * `uvx` is part of `uv`, a fast Python package installer and resolver. Install it if you haven't already: |
| 38 | ```bash |
| 39 | # macOS / Linux |
| 40 | curl -LsSf https://astral.sh/uv/install.sh | sh |
| 41 | # Windows |
| 42 | powershell -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 43 | # Or using pip: |
| 44 | # pip install uv |
| 45 | ``` |
| 46 | *Follow instructions in the installer output to add `uv` to your PATH if needed.* |
| 47 | |
| 48 | 3. **🔑 Set Essential Environment Variables (Service Account Recommended)** |
| 49 | * You need to tell the server how to authenticate. Set these variables in your terminal: |
| 50 | * **(Linux/macOS)** |
| 51 | ```bash |
| 52 | # Replace with YOUR actual path and folder ID from the Google Setup step |
| 53 | export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json" |
| 54 | export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID" |
| 55 | ``` |
| 56 | * **(Windows CMD)** |
| 57 | ```cmd |
| 58 | set SERVICE_ACCOUNT_PATH="C:\path\to\your\service-account-key.json" |
| 59 | set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID" |
| 60 | ``` |
| 61 | * **(Windows PowerShell)** |
| 62 | ```powershell |
| 63 | $env:SERVICE_ACCOUNT_PATH = "C:\path\to\your\service-account-key.json" |
| 64 | $env:DRIVE_FOLDER_ID = "YOUR_DRIVE_FOLDER_ID" |
| 65 | ``` |
| 66 | * ➡️ See [**Detailed Authentication & Environment Variables**](#-authentication--environment-variables-detailed) for other options (OAuth, `CREDENTIALS_CONFIG`). |
| 67 | |
| 68 | 4. **🏃 Run the Server!** |
| 69 | * `uvx` will automatically download and run the latest version of `mcp-google-sheets`: |
| 70 | ```bash |
| 71 | uvx mcp-google-sheets@latest |
| 72 | ``` |
| 73 | * The server will start and print logs indicating it's ready. |
| 74 | * |
| 75 | * > **💡 Pro Tip:** Always use `@latest` to ensure you get the newest version with bug fixes and features. Without `@latest`, `uvx` may use a cached older version. |
| 76 | |
| 77 | 5. **🔌 Connect your MCP Client** |
| 78 | * Configure your client (e.g., Claude Desktop) to connect to the running server. |
| 79 | * Depending on the client you use, you might not need step 4 because the client can launch the server for you. But it's a good practice to test run step 4 anyway to make sure things are set up properly. |
| 80 | * ➡️ See [**Usage with Claude Desktop**](#-usage-with-claude-deskt |