firebase-mcp
Exposes Firebase Firestore and Authentication to AI agents, enabling read operations on Firestore (listing collections/documents, queries, aggregations, schema inference, etc.) and Auth user lookup (by UID or email, with pagination).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@firebase-mcplist collections in Firestore"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
firebase-mcp
A Model Context Protocol (MCP) server that exposes Firebase Firestore and Authentication to AI agents. Built with the Firebase Admin SDK, it runs over stdio and is designed to be wired directly into any MCP-compatible host (Cursor, Claude Desktop, etc.).
Features
13 Firestore read operations — list/browse collections and documents, query (including collection groups), aggregates, counts, schema sampling, composite indexes, distinct value counts, and
list_pathsfor configured path templates2 Firebase Auth operations — look up users by UID or email, list users with pagination
Multi-project support — configure multiple Firebase projects in one config file; each tool call targets a specific project via
projectIdGlob-based access control — allow/deny rules evaluated per Firestore path before any read is performed
Pagination on
query_collection,read_collection, andlist_usersvia cursor-based tokensBatch fetching with configurable
maxBatchFetchSizeSchema inference via
get_collection_schema— samples documents and infers field types without reading the full collectionDistinct value counts via
distinct_values— count occurrences of unique field values across a collection or collection groupNormalized output — Firestore Timestamps, GeoPoints, and DocumentReferences are converted to JSON-serializable values on all tools
Zero runtime state — each tool call hits Firebase directly through the Admin SDK
Related MCP server: MCP Firebase Server
Tools
Config
Tool | Description |
| Returns a full config template (every supported field) and setup instructions. Use this when no |
| Returns the current in-memory config, listing all available projects. Call this first to discover valid |
| Re-reads |
Firestore (firestore_read)
All operations are dispatched through the single firestore_read tool via the operation field. Every call requires a projectId matching a key in firebase-mcp.json.
Operation | Description |
| Lists named |
| List root collections or subcollections of a document. Optionally include document counts. |
| List all document IDs in a collection, including phantom documents. Optionally include subcollection names. |
| Read documents from a collection with optional phantom-doc surfacing. |
| Fetch a single document by path. |
| Batch-fetch documents by a list of paths or a collection + ID list. |
| Query with filters, ordering, limit, and pagination. |
| Query across all collections sharing the same name, regardless of parent path. |
| Server-side document count with optional filters. |
| Native |
| Sample a collection from both ends and infer field types. |
| List Firestore composite indexes for the project. |
| Count occurrences of each unique value (or value combination) of one or more fields across a collection or collection group. |
Auth (auth_read)
All operations are dispatched through the single auth_read tool via the operation field. Every call requires a projectId.
Operation | Description |
| Fetch a Firebase Auth user by UID or email. |
| List Firebase Auth users with optional pagination via |
Requirements
Node.js 18+
A Firebase project with Firestore enabled
A service account JSON key with Firestore and Auth read permissions
Setup
1. Create your per-user firebase-mcp.json
Create the file at:
Linux/macOS:
~/.config/firebase-mcp/firebase-mcp.jsonWindows:
%USERPROFILE%\AppData\Roaming\firebase-mcp\firebase-mcp.json
The config supports multiple projects under a projects key. Each key becomes the projectId value you pass to tool calls.
{
"projects": {
"my-app": {
"firebase": {
"projectId": "your-firebase-project-id",
"serviceAccountPath": "secrets/serviceAccount.json"
},
"firestore": {
"rules": {
"allow": ["**"],
"deny": []
},
"maxCollectionReadSize": 100,
"maxBatchFetchSize": 200,
"paths": {
"example_orders": {
"template": "customers/{customerId}/orders",
"description": "Optional hint for agents; omit or replace with your own entries"
}
}
},
"timeouts": {
"callMs": 15000
}
}
}
}To configure multiple projects, add additional keys under projects:
{
"projects": {
"prod": { "firebase": { ... }, "firestore": { ... } },
"staging": { "firebase": { ... }, "firestore": { ... } }
}
}2. Add your service account key
Place your Firebase service account JSON at any path you prefer — you'll reference it in firebase-mcp.json above. Paths are resolved relative to the working directory when the server starts, or you can use an absolute path.
3. Wire it into your MCP host
See the Connecting to Cursor section below — no installation step required when using npx.
Configuration
Field | Type | Default | Description |
|
| — | Map of project keys to project configs |
|
| — | Firebase project ID |
|
| — | Path to service account JSON (relative to CWD or absolute) |
|
| — | Glob patterns for allowed Firestore paths |
|
| — | Glob patterns for denied Firestore paths (evaluated first) |
|
|
| Default document limit for collection reads |
|
|
| Maximum documents per batch fetch |
|
|
| Named path templates ( |
|
|
| Max duration of a single tool call in ms (integer, min |
The server reads config from a deterministic per-user path:
Linux/macOS:
~/.config/firebase-mcp/firebase-mcp.jsonWindows:
%USERPROFILE%\AppData\Roaming\firebase-mcp\firebase-mcp.json
Access Control
Firestore path access is governed by glob patterns evaluated with micromatch. Deny rules take precedence over allow rules. Every tool call checks the target path before hitting Firestore.
{
"rules": {
"allow": ["users/**", "products/**"],
"deny": ["users/*/private/**"]
}
}Connecting to Cursor
Add to your MCP config (e.g. .cursor/mcp.json):
{
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-mcp"]
}
}
}npx -y will download and cache the package automatically on first run. No manual installation needed.
firestore_read and auth_read are safe to add to Cursor's tool allowlist for unattended use. get_config, reload_config, and create_config are also read-only and safe to allowlist.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-h-u-h-a-r-i/firebase-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server