
Google 工作表的 MCP 服务器 - 读取、写取、格式化单元格、创建图表等
概览
一个模式背景协议(MCP)服务器,提供完整的Google Sheets功能. 直接从 Claude, Cursor 或任何 MCP 兼容客户端读取,写取,格式化单元格,创建图表,使用公式,并管理电子表格. 我为我的大学任务创建了这个MCP服务器, 在那里我经常与Google Sheets的数据工作, 主要是财务表。 诸如创建图表、编写公式、格式化表格和组织数据等任务是重复和费时的。 有了这个工具,我就可以自动化所有这一切,并集中关注实际重要的问题——逻辑思维和分析,而不是一次又一次地做同样的手工工作。 ) 1. :去Google Cloud Console 新项目 2. : - 启用工作表 API - 启用驱动 API 3. : - 转到APIs & Services – 证书 - 创建证书 - 服务账户 - 下载 JSON 密钥 - 保存为证书/服务账户. json 4.
概述(AI 翻译)
一个模式背景协议(MCP)服务器,提供完整的Google Sheets功能. 直接从 Claude, Cursor 或任何 MCP 兼容客户端读取,写取,格式化单元格,创建图表,使用公式,并管理电子表格.
∮为什么我造了这个∮
我为我的大学任务创建了这个MCP服务器, 在那里我经常与Google Sheets的数据工作, 主要是财务表。 诸如创建图表、编写公式、格式化表格和组织数据等任务是重复和费时的。 有了这个工具,我就可以自动化所有这一切,并集中关注实际重要的问题——逻辑思维和分析,而不是一次又一次地做同样的手工工作。 )
□ 特性
- 类别 * 能力 * |-|-.
- ** Cell Operations ** * * * 读取、写取、批量操作、附件行、清空单元格 * * * Formulas ** * * * * * 全力支持([[T0],[T1],[T2]等) * * * ** ** Sheet 管理 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** 格式 ** 粗体、斜体、颜色、对齐、列宽、合并单元格 * * ** 图表 栏、行、派、栏、区域、散点图表* ** ** 数据操作** 排序,查找/替换,获取最后一行 {}
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Sheets MCP Server
A Model Context Protocol (MCP) server providing full Google Sheets functionality. Read, write, format cells, create charts, use formulas, and manage spreadsheets directly from Claude, Cursor, or any MCP-compatible client.
Why I Built This
I created this MCP server for my college assignments, where I frequently work with data in Google Sheets — mostly financial sheets. Tasks like creating charts, writing formulas, formatting tables, and organizing data were repetitive and time-consuming. With this tool, I can automate all of that and focus on what actually matters — logical thinking and analysis — instead of doing the same manual work over and over again. :)
Features
| Category | Capabilities |
|---|---|
| Cell Operations | Read, write, batch operations, append rows, clear cells |
| Formulas | Full support (=SUM(), =VLOOKUP(), =IF(), etc.) |
| Sheet Management | Create, delete, rename, duplicate sheets |
| Formatting | Bold, italic, colors, alignment, column widths, merge cells |
| Charts | Bar, Line, Pie, Column, Area, Scatter charts |
| Data Operations | Sort, find/replace, get last row |
| Sharing | Share with users or make public |
Quick Start
1. Install
cd /path/to/spreadsheet-mcp
uv sync
2. Google Cloud Setup (Free, One-Time)
- Create Project: Go to Google Cloud Console → New Project
- Enable APIs:
- Create Service Account:
- Go to APIs & Services → Credentials → Create Credentials → Service Account
- Download JSON key → Save as
credentials/service-account.json
- Share Spreadsheets: Share your sheets with the service account email (found in JSON)
3. Run
uv run spreadsheet-mcp
MCP Client Configuration
Claude Desktop
Add to your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google-sheets": {
"command": "uv",
"args": [
"--directory",
"/path/to/spreadsheet-mcp",
"run",
"spreadsheet-mcp"
]
}
}
}
Claude Code (CLI)
Add to your project’s .mcp.json file:
{
"mcpServers": {
"google-sheets": {
"command": "uv",
"args": [
"--directory",
"/path/to/spreadsheet-mcp",
"run",
"spreadsheet-mcp"
]
}
}
}
Cursor
Add to Cursor’s MCP settings (Settings → MCP → Add Server):
{
"mcpServers": {
"google-sheets": {
"command": "uv",
"args": [
"--directory",
"/path/to/spreadsheet-mcp",
"run",
"spreadsheet-mcp"
]
}
}
安装
npx -y uv --directory /path/to/spreadsheet-mcp run spreadsheet-mcp配置
{
"mcpServers": {
"google-sheets": {
"command": "uv",
"args": [
"--directory",
"/path/to/spreadsheet-mcp",
"run",
"spreadsheet-mcp"
]
}
}
}