Firebase模拟器日志检查工具

用于检查Firebase模拟器的Firestore和函数日志的MCP服务器工具。

  • by NigelThorne
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 NigelThorne/firebase_mcp_server

使用说明

Firebase MCP服务器

MCP服务器,用于检查Firebase模拟器Firestore和功能日志。

设置

npm install
npm run build

配置

复制 .env.example 到 .env 并调整:

FIRESTORE_EMULATOR_HOST=localhost:8080
FIREBASE_PROJECT_ID=demo-project
FIREBASE_EMULATOR_HUB=localhost:4000

使用Claude Desktop

增添 claude_desktop_config.json:

{
  "mcpServers": {
    "firebase": {
      "command": "node",
      "args": ["/path/to/firebase_mcp_server/dist/index.js"],
      "env": {
        "FIRESTORE_EMULATOR_HOST": "localhost:8080",
        "FIREBASE_PROJECT_ID": "your-project-id",
        "FIREBASE_EMULATOR_HUB": "localhost:4000"
      }
    }
  }
}

工具

工具 说明
list_collections 列出顶级Firestore收藏
list_subcollections 列出文档的子集合
list_documents 列出集合中的文档
get_document 按路径获取单个文档
query_collection 使用过滤器、排序、限制进行查询
get_function_logs 使用grep风格的过滤获取函数日志

get_function_logs选项

  • pattern -用于过滤日志消息的正则表达式
  • level -DEBUG/INFO/WARN/ERROR
  • functionName -按函数名称筛选
  • limit -最大条目数(默认值50)
  • since -ISO时间戳截止