Enable seamless Firebase storage, Firestore, and authentication integration with Firebase MCP AI assistant tools
The Firebase MCP (Model Context Protocol) server acts as a critical bridge, enabling AI assistant applications to interact seamlessly with Firebase services such as Firestore, Storage, and Authentication. By leveraging the Model Context Protocol, this server ensures that all compatible AI tools can access Firebase data efficiently without requiring significant customization or development.
The Firebase MCP server integrates multiple functionalities that extend beyond basic CRUD operations on Firebase collections and storage buckets. It supports sophisticated methods like Firestore document management, file uploads, and user authentication. These capabilities are crucial for modern AI applications, offering a unified platform to manage data across projects.
The server provides comprehensive tools for interacting with Firestore:
firestore_add_document
allows adding new documents to collections.firestore_list_documents
facilitates listing documents with optional filters.firestore_get_document
enables fetching a specific document by its ID.firestore_update_document
supports updating existing documents with updated data.firestore_delete_document
allows removing documents from collections.firestore_list_collections
provides an overview of all root-level collections.For seamless file handling, the server includes tools such as:
storage_list_files
and storage_get_file_info
.storage_upload
supports various input methods—local files, base64 content, plain text content, and URL import.storage_upload_from_url
function imports files directly from external sources.The server also integrates Firebase Authentication for secure user management:
auth_get_user
fetches users by their ID or email address.The architecture of the Firebase MCP server is designed to be modular and extensible, allowing easy integration with a wide range of AI applications. It follows a client-server model where:
The server uses TCP (Transmission Control Protocol) to facilitate secure, efficient communication between clients and the server. Each client sends structured JSON data over this protocol, which is then processed by the server according to predefined MCP protocol rules.
The MCP server's backend processes these requests using several key modules:
Before installing the server, ensure you have the following prerequisites:
The configuration file location varies based on the AI application:
~/Library/Application Support/Claude/claude_desktop_config.json
~/Library/Application Support/Code/User/settings.json
[project root]/.cursor/mcp.json
You can install the server configuration via npx or a local installation:
{
"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"
}
}
}
After setting up, verify that the AI application can communicate with Firebase using commands like please test all firebase mcp tools
.
The Firebase MCP server enables several key use cases within complex AI workflows:
Scenario: A team needs to collaboratively work on project reports stored in Firebase.
firestore_add_document
commands with local report files, which are then stored and accessible via Firestore.Scenario: An author wants to import chapter files from external sources for an eBook project hosted on Firebase Storage.
storage_upload_from_url
to enable URL-based imports.The Firebase MCP server supports integration with various AI application clients through a compatibility matrix:
Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
This matrix highlights that while all clients can access tools like Firestore and Storage, only certain clients support enhanced features such as custom prompts.
To ensure compatibility across different AI applications, the server is tested against a range of environments:
Environment | Compatibility |
---|---|
Mac OS 10.15+ | ✅ |
Windows 10+ | ✅ |
Linux Distributions | ✅ |
This wide compatibility ensures that developers can integrate the Firebase MCP server with their projects regardless of underlying operating systems.
The server enforces stringent security measures to protect data:
Key environment variables must be set for secure operation:
{
"SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/service-account-key.json",
"FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app"
}
Yes, it supports multiple methods for handling large files, including direct URL imports and chunked uploads.
Start by checking environment variables like API_KEY
. Ensure that credentials are correctly set.
Limits vary but generally, each project can store up to 10 million documents with specific performance and scalability settings.
Yes, by defining separate configurations for different projects, you can manage multiple Firebase environments within the same AI application workflow.
Ensure that Node.js 14.0.0 or higher is installed along with a compatible operating system to support smooth operation and performance optimization.
Developers looking to contribute should follow these guidelines:
Explore the broader context and use cases surrounding the Model Context Protocol here: Model Context Protocol
Connect with other tools and resources in the ecosystem:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD
subgraph "MCP Server"
B[MCP Client] --> C[MCP Protocol]
C --> A[Data Source/Tool]
end
subgraph "Firebase Services"
F1[Firestore]
F2[Storage]
F3[Authentication]
C --> F1 --> D[Database]
C --> F2 --> E[Storage]
C --> F3 --> G[User Database]
end
The Firebase MCP server stands as a cornerstone for integrating AI applications with essential Firebase services. By providing advanced features like document management, secure file handling, and robust authentication mechanisms, this server enhances the capabilities of any AI application, making it easier to manage complex data workflows efficiently. Developers looking to leverage this technology can look forward to a wide range of benefits and seamless integration options that bring new possibilities for building sophisticated applications.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration