用于Google Sheets的模型上下文协议(MCP)连接器,允许AI代理直接与电子表格进行交互。
https://github.com/user-attachments/assets/cc4729d9-4e6e-437b-848b-6da9a09418c3
git clone https://github.com/mkummer225/google-sheets-mcp
cd google-sheets-mcp
安装依赖项:
npm install
构建:
npm run build
在Google Cloud Platform中创建OAuth凭证:
dist子目录下的gcp-oauth.keys.json启动MCP服务器(当需要时,系统会自动提示您验证/重新验证您的Google账户):
npm run start
示例配置:
{
"mcpServers": {
"google-sheets-mcp": {
"command": "node",
"args": [
"/{path_to_dir}/google-sheets-mcp/dist/index.js"
]
}
}
}
然后,您可以简单地指定您的spreadsheetId,或让您的代理为您创建一个新的。
| 动作 | 描述 |
|---|---|
refresh_auth | 当凭证过期时重新验证您的Google账户 |
list_sheets | 列出Google电子表格中的所有工作表/标签 |
create_sheet | 在Google电子表格中创建新的工作表/标签 |
create_spreadsheet | 创建新的Google电子表格 |
read_all_from_sheet | 从指定的工作表读取所有数据 |
read_headings | 从工作表读取列标题 |
read_rows | 从工作表读取特定行 |
read_columns | 从工作表读取特定列 |
edit_cell | 编辑工作表中的单个单元格 |
edit_row | 编辑工作表中的整行 |
edit_column | 编辑工作表中的整列 |
insert_row | 在指定位置插入新行 |
insert_column | 在指定位置插入新列 |
rename_sheet | 重命名电子表格中的工作表/标签 |
rename_doc | 重命名Google电子表格 |
MIT