{"_id":"@dasasian/firebase-mcp-server","_rev":"2-2bd2ee3d317b84d427a46d7781a95ec0","name":"@dasasian/firebase-mcp-server","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@dasasian/firebase-mcp-server","version":"1.0.0","keywords":["mcp","firestore","firebase","schema-validation","claude-code","model-context-protocol"],"author":{"name":"Dasasian"},"license":"MIT","_id":"@dasasian/firebase-mcp-server@1.0.0","maintainers":[{"name":"damith-dasasian","email":"damith@dasasian.com"}],"homepage":"https://github.com/dasasian/firebase-mcp-server#readme","bugs":{"url":"https://github.com/dasasian/firebase-mcp-server/issues"},"bin":{"firebase-mcp":"dist/cli.js"},"dist":{"shasum":"d8b87a0ce24ae77f0e117d0fd6b349209cb0972f","tarball":"https://registry.npmjs.org/@dasasian/firebase-mcp-server/-/firebase-mcp-server-1.0.0.tgz","fileCount":199,"integrity":"sha512-Bo8zFM9H0u8No/n5USXFulkRUT6EpHiY5VP76GKSuPKSAKVYsWXnnmRKyQFe4qcb7NgoNm9PhR+b+Wv5k9BYAg==","signatures":[{"sig":"MEYCIQDG4vkNyaOibo38bf3fxbfq5IsWYNB+6kF6766vm2J9zAIhAJUyU08WlSOzJV+UzpSshZccyRoBa9coR5XrU48TRp1H","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":530106},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"1a714d3c0ce40e670de08d7e40b669bf66dbee8d","mcpName":"io.github.dasasian/firebase-mcp-server","scripts":{"cli":"tsx src/cli.ts","dev":"tsx src/index.ts","test":"vitest run","build":"tsc","watch":"tsc --watch","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"damith-dasasian","email":"damith@dasasian.com"},"repository":{"url":"git+https://github.com/dasasian/firebase-mcp-server.git","type":"git"},"_npmVersion":"11.3.0","description":"General-purpose MCP server for Firebase (Firestore, Storage, Auth) with schema-driven validation and context-efficient tools","directories":{},"_nodeVersion":"20.18.3","dependencies":{"ajv":"^8.12.0","diff":"^5.1.0","commander":"^11.0.0","ajv-formats":"^2.1.1","firebase-admin":"^12.0.0","@google-cloud/logging":"^11.2.0","@modelcontextprotocol/sdk":"^0.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","vitest":"^1.0.0","typescript":"^5.3.3","@types/diff":"^5.0.9","@types/node":"^20.11.0","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/firebase-mcp-server_1.0.0_1786851969797_0.46859483651307965","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@dasasian/firebase-mcp-server","mcpName":"io.github.dasasian/firebase-mcp-server","version":"1.1.0","description":"General-purpose MCP server for Firebase (Firestore, Storage, Auth) with schema-driven validation and context-efficient tools","type":"module","main":"dist/index.js","homepage":"https://dasasian.com/firebase-mcp-server","repository":{"type":"git","url":"git+https://github.com/dasasian/firebase-mcp-server.git"},"bugs":{"url":"https://github.com/dasasian/firebase-mcp-server/issues"},"publishConfig":{"access":"public"},"bin":{"firebase-mcp":"dist/cli.js"},"scripts":{"build":"tsc","watch":"tsc --watch","dev":"tsx src/index.ts","cli":"tsx src/cli.ts","typecheck":"tsc --noEmit","test":"vitest run","prepublishOnly":"npm run build"},"keywords":["mcp","firestore","firebase","schema-validation","claude-code","model-context-protocol"],"author":{"name":"Dasasian"},"license":"MIT","dependencies":{"@google-cloud/logging":"^11.2.0","@modelcontextprotocol/sdk":"^1.30.0","ajv":"^8.12.0","ajv-formats":"^2.1.1","commander":"^11.0.0","diff":"^5.1.0","firebase-admin":"^12.0.0"},"devDependencies":{"@types/diff":"^5.0.9","@types/json-schema":"^7.0.15","@types/node":"^20.11.0","tsx":"^4.7.0","typescript":"^5.3.3","vitest":"^1.0.0"},"engines":{"node":">=18.0.0"},"_id":"@dasasian/firebase-mcp-server@1.1.0","gitHead":"9c72690743f4f88d127eb3d1a5f86bd73e29ac4d","types":"./dist/index.d.ts","_nodeVersion":"20.18.3","_npmVersion":"11.3.0","dist":{"integrity":"sha512-JcqwuJ8qU+gYRFMchoE00J4XOvRG/uzgmFHI1XAo+V2o5yvIP5JDV3ukV0FRvcggEKnHuVpp8MVmxIYt7OQwXQ==","shasum":"3d6d0f2c9eadaa23ab6da002cbd1b7aa1cfdd054","tarball":"https://registry.npmjs.org/@dasasian/firebase-mcp-server/-/firebase-mcp-server-1.1.0.tgz","fileCount":207,"unpackedSize":581115,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEw6GT9Ale7f8hkvIfX0r0GYBSCd61Vuu7F7JxjAxrpdAiBseehovVhZoBbOoGIQIqz37Eri8TF4kaPDTOaUXjCttQ=="}]},"_npmUser":{"name":"damith-dasasian","email":"damith@dasasian.com"},"directories":{},"maintainers":[{"name":"damith-dasasian","email":"damith@dasasian.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/firebase-mcp-server_1.1.0_1786865295748_0.015683528253825685"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-16T03:46:09.581Z","modified":"2026-08-16T07:28:16.075Z","1.0.0":"2026-08-16T03:46:09.967Z","1.1.0":"2026-08-16T07:28:15.899Z"},"bugs":{"url":"https://github.com/dasasian/firebase-mcp-server/issues"},"author":{"name":"Dasasian"},"license":"MIT","homepage":"https://dasasian.com/firebase-mcp-server","keywords":["mcp","firestore","firebase","schema-validation","claude-code","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/dasasian/firebase-mcp-server.git"},"description":"General-purpose MCP server for Firebase (Firestore, Storage, Auth) with schema-driven validation and context-efficient tools","maintainers":[{"name":"damith-dasasian","email":"damith@dasasian.com"}],"readme":"# Firebase MCP Server\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@dasasian/firebase-mcp-server\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/@dasasian/firebase-mcp-server?style=flat-square&color=235a9b\"></a>\n  <a href=\"LICENSE\"><img alt=\"License: MIT\" src=\"https://img.shields.io/badge/license-MIT-235a9b?style=flat-square\"></a>\n  <a href=\"https://modelcontextprotocol.io\"><img alt=\"Model Context Protocol server\" src=\"https://img.shields.io/badge/MCP-server-235a9b?style=flat-square\"></a>\n  <img alt=\"Node 18+\" src=\"https://img.shields.io/badge/node-18%2B-5fa04e?style=flat-square\">\n</p>\n\nGeneral-purpose Model Context Protocol (MCP) server for Firebase (Firestore, Storage, Auth, Functions Logging) with schema-driven validation and context-efficient tools.\n\n## Features\n\n- **@ Mention Support** - Reference Firestore documents with `@firebase:firestore://users/user-123`\n- **Smart Autocomplete** - MRU cache tracks accessed documents for quick re-reference\n- **Auto-Discovery** - Shows both schema-based AND discovered collections\n- **Path-based schemas** - Follows Firebase `firestore.rules` convention\n- **Schema evolution** - Field status metadata (experimental → official → legacy)\n- **Hot reload** - File watching, no restart needed when schemas change\n- **Flexible validation** - Three modes: strict, warn (default), permissive\n- **Works without schemas** - Discovery mode for exploring unknown databases\n- **Context-efficient tools** - 99% token reduction for large datasets\n- **Index-aware queries** - Validates queries against `firestore.indexes.json`\n- **Functions logging** - SQL-like queries for Cloud Functions logs with aggregations and label filtering\n\n## Install\n\nAdd it to your MCP client (e.g. Claude Code) — runs via `npx`, no global install needed:\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"firebase\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@dasasian/firebase-mcp-server\", \"start\", \"./firestore-schemas.json\"]\n    }\n  }\n}\n```\n\n`start` takes an optional schema config path (default `./firestore-schemas.json`) and an optional indexes path (default `./firestore.indexes.json`) — see [Schema Format](#schema-format). Firebase auth uses Application Default Credentials.\n\nOr install the CLI globally:\n\n```bash\nnpm install -g @dasasian/firebase-mcp-server\nfirebase-mcp start ./firestore-schemas.json\n```\n\n## Development (from source)\n\n```bash\nnpm install\nnpm run build\nnpm run cli -- start --config ./examples/basic/firestore-schemas.json\n```\n\n## @ Mention Support (Resources)\n\nReference Firestore documents directly in Claude Code:\n\n```\nWhat's the email for @firebase:firestore://users/user-123?\nShow me all posts: @firebase:firestore://posts/*\n```\n\n### How It Works\n\nWhen you type `@firebase` in Claude Code:\n\n**Shows schema-based collections** (with validation):\n- 📋 Users (User account documents)\n- 📋 Posts (Blog post documents)\n- 📋 Comments (Comments on posts)\n\n**Plus auto-discovered collections** (no schema):\n- 🔍 analytics\n- 🔍 sessions\n- 🔍 audit_logs\n\n### Configuration\n\n```bash\n# Enable/disable auto-discovery (default: true)\nexport FIRESTORE_AUTO_DISCOVER=true\n\n# Cache duration in seconds (default: 300 = 5 minutes)\nexport FIRESTORE_DISCOVERY_CACHE_TTL=300\n```\n\n**Auto-discovery cost**: ~$0.0003/day (negligible)\n\n## Tools\n\nThe server ships 33 tools in four groups. Every tool declares MCP annotations\n(`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) so a client\ncan auto-approve reads and ask before writes.\n\n### Choosing which tools to load\n\nAll 33 tool definitions cost roughly 12k tokens of context on every session. If\nyou only need part of the surface, narrow it:\n\n```bash\n# Only Firestore (12 tools, ~4.3k tokens)\nfirebase-mcp start --tools firestore\n\n# Firestore plus Auth\nfirebase-mcp start --tools firestore,auth\n```\n\nOr set it in your MCP client config:\n\n```bash\nexport FIREBASE_MCP_TOOLS=firestore,storage\n```\n\nThe `--tools` flag wins over the environment variable. Leaving both unset loads\neverything, so upgrading never hides a tool you were already using. Calling a\ntool from a group you switched off returns an error naming the group to add.\n\n| Group | Tools | ~Tokens |\n|---|---:|---:|\n| `firestore` | 12 | 4,341 |\n| `storage` | 14 | 4,152 |\n| `auth` | 6 | 2,075 |\n| `logs` | 1 | 1,817 |\n| *all (default)* | *33* | *12,387* |\n\n### Firestore (12) — `--tools firestore`\n\n- `firestore_show_collections` — Show collections *(read)*\n- `firestore_read` — Read document *(read)*\n- `firestore_export` — Export collection *(read)*\n- `firestore_validate` — Validate against schema *(read)*\n- `firestore_query_select` — Query documents *(read)*\n- `firestore_query_collection_group` — Query collection group *(read)*\n- `firestore_count` — Count documents *(read)*\n- `firestore_sum` — Sum a field *(read)*\n- `firestore_stats` — Collection statistics *(read)*\n- `firestore_import` — Import document *(write, destructive)*\n- `firestore_update` — Update documents *(write, destructive)*\n- `firestore_delete` — Delete documents *(write, destructive)*\n\n### Firebase Auth (6) — `--tools auth`\n\n- `firebase_auth_list_users` — List users *(read)*\n- `firebase_auth_get_user` — Get user *(read)*\n- `firebase_auth_create_user` — Create user *(write)*\n- `firebase_auth_update_user` — Update user *(write, destructive)*\n- `firebase_auth_delete_user` — Delete user *(write, destructive)*\n- `firebase_auth_revoke_sessions` — Revoke sessions *(write, destructive)*\n\n### Firebase Storage (14) — `--tools storage`\n\n- `firebase_storage_list_buckets` — List buckets *(read)*\n- `firebase_storage_ls` — List files *(read)*\n- `firebase_storage_stat` — File metadata *(read)*\n- `firebase_storage_find` — Find files *(read)*\n- `firebase_storage_get_url` — Get file URL *(read)*\n- `firebase_storage_get_access` — Get file access *(read)*\n- `firebase_storage_read` — Download file to a local temp path *(write)*\n- `firebase_storage_upload` — Upload file *(write, destructive)*\n- `firebase_storage_rm` — Delete file *(write, destructive)*\n- `firebase_storage_cp` — Copy file *(write, destructive)*\n- `firebase_storage_mv` — Move file *(write, destructive)*\n- `firebase_storage_sync` — Sync bucket to local *(write, destructive)*\n- `firebase_storage_push` — Push local to bucket *(write, destructive)*\n- `firebase_storage_set_access` — Set file access *(write, destructive)*\n\n### Cloud Logging (1) — `--tools logs`\n\n- `firebase_functions_logs` — Query Cloud Functions logs with SQL-like syntax *(write)*\n\n`firebase_storage_read` and `firebase_functions_logs` are not marked read-only\nbecause they write: the first downloads to a local temp file, the second updates\nits auto-discovered logging schema on disk.\n\n**Example queries:**\n```json\n// Discover what functions exist\n{\"distinct\": \"functionName\"}\n\n// Show recent errors\n{\"where\": [{\"field\": \"severity\", \"operator\": \"==\", \"value\": \"ERROR\"}], \"limit\": 20}\n\n// Top error patterns with counts\n{\"groupBy\": [\"textPayload\"], \"aggregates\": [{\"field\": \"*\", \"operation\": \"count\", \"alias\": \"count\"}], \"where\": [{\"field\": \"severity\", \"operator\": \"==\", \"value\": \"ERROR\"}], \"orderBy\": [{\"field\": \"count\", \"direction\": \"desc\"}], \"limit\": 10}\n\n// Filter by custom labels (e.g., user, environment)\n{\"where\": [{\"field\": \"labels.user_id\", \"operator\": \"==\", \"value\": \"123\"}]}\n```\n\n## Schema Format\n\nSchemas follow Firebase's path-based convention:\n\n```json\n{\n  \"schemas\": {\n    \"/organizations/{organizationId}\": {\n      \"description\": \"Organization documents\",\n      \"schema\": {\n        \"type\": \"object\",\n        \"required\": [\"id\", \"name\"],\n        \"properties\": {\n          \"id\": { \"type\": \"string\" },\n          \"name\": { \"type\": \"string\" }\n        }\n      }\n    },\n    \"/organizations/{organizationId}/products/{productId}\": {\n      \"description\": \"Product catalog\",\n      \"schema\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"category\": {\n            \"type\": \"string\",\n            \"x-status\": \"legacy\",\n            \"x-replacedBy\": \"productType\"\n          },\n          \"productType\": {\n            \"type\": \"string\",\n            \"x-status\": \"experimental\"\n          }\n        }\n      },\n      \"timestampFields\": [\"createdAt\", \"updatedAt\"]\n    }\n  }\n}\n```\n\n## Documentation\n\n- [Installation Guide](docs/installation.md)\n- [@ Mention Support Guide](docs/resources-guide.md) - How to use `@firebase:firestore://` references\n- [Configuration Reference](docs/configuration.md)\n- [Schema Creation Guide](docs/schema-guide.md)\n- [Functions Logging Guide](docs/logging-guide.md) - Query Cloud Functions logs with SQL-like syntax, aggregations, and custom labels\n\n## License\n\nMIT\n","readmeFilename":"README.md"}