SheetsDB MCP服务器
模型上下文协议(MCP)服务器,使Claude能够通过SheetsDB API与Google Sheets进行交互。
特性
- 智能数据添加 -自动检测空工作表与现有工作表
- 标题管理 -使用图纸DB
/keys可靠报头检测的端点 - CRUD操作 -读取、导入、更新和删除工作表数据
- 简单可靠 -仅需6个专注的工具,约150行代码
可用工具
get_keys-从工作表中获取列标题smart_add_data-智能添加数据(空表为import_json,现有表为create)read_sheet-从工作表读取数据import_json-将JSON数据导入空表update_row-更新特定行delete_rows-按条件删除行
快速开始
先决条件
- Node.js 18+
- SheetsDB帐户和API终结点
- Claude Desktop或兼容的MCP客户端
安装
- 克隆此存储库:
git clone https://github.com/yourusername/sheetsdb-mcp-server.git
cd sheetsdb-mcp-server- 安装依赖项:
npm install- 测试服务器:
npm start本地Claude桌面设置
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"sheetsdb": {
"command": "node",
"args": ["/path/to/your/sheetsdb-mcp-server/server.js"]
}
}
}使用Smithery.ai进行部署
- 推送到GitHub:
git add .
git commit -m "Initial commit"
git push origin main- 在Smithery.ai上部署:
- 首选 Smithery.ai - 点击“使用GitHub部署MCP” - 选择此存储库 - 这 mcp-config.json 将被自动检测
- 在Claude中使用:
- 获取Smithery部署URL - 添加到Claude Desktop配置或直接使用
使用示例
添加膳食数据
User: "Add chicken dinner (340 calories, 25g protein) to my calorie tracker: https://sheetdb.io/api/v1/your-id"
Claude will:
1. Call get_keys to check headers
2. Call smart_add_data with proper mapping
3. Either create headers (first time) or add to existing sheet读取数据
User: "Show me my last 5 meals"
Claude: [Uses read_sheet with limit=5]更新条目
User: "Update yesterday's breakfast calories to 350"
Claude: [Uses update_row to find and modify the entry]配置
服务器需要以下格式的SheetsDB终结点:
https://sheetdb.io/api/v1/YOUR_SHEET_ID无需额外配置,只需在使用工具时提供端点即可。
安全说明
- 对端点进行验证,以确保它们是合法的SheetsDB URL
- 服务器中未存储API密钥(SheetsDB通过URL处理身份验证)
- 所有请求都直接发送到SheetsDB的安全端点
贡献
- 分叉存储库
- 创建要素分支
- 进行更改
- 彻底测试
- 提交拉取请求
许可证
MIT许可证-有关详细信息,请参阅许可证文件
支持
- 为bug或功能请求创建问题
- 检查表API特定问题的DB文档
- 有关协议详细信息,请参阅MCP文档
