Spreadsheet MCP Server
电子表格 MCP 服务器
该项目是一个用于访问 Google 电子表格中的数据的模型上下文协议 (MCP) 服务器。允许 LLM 直接使用电子表格信息。
功能
获取有关电子表格的基本信息(例如工作表列表)
从特定工作表中获取数据并将其格式化为 Markdown 格式
与 MCP 客户端集成(例如 Claude for Desktop)
Related MCP server: MCP Google Workspace Server
安装
# リポジトリのクローン
git clone https://github.com/your-username/spreadsheet-mcp-server.git
cd spreadsheet-mcp-server
# 依存関係のインストール
npm install
# 環境変数の設定
cp .env.example .env
# .envファイルを編集してGAS_WEB_APP_URLとGAS_API_KEYを設定
# ビルド
npm run build设置环境变量
以下环境变量用于配置服务器:
GAS_WEB_APP_URL:Google Apps Script Web 应用网址GAS_API_KEY:用于访问 Google Apps Script Web App 的 API 密钥
您可以在.env文件中设置这些环境变量:
GAS_WEB_APP_URL=https://script.google.com/macros/s/your-deployment-id/exec
GAS_API_KEY=your-api-key如果未设置环境变量,服务器将以模拟模式运行,并且不会访问实际的 Google 电子表格。
如何使用
独立启动
npm start与 Claude for Desktop 集成
将以下内容添加到您的 Claude for Desktop 配置文件( claude_desktop_config.json )中:
{
"mcpServers": {
"spreadsheet": {
"command": "node",
"args": ["<absolute-path-to-project>/build/index.js"]
}
}
}要设置环境变量,请添加env字段,如下所示:
{
"mcpServers": {
"spreadsheet": {
"command": "node",
"args": ["<absolute-path-to-project>/build/index.js"],
"env": {
"GAS_WEB_APP_URL": "https://script.google.com/macros/s/your-deployment-id/exec",
"GAS_API_KEY": "your-api-key"
}
}
}
}配置文件位于此处:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%AppData%\\Claude\\claude_desktop_config.json
使用 MCP Inspector 进行测试
npx @modelcontextprotocol/inspector node build/index.js提供的工具
获取电子表格
获取有关电子表格的基本信息以及其中包含的工作表列表。
输入参数:
url:电子表格的 URL
输出:
电子表格名称、ID、工作表列表(包括行数和列数)
获取工作表数据
从电子表格中的特定工作表获取数据。
输入参数:
url:电子表格的 URLsheetName:要获取的工作表的名称
输出:
工作表数据(Markdown表格格式)
发展
项目结构
src/
├── index.ts # エントリポイント
├── server.ts # MCPサーバー設定
├── config.ts # 環境変数と設定管理
├── tools/ # ツール実装
│ ├── getSpreadsheet.ts
│ ├── getSheetData.ts
│ └── index.ts
├── api/ # API処理
│ ├── README.md # API仕様
│ ├── spreadsheet.ts
│ └── types.ts
└── utils/ # ユーティリティ
└── format.ts测试
# 単体テスト実行
npm test
# ウォッチモードでテスト
npm run test:watch与 Google Apps 脚本集成
在实际使用中,该服务器与 Google Apps Script Web App 配合使用:
使用 Google Apps 脚本创建Web 应用
实现一个 API 来访问 Web 应用程序端的电子表格(请参阅
api/README.md)设置 API 密钥并将其与环境变量
GAS_WEB_APP_URL和GAS_API_KEY关联
这种方法可以让您避免 Google 身份验证流程并维护电子表格的安全性。
如果没有设置环境变量,脚本将以模拟模式运行并返回测试数据。
执照
麻省理工学院
Available Tools
2 toolsgetSheetDataC
スプレッドシートの特定シートのデータを取得
Inputs: url (required), sheetName (required).
getSpreadsheetB
スプレッドシートの基本情報と含まれるシート一覧を取得
Inputs: url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: getSheetData retrieves data from a specific sheet within a spreadsheet, while getSpreadsheet provides metadata and a list of sheets for the entire spreadsheet. There is no overlap or ambiguity between these operations.
Both tools follow a consistent verb_noun naming pattern (getSheetData and getSpreadsheet), using camelCase uniformly. The naming is predictable and readable across the tool set.
With only 2 tools, this server feels thin for a spreadsheet domain, which typically requires operations like create, update, delete, or search. The count is too low for comprehensive coverage, limiting agent functionality.
The tool set is severely incomplete for spreadsheet operations, lacking essential CRUD actions such as creating or modifying sheets, updating cell data, or deleting content. This will cause significant agent failures in handling typical spreadsheet tasks.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Google Drive and Google Sheets, enabling users to create, read, update, and manage spreadsheets through natural language commands.16,929 PyPI1,021MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI agents to interact with Google Workspace services including Drive, Docs, and Sheets through natural language commands.8MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Google Sheets - read, write, and query spreadsheet data.599 npm2MIT
- AlicenseNot gradedqualityBmaintenanceA full-featured Model Context Protocol server that gives AI assistants real-time access to Google Workspace services including Drive, Gmail, Calendar, Sheets, Docs, and Apps Script.2,201 PyPI12MIT