关于 Firestore MCP Server
Firestore MCP Server 让 Claude Desktop 能操作 Google Cloud Firestore 中的文档和集合,涵盖常见文档操作及带筛选、排序和数量限制的查询。
主要功能
- 01创建、读取、更新和删除文档
- 02按条件筛选、排序和限制查询结果
- 03列出集合
适用场景
- 01通过 Claude Desktop 管理 Firestore 文档
- 02按查询条件查找文档
MCP 相关
它向 MCP 客户端提供 Firestore 文档操作、查询和集合列表工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Firestore MCP 服务
一个可直接与 Google Firestore 交互的 MCP(Model Context Protocol)服务。此服务通过 Claude Desktop 提供简洁的接口,用于创建、读取、更新和删除 Firestore 文档。
功能
- 在 Firestore 集合中创建文档
- 读取 Firestore 集合中的文档
- 更新现有文档
- 删除文档
- 使用筛选、排序和限制条件查询文档
- 列出可用集合
设置
-
安装依赖项:
npm install -
构建项目:
npm run build -
配置 Claude Desktop: 将以下内容添加到你的
claude_desktop_config.json中:"firestore-mcp": { "command": "node", "args": [ "/path/to/firestore-mcp/build/index.js" ], "env": { "GOOGLE_CLOUD_PROJECTS": "project-id" } }将 args 中的路径替换为 index.js 的实际路径。
在 GOOGLE_CLOUD_PROJECTS 中定义以逗号分隔的项目 ID 列表。 示例:
google-project-id1,google-project-id2列表中的第一个项目为默认项目。应用会在 keys 文件夹中查找每个项目对应的 .json 凭据文件。 示例:keys/google-project-id1.json, keys/google-project-id2.json 确保云服务账号拥有与 Cloud Firestore 交互所需的权限,例如
Cloud Datastore Owner或权限较低的角色。
可用工具
- getDocument:按 ID 从集合中获取文档
- createDocument:在集合中创建新文档
- updateDocument:更新现有文档
- deleteDocument:删除文档
- queryDocuments:使用筛选、排序和限制条件查询文档
- listCollections:列出所有可用集合
在 Claude Desktop 中的使用示例
以下是在 Claude Desktop 中使用各工具的示例:
获取文档
Get the document with ID "user123" from the "users" collection
创建文档
Create a new document in the "users" collection with the following data:
{
"name": "John Doe",
"email": "[email protected]",
"age": 30
}
更新文档
Update the document with ID "user123" in the "users" collection to change the age to 31
删除文档
Delete the document with ID "user123" from the "users" collection
查询文档
Find all users over 25 years old, ordered by name
列出集合
List all available Firestore collections
开发
- 监视模式:
npm run dev
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。