
Firebase Mcp Server
io.github.dasasian由 GitHub 账号 dasasian 发布v1.1.0更新于 Oct 24, 2026
MCP server for Firebase — Firestore, Storage, Auth, and Cloud Logging, with schema validation.
概览
一个本地 Firebase MCP 服务器,让助手浏览、查询和修改 Firestore、Storage 与 Auth 数据,并查询 Cloud Functions 日志。
- 可以做什么
- 浏览和读取 Firestore 集合与文档,执行查询、计数、求和和统计,并按基于路径的 schema 校验文档,可选自动发现未登记的集合和索引感知的查询检查。导入、更新和删除 Firestore 文档。列出、读取、上传、复制、移动、同步和删除 Storage 文件,并查看或设置文件访问权限。列出、创建、更新和删除 Auth 用户,并撤销其会话。用类 SQL 的过滤、分组和聚合查询 Cloud Functions 日志。
- 适用场景
- 当你使用 Firebase 项目,希望助手在不离开对话的情况下查看或编辑 Firestore 数据、管理 Storage 文件或 Auth 用户,或排查 Cloud Functions 日志时适用。提供 schema 文件可增强校验和自动补全,但在未知数据库上也能以发现模式工作。
- 运行要求
- 通过 npx 或全局 npm 安装本地运行(需要 Node.js)。Firebase 认证使用应用默认凭据,因此需要已配置的 Google Cloud/Firebase 项目和凭据。启动时可传入可选的 schema 与索引 JSON 路径;可用命令行参数或环境变量限制工具组。读取函数日志需要为 Admin SDK 服务账号授予日志查看访问的 IAM 角色。
安装
在 SourceWeft 中
- 打开 控制台中的 Firebase Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Firebase MCP Server
[npm] [License: MIT] [Model Context Protocol server] [Node 18+]
General-purpose Model Context Protocol (MCP) server for Firebase (Firestore, Storage, Auth, Functions Logging) with schema-driven validation and context-efficient tools.
Features
- @ Mention Support - Reference Firestore documents with
@firebase:firestore://users/user-123 - Smart Autocomplete - MRU cache tracks accessed documents for quick re-reference
- Auto-Discovery - Shows both schema-based AND discovered collections
- Path-based schemas - Follows Firebase
firestore.rulesconvention - Schema evolution - Field status metadata (experimental → official → legacy)
- Hot reload - File watching, no restart needed when schemas change
- Flexible validation - Three modes: strict, warn (default), permissive
- Works without schemas - Discovery mode for exploring unknown databases
- Context-efficient tools - 99% token reduction for large datasets
- Index-aware queries - Validates queries against
firestore.indexes.json - Functions logging - SQL-like queries for Cloud Functions logs with aggregations and label filtering
Install
Add it to your MCP client (e.g. Claude Code) — runs via npx, no global install needed:
start takes an optional schema config path (default ./firestore-schemas.json) and an optional indexes path (default ./firestore.indexes.json) — see Schema Format. Firebase auth uses Application Default Credentials.
Or install the CLI globally:
Development (from source)
@ Mention Support (Resources)
Reference Firestore documents directly in Claude Code:
How It Works
When you type @firebase in Claude Code:
Shows schema-based collections (with validation):
- 📋 Users (User account documents)
- 📋 Posts (Blog post documents)
- 📋 Comments (Comments on posts)
Plus auto-discovered collections (no schema):
- 🔍 analytics
- 🔍 sessions
- 🔍 audit_logs
Configuration
Auto-discovery cost: ~$0.0003/day (negligible)
Tools
The server ships 33 tools in four groups. Every tool declares MCP annotations
(readOnlyHint, destructiveHint, idempotentHint, openWorldHint) so a client
can auto-approve reads and ask before writes.
Choosing which tools to load
All 33 tool definitions cost roughly 12k tokens of context on every session. If you only need part of the surface, narrow it:
Or set it in your MCP client config:
The --tools flag wins over the environment variable. Leaving both unset loads
everything, so upgrading never hides a tool you were already using. Calling a
tool from a group you switched off returns an error naming the group to add.
Firestore (12) — --tools firestore
firestore_show_collections— Show collections (read)firestore_read— Read document (read)firestore_export— Export collection (read)firestore_validate— Validate against schema (read)firestore_query_select— Query documents (read)firestore_query_collection_group— Query collection group (read)firestore_count— Count documents (read)firestore_sum— Sum a field (read)firestore_stats— Collection statistics (read)firestore_import— Import document (write, destructive)firestore_update— Update documents (write, destructive)firestore_delete— Delete documents (write, destructive)
Firebase Auth (6) — --tools auth
firebase_auth_list_users— List users (read)firebase_auth_get_user— Get user (read)firebase_auth_create_user— Create user (write)firebase_auth_update_user— Update user (write, destructive)firebase_auth_delete_user— Delete user (write, destructive)firebase_auth_revoke_sessions— Revoke sessions (write, destructive)
Firebase Storage (14) — --tools storage
firebase_storage_list_buckets— List buckets (read)firebase_storage_ls— List files (read)firebase_storage_stat— File metadata (read)firebase_storage_find— Find files (read)firebase_storage_get_url— Get file URL (read)firebase_storage_get_access— Get file access (read)firebase_storage_read— Download file to a local temp path (write)firebase_storage_upload— Upload file (write, destructive)firebase_storage_rm— Delete file (write, destructive)firebase_storage_cp— Copy file (write, destructive)firebase_storage_mv— Move file (write, destructive)firebase_storage_sync— Sync bucket to local (write, destructive)firebase_storage_push— Push local to bucket (write, destructive)firebase_storage_set_access— Set file access (write, destructive)
Cloud Logging (1) — --tools logs
firebase_functions_logs— Query Cloud Functions logs with SQL-like syntax (write)
firebase_storage_read and firebase_functions_logs are not marked read-only
because they write: the first downloads to a local temp file, the second updates
its auto-discovered logging schema on disk.
Reading function logs needs an extra IAM role. The Firebase Admin SDK service account has no Cloud Logging access by default, so
firebase_functions_logsfails withPERMISSION_DENIED: Permission denied for all log viewseven when every other tool works. Grant the role and allow a few minutes for it to take effect:
roles/logging.vieweralone may not be enough — the error names log views, and thelogging.views.accesspermission is inviewAccessor.
Example queries:
Schema Format
Schemas follow Firebase's path-based convention:
Documentation
- Installation Guide
- @ Mention Support Guide - How to use
@firebase:firestore://references - Configuration Reference
- Schema Creation Guide
- Functions Logging Guide - Query Cloud Functions logs with SQL-like syntax, aggregations, and custom labels
License
MIT
来源:README.md,提交 0d4d5b3
工具
0版本历史
1- v1.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分