Firebase服务器
提供统一接口与 Firebase 服务进行交互的服务器,包括身份验证、Firestore 和存储。
可用工具 (9 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
firestore_add_document 2 个参数 需填 2 项
Add a document to a Firestore collection
必填参数:collection、data
firestore_list_collections 3 个参数
List collections in Firestore. If documentPath is provided, returns subcollections under that document; otherwise returns root collections.
该工具无需必填参数,直接调用即可
firestore_list_documents 4 个参数 需填 1 项
List documents from a Firestore collection with optional filtering
必填参数:collection
firestore_get_document 2 个参数 需填 2 项
Get a document from a Firestore collection
必填参数:collection、id
firestore_update_document 3 个参数 需填 3 项
Update a document in a Firestore collection
必填参数:collection、id、data
firestore_delete_document 2 个参数 需填 2 项
Delete a document from a Firestore collection
必填参数:collection、id
auth_get_user 1 个参数 需填 1 项
Get a user by ID or email from Firebase Authentication
必填参数:identifier
storage_list_files 1 个参数
List files in a given path in Firebase Storage
该工具无需必填参数,直接调用即可
storage_get_file_info 1 个参数 需填 1 项
Get file information including metadata and download URL
必填参数:filePath
服务介绍
Firebase MCP 服务器
概述
这是一个 Firebase MCP(模型上下文协议)服务器,它提供了一个统一的接口来与各种 Firebase 服务进行交互,包括身份验证、Firestore 和存储。
设置
-
克隆并构建项目:
git clone https://github.com/gemini-dk/mcp-server-firebase cd mcp-server-firebase npm install npm run build -
获取 Firebase 服务账号密钥:
- 转到 Firebase 控制台 > 项目设置 > 服务账号
- 点击“生成新的私钥”
- 将 JSON 文件保存到您的项目目录中
-
配置
mcp_settings.json:{ "firebase-mcp": { "command": "node", "args": [ "/path/to/mcp-server-firebase/dist/index.js" ], "env": { "SERVICE_ACCOUNT_KEY_PATH": "/path/to/serviceAccountKey.json" } } }将
/path/to/mcp-server-firebase替换为您克隆仓库的实际路径。
将/path/to/serviceAccountKey.json替换为您的服务账号密钥文件的路径。
可用 API
身份验证
- 通过 ID 或电子邮件获取用户
Firestore
- 添加/更新/删除文档
- 列出集合/文档
存储
- 列出目录中的文件
- 获取文件元数据和下载 URL
许可证
- MIT 许可证