XM

xing5/mcp-google-sheets

部署与 DevOps

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1016 stars 255 forks 质量 80 趋势 27MIT

该MCP服务器可与您的Google Drive和Google Sheets集成,支持创建和修改电子表格。

概览

你的AI助手通往Google表格的门户!📊 mcp-google-sheets 是一款基于 Python 的 MCP 服务器,作为任何兼容 MCP 客户端(如 Claude Desktop)与 Google Sheets API 之间的桥梁。它允许您使用一套定义的工具与 Google 电子表格交互,实现由 AI 驱动的强大自动化和数据处理工作流程。 本质上,服务器运行在同一行:uvx mcp-google-sheets@latest。 这个命令会自动下载最新的代码并运行。以确保你拥有最新版本,包含最新功能和修复错误。 有关以下所用身份证的更多信息,请参阅ID参考指南。 1. * 你先配置Google Cloud Platform凭证并启用必要的API。我们强烈建议使用。* ➡️ 跳转到下面的指南。 2. * uvx 是 uv 的一部分,uv 是一个快速的 Python 安装器和解析器。如果你还没安装,请安装:按照安装程序输出中的说明,如果需要的话将 uv 添加到你的 PATH。

概述(AI 翻译)

MCP-谷歌表格

你的AI助手通往Google表格的门户!📊


🤔 这是什么?

mcp-google-sheets 是一款基于 Python 的 MCP 服务器,作为任何兼容 MCP 客户端(如 Claude Desktop)与 Google Sheets API 之间的桥梁。它允许您使用一套定义的工具与 Google 表格交互,实现由 AI 驱动的强大自动化和数据处理工作流程。


🚀 快速入门(使用 uvx)

本质上,服务器运行在一行中:uvx mcp-google-sheets@latest。

该命令会自动下载并运行最新代码。**我们建议始终使用@latest**以确保你拥有最新功能和修复错误的最新版本。

Refer 关于所用身份证的更多信息,请参阅 ID 参考指南below.

  1. ** ☁️ 前提条件:Google Cloud Setup**
  • 你必须先配置Google Cloud Platform凭证并启用必要的API。我们强烈建议使用服务账户。 ➡️ * 跳转到下方详细的谷歌云平台设置指南。
  1. ** 🐍 安装uv**
  • uvx 是 uv 的一部分,后者是一个快速的 Python 包安装器和解析器。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。


🤔 What is this?

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.


🚀 Quick Start (Using uvx)

Essentially the server runs in one line: uvx mcp-google-sheets@latest.

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.

Refer to the ID Reference Guide for more information about the IDs used below.

  1. ☁️ Prerequisite: Google Cloud Setup

    • You must configure Google Cloud Platform credentials and enable the necessary APIs first. We strongly recommend using a Service Account.
    • ➡️ Jump to the Detailed Google Cloud Platform Setup guide below.
  2. 🐍 Install uv

    • uvx is part of uv, a fast Python package installer and resolver. Install it if you haven’t already:
      # macOS / Linux
      curl -LsSf https://astral.sh/uv/install.sh | sh
      # Windows
      powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
      # Or using pip:
      # pip install uv
      
      Follow instructions in the installer output to add uv to your PATH if needed.
  3. 🔑 Set Essential Environment Variables (Service Account Recommended)

    • You need to tell the server how to authenticate. Set these variables in your terminal:
    • (Linux/macOS)
      # Replace with YOUR actual path and folder ID from the Google Setup step
      export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json"
      export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
      
    • (Windows CMD)
      set SERVICE_ACCOUNT_PATH="C:\path\to\your\service-account-key.json"
      set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
      
    • (Windows PowerShell)
      $env:SERVICE_ACCOUNT_PATH = "C:\path\to\your\service-account-key.json"
      $env:DRIVE_FOLDER_ID = "YOUR_DRIVE_FOLDER_ID"
      
在 GitHub 查看完整 README

安装

uvx mcp-google-sheets@latest --include-tools get_sheet_data update_cells list_spreadsheets list_sheets
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "google-sheets": { "command": "uvx", "args": [ "mcp-google-sheets@latest", "--include-tools", "get_sheet_data,update_cells,list_spreadsheets,list_sheets" ], "env": { "SERVICE_ACCOUNT_PATH": "/path/to/credentials.json" } } } }