The Firebase MCP server enables AI assistants to interact with Firebase services including Firestore, Storage, and Authentication.
- Firestore Operations:
- Add, retrieve, update, and delete documents
- List collections and documents with filtering and pagination
- Query across subcollections using collection groups
- Storage Operations:
- List files and retrieve file metadata/download URLs
- Upload files from content or URLs
- Authentication Operations:
- Retrieve user information by ID or email
Provides integration with Firebase services including Authentication for user management and verification, Firestore for document database operations, and Storage for file storage and retrieval
Firebase MCP
Overview
Firebase MCP enables AI assistants to work directly with Firebase services, including:
- Firestore: Document database operations
- Storage: File management with robust upload capabilities
- Authentication: User management and verification
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.
⚡ Quick Start
Prerequisites
- Firebase project with service account credentials
- Node.js environment
1. Install MCP Server
Add the server configuration to your MCP settings file:
- Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
- Augment:
~/Library/Application Support/Code/User/settings.json
- Cursor:
[project root]/.cursor/mcp.json
MCP Servers can be installed manually or at runtime via npx (recommended). How you install determines your configuration:
Configure for npx (recommended)
Configure for local installation
2. Test the Installation
Ask your AI client: "Please test all Firebase MCP tools."
🛠️ Setup & Configuration
1. Firebase Configuration
- Go to Firebase Console → Project Settings → Service Accounts
- Click "Generate new private key"
- Save the JSON file securely
2. Environment Variables
Required
SERVICE_ACCOUNT_KEY_PATH
: Path to your Firebase service account key JSON (required)
Optional
FIREBASE_STORAGE_BUCKET
: Bucket name for Firebase Storage (defaults to[projectId].appspot.com
)MCP_TRANSPORT
: Transport type to use (stdio
orhttp
) (defaults tostdio
)MCP_HTTP_PORT
: Port for HTTP transport (defaults to3000
)MCP_HTTP_HOST
: Host for HTTP transport (defaults tolocalhost
)MCP_HTTP_PATH
: Path for HTTP transport (defaults to/mcp
)DEBUG_LOG_FILE
: Enable file logging:- Set to
true
to log to~/.firebase-mcp/debug.log
- Set to a file path to log to a custom location
- Set to
3. Client Integration
Claude Desktop
Edit: ~/Library/Application Support/Claude/claude_desktop_config.json
VS Code / Augment
Edit: ~/Library/Application Support/Code/User/settings.json
Cursor
Edit: [project root]/.cursor/mcp.json
📚 API Reference
Firestore Tools
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 |
Storage Tools
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 |
Authentication Tools
Tool | Description | Required Parameters |
---|---|---|
auth_get_user | Get user by ID or email | identifier |
💻 Developer Guide
Installation & Building
Running Tests
First, install and start Firebase emulators:
Then run tests:
Project Structure
🌐 HTTP Transport
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.
Running with HTTP Transport
To run the server with HTTP transport:
Client Configuration for HTTP
When using HTTP transport, configure your MCP client to connect to the HTTP endpoint:
Session Management
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.
🔍 Troubleshooting
Common Issues
Storage Bucket Not Found
If you see "The specified bucket does not exist" error:
- Verify your bucket name in Firebase Console → Storage
- Set the correct bucket name in
FIREBASE_STORAGE_BUCKET
environment variable
Firebase Initialization Failed
If you see "Firebase is not initialized" error:
- Check that your service account key path is correct and absolute
- Ensure the service account has proper permissions for Firebase services
Composite Index Required
If you receive "This query requires a composite index" error:
- Look for the provided URL in the error message
- Follow the link to create the required index in Firebase Console
- Retry your query after the index is created (may take a few minutes)
Zod Validation Error with 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.
Debugging
Enable File Logging
To help diagnose issues, you can enable file logging:
You can also enable logging in your MCP client configuration:
Real-time Log Viewing
To view logs in real-time:
Using MCP Inspector
The MCP Inspector provides interactive debugging:
📋 Response Formatting
Storage Upload Response Example
Displayed to the user as:
🤝 Contributing
- Fork the repository
- Create a feature branch
- Implement changes with tests (80%+ coverage required)
- Submit a pull request
📄 License
MIT License - see LICENSE file for details
🔗 Related Resources
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
The Firebase MCP server provides a standardized interface to interact with Firebase services, including Firebase Authentication, Firestore, and Firebase Storage.
- Overview
- ⚡ Quick Start
- 🛠️ Setup & Configuration
- 📚 API Reference
- 💻 Developer Guide
- 🌐 HTTP Transport
- 🔍 Troubleshooting
- 📋 Response Formatting
- 🤝 Contributing
- 📄 License
- 🔗 Related Resources
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA server providing a unified interface to interact with Firebase services, including Authentication, Firestore, and Storage.Last updated -97TypeScript
- -securityFlicense-qualityAn MCP server that provides access to Firebase Remote Config, allowing clients to interact with and manage Firebase remote configuration settings through the Model Context Protocol.Last updated -TypeScript
- -securityFlicense-qualityAuto-generated MCP server that enables interaction with the Firebase App Distribution API, allowing users to manage distribution of pre-release app builds to testers through natural language commands.Last updated -Python
- -securityFlicense-qualityAn MCP Server providing access to Google's Firebase API, allowing natural language interaction with Firebase services and resources.Last updated -Python