modelscope·@xing5/mcp-google-sheets
一种集成了Google Drive和Google Sheets的模型上下文协议服务器,允许用户通过自然语言命令创建、读取、更新和管理电子表格。
mcp-google-sheets 是一个基于Python的MCP服务器,它充当任何MCP兼容客户端(如Claude Desktop)与Google Sheets API之间的桥梁。它允许您使用一组定义好的工具与您的Google电子表格进行交互,从而实现由AI驱动的强大自动化和数据处理工作流。
uvx)基本上,服务器运行只需一行命令:uvx mcp-google-sheets。
此命令会根据需要自动下载最新代码并运行。但是,设置Google Cloud需要一些步骤,请阅读以下步骤。
☁️ 前提条件:Google Cloud 设置
🐍 安装 uv
uvx 是 uv 的一部分,uv 是一个快速的 Python 包安装器和解析器。如果您尚未安装,请执行以下操作:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# 或者使用 pip:
# pip install uv
如果需要,请按照安装程序输出中的说明将 uv 添加到您的 PATH 中。🔑 设置必需的环境变量(推荐使用服务账号)
# 请用您从 Google 设置步骤中获得的实际路径和文件夹 ID 替换
export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json"
export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
set SERVICE_ACCOUNT_PATH="C:\path\to\your\service-account-key.json"
set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
$env:SERVICE_ACCOUNT_PATH = "C:\path\to\your\service-account-key.json"
$env:DRIVE_FOLDER_ID = "YOUR_DRIVE_FOLDER_ID"
CREDENTIALS_CONFIG)。🏃 运行服务器!
uvx 将自动下载并运行最新版本的 mcp-google-sheets:
uvx mcp-google-sheets
🔌 连接您的 MCP 客户端
您已经准备好了!开始通过您的 MCP 客户端发出命令吧。
uvx 即刻运行(零安装体验),或使用 uv 克隆以进行开发。此服务器提供了以下工具来与 Google Sheets 进行交互:
(输入参数通常是字符串,除非另有说明)
list_spreadsheets: Lists spreadsheets in the configured Drive folder (Service Account) or accessible by the user (OAuth).
[{id: string, title: string}]create_spreadsheet: Creates a new spreadsheet.
title (string): The desired title.spreadsheetId.get_sheet_data: Reads data from a range in a sheet.
spreadsheet_id (string)sheet (string): Name of the sheet.range (optional string): A1 notation (e.g., 'A1:C10', 'Sheet1!B2:D'). If omitted, reads the whole sheet.update_cells: Writes data to a specific range. Overwrites existing data.
spreadsheet_id (string)sheet (string)range (string): A1 notation.data (2D array): Values to write.batch_update_cells: Updates multiple ranges in one API call.
spreadsheet_id (string)sheet (string)ranges (object): Dictionary mapping range strings (A1 notation) to 2D arrays of values { "A1:B2": [[1, 2], [3, 4]], "D5": [["Hello"]] }.add_rows: Appends rows to the end of a sheet (after the last row with data).
spreadsheet_id (string)sheet (string)data (2D array): Rows to append.list_sheets: Lists all sheet names within a spreadsheet.
spreadsheet_id (string)["Sheet1", "Sheet2"].create_sheet: Adds a new sheet (tab) to a spreadsheet.
spreadsheet_id (string)title (string): Name for the new sheet.get_multiple_sheet_data: Fetches data from multiple ranges across potentially different spreadsheets in one call.
queries (array of objects): Each object needs spreadsheet_id, sheet, and range. [{spreadsheet_id: 'abc', sheet: 'Sheet1', range: 'A1:B2'}, ...].data or an error.get_multiple_spreadsheet_summary: Gets titles, sheet names, headers, and first few rows for multiple spreadsheets.
spreadsheet_ids (array of strings)rows_to_fetch (optional integer, default 5): How many rows (including header) to preview.share_spreadsheet: Shares a spreadsheet with specified users/emails and roles.
spreadsheet_id (string)recipients (array of objects): [{email_address: 'user@example.com', role: 'writer'}, ...]. Roles: reader, commenter, writer.send_notification (optional boolean, default True): Send email notifications.暂无描述。
MCP服务器用于与Google产品交互。
一个MCP服务器,它能够保存和分享克劳德桌面端的对话,允许用户通过网页界面私密存储聊天记录或将其公开。
一种模型上下文协议服务器,它为与Notion的API交互提供了标准化接口,使用户能够列出数据库、创建页面并在其Notion工作区中进行搜索。
语言类型:英语 翻译结果:谷歌表格
一种模型上下文协议服务器,允许创建和管理多个防篡改的JSON数据库,支持CRUD操作、查询功能以及云端同步,以便与他人共享数据库。