by gannonh
Enables AI assistants to interact with Firebase services—including Firestore, Storage, and Authentication—through an MCP server.
Firebase MCP provides an MCP server that lets AI assistants perform CRUD operations on Firestore, manage files in Firebase Storage, and handle user accounts via Authentication, all without writing code.
firestore_add_document
, storage_upload
) from the AI client.stdio
transport and optional HTTP transport for multi‑client access.SERVICE_ACCOUNT_KEY_PATH
; optional bucket, transport, port, host, debug logging.DEBUG_LOG_FILE
.Q: Which environment variables are required?
A: SERVICE_ACCOUNT_KEY_PATH
must point to the service‑account JSON file. All other variables are optional.
Q: Can I run the server without installing it globally?
A: Yes, use the recommended npx
command which fetches and runs the package on demand.
Q: How do I switch to HTTP transport?
A: Set MCP_TRANSPORT=http
and optionally define MCP_HTTP_PORT
, MCP_HTTP_HOST
, and MCP_HTTP_PATH
.
Q: What if I see a Zod validation error for firestore_list_collections
?
A: It is a known client‑side validation bug that does not affect the actual query result.
Q: How can I enable persistent logs?
A: Set DEBUG_LOG_FILE=true
to log to ~/.firebase-mcp/debug.log
or provide a custom path.
Firebase MCP enables AI assistants to work directly with Firebase services, including:
The server works with MCP client applicatios such as Claude Desktop, Augment Code, VS Code, and Cursor.
⚠️ Known Issue: The
firestore_list_collections
tool may return a Zod validation error in the client logs. This is an erroneous validation error in the MCP SDK, as our investigation confirmed no boolean values are present in the response. Despite the error message, the query still works correctly and returns the proper collection data. This is a log-level error that doesn't affect functionality.
Add the server configuration to your MCP settings file:
~/Library/Application Support/Claude/claude_desktop_config.json
~/Library/Application Support/Code/User/settings.json
[project root]/.cursor/mcp.json
MCP Servers can be installed manually or at runtime via npx (recommended). How you install determines your configuration:
{
"firebase-mcp": {
"command": "npx",
"args": [
"-y",
"@gannonh/firebase-mcp"
],
"env": {
"SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/serviceAccountKey.json",
"FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app"
}
}
}
{
"firebase-mcp": {
"command": "node",
"args": [
"/absolute/path/to/firebase-mcp/dist/index.js"
],
"env": {
"SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/serviceAccountKey.json",
"FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app"
}
}
}
Ask your AI client: "Please test all Firebase MCP tools."
SERVICE_ACCOUNT_KEY_PATH
: Path to your Firebase service account key JSON (required)FIREBASE_STORAGE_BUCKET
: Bucket name for Firebase Storage (defaults to [projectId].appspot.com
)MCP_TRANSPORT
: Transport type to use (stdio
or http
) (defaults to stdio
)MCP_HTTP_PORT
: Port for HTTP transport (defaults to 3000
)MCP_HTTP_HOST
: Host for HTTP transport (defaults to localhost
)MCP_HTTP_PATH
: Path for HTTP transport (defaults to /mcp
)DEBUG_LOG_FILE
: Enable file logging:
true
to log to ~/.firebase-mcp/debug.log
Edit: ~/Library/Application Support/Claude/claude_desktop_config.json
Edit: ~/Library/Application Support/Code/User/settings.json
Edit: [project root]/.cursor/mcp.json
Tool | Description | Required Parameters |
---|---|---|
firestore_add_document |
Add a document to a collection | collection , data |
firestore_list_documents |
List documents with filtering | collection |
firestore_get_document |
Get a specific document | collection , id |
firestore_update_document |
Update an existing document | collection , id , data |
firestore_delete_document |
Delete a document | collection , id |
firestore_list_collections |
List root collections | None |
firestore_query_collection_group |
Query across subcollections | collectionId |
Tool | Description | Required Parameters |
---|---|---|
storage_list_files |
List files in a directory | None (optional: directoryPath ) |
storage_get_file_info |
Get file metadata and URL | filePath |
storage_upload |
Upload file from content | filePath , content |
storage_upload_from_url |
Upload file from URL | filePath , url |
Tool | Description | Required Parameters |
---|---|---|
auth_get_user |
Get user by ID or email | identifier |
git clone https://github.com/gannonh/firebase-mcp
cd firebase-mcp
npm install
npm run build
First, install and start Firebase emulators:
npm install -g firebase-tools
firebase init emulators
firebase emulators:start
Then run tests:
# Run tests with emulator
npm run test:emulator
# Run tests with coverage
npm run test:coverage:emulator
src/
├── index.ts # Server entry point
├── utils/ # Utility functions
└── lib/
└── firebase/ # Firebase service clients
├── authClient.ts # Authentication operations
├── firebaseConfig.ts # Firebase configuration
├── firestoreClient.ts # Firestore operations
└── storageClient.ts # Storage operations
Firebase MCP now supports HTTP transport in addition to the default stdio transport. This allows you to run the server as a standalone HTTP service that can be accessed by multiple clients.
To run the server with HTTP transport:
# Using environment variables
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/index.js
# Or with npx
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 npx @gannonh/firebase-mcp
When using HTTP transport, configure your MCP client to connect to the HTTP endpoint:
{
"firebase-mcp": {
"url": "http://localhost:3000/mcp"
}
}
The HTTP transport supports session management, allowing multiple clients to connect to the same server instance. Each client receives a unique session ID that is used to maintain state between requests.
If you see "The specified bucket does not exist" error:
FIREBASE_STORAGE_BUCKET
environment variableIf you see "Firebase is not initialized" error:
If you receive "This query requires a composite index" error:
firestore_list_collections
If you see a Zod validation error with message "Expected object, received boolean" when using the firestore_list_collections
tool:
⚠️ Known Issue: The
firestore_list_collections
tool may return a Zod validation error in the client logs. This is an erroneous validation error in the MCP SDK, as our investigation confirmed no boolean values are present in the response. Despite the error message, the query still works correctly and returns the proper collection data. This is a log-level error that doesn't affect functionality.
To help diagnose issues, you can enable file logging:
# Log to default location (~/.firebase-mcp/debug.log)
DEBUG_LOG_FILE=true npx @gannonh/firebase-mcp
# Log to a custom location
DEBUG_LOG_FILE=/path/to/custom/debug.log npx @gannonh/firebase-mcp
You can also enable logging in your MCP client configuration:
{
"firebase-mcp": {
"command": "npx",
"args": ["-y", "@gannonh/firebase-mcp"],
"env": {
"SERVICE_ACCOUNT_KEY_PATH": "/path/to/serviceAccountKey.json",
"FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app",
"DEBUG_LOG_FILE": "true"
}
}
}
To view logs in real-time:
# Using tail to follow the log file
tail -f ~/.firebase-mcp/debug.log
# Using a split terminal to capture stderr
npm start 2>&1 | tee logs.txt
The MCP Inspector provides interactive debugging:
# Install MCP Inspector
npm install -g @mcp/inspector
# Connect to your MCP server
mcp-inspector --connect stdio --command "node ./dist/index.js"
{
"name": "reports/quarterly.pdf",
"size": "1024000",
"contentType": "application/pdf",
"updated": "2025-04-11T15:37:10.290Z",
"downloadUrl": "https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media",
"bucket": "your-project.appspot.com"
}
Displayed to the user as:
## File Successfully Uploaded! 📁
Your file has been uploaded to Firebase Storage:
**File Details:**
- **Name:** reports/quarterly.pdf
- **Size:** 1024000 bytes
- **Type:** application/pdf
- **Last Updated:** April 11, 2025 at 15:37:10 UTC
**[Click here to download your file](https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media)**
MIT License - see LICENSE file for details
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "firebase-mcp": { "command": "npx", "args": [ "-y", "@gannonh/firebase-mcp" ], "env": { "SERVICE_ACCOUNT_KEY_PATH": "<YOUR_SERVICE_ACCOUNT_KEY_PATH>", "FIREBASE_STORAGE_BUCKET": "<YOUR_FIREBASE_STORAGE_BUCKET>", "MCP_TRANSPORT": "stdio", "DEBUG_LOG_FILE": "true" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.