Provides access to Firestore collections and Storage buckets, allowing users to query assets, versions, and comments, and search for files within a Digital Asset Management system.
Utilizes Google Cloud service accounts to provide secure, restricted access to Firestore databases and Cloud Storage objects.
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 DAM MCP ServerFind assets with the tag 'banner' uploaded after 2024-06-01"
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 Server
A Model Context Protocol (MCP) server implementation for accessing Firebase Firestore and Storage, built with Python and FastMCP.
Overview
This MCP server provides secure access to Firebase Firestore collections and Storage buckets through MCP-compliant tools. It's designed specifically for a Digital Asset Management (DAM) system with predefined collections and access patterns.
Features
MCP Protocol Compliance: Fully compliant with the official MCP specification
Firestore Access: Query
assets,versions, andcommentscollectionsStorage Access: Search files in the Firebase Storage bucket
Flexible Filtering: Support for various filter operators including date ranges
Dual Transport: Support for both stdio and HTTP transports
Docker Support: Containerized deployment with Docker
Security: Service account-based authentication with restricted access
Installation
Prerequisites
Python 3.11 or higher
Firebase project with Firestore and Storage enabled
Google Cloud service account with appropriate permissions
Dependencies
Required Python Packages
fastmcp>=0.1.0firebase-admin>=6.5.0python-dateutil>=2.8.2typing-extensions>=4.9.0
Usage
Command Line
Docker
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
Service Account Setup
⚠️ SECURITY WARNING: Never commit credentials files to version control!
Create a service account in your Firebase project
Download the JSON credentials file
Copy
credentials.json.exampletocredentials.jsonand fill in your actual valuesGrant the service account the following permissions:
Firestore:
Firebase Rules System,Cloud Datastore UserStorage:
Storage Object Viewer
Available Tools
search_assets
Search assets in the Firestore assets collection.
Schema:
id: string - Unique asset identifiertitle: string - Asset titledescription: string - Asset descriptioncategory: string - Asset categorytags: string[] - Array of tagsuploader: string - User ID who uploadeduploadedAt: string - ISO8601 timestampupdatedAt: string - ISO8601 timestampvisibility: 'public' | 'private'latestVersionId: string (optional)
Example:
search_versions
Search versions in the Firestore versions collection.
Schema:
id: string - Unique version identifierassetId: string - Parent asset IDversion: string - Version identifierfileUrl: string - URL to the filefileName: string - Original filenamefileType: string - MIME typefileSize: number - File size in bytesupdatedAt: string - ISO8601 timestampupdatedBy: string - User ID who updated
Example:
search_comments
Search comments in the Firestore comments collection.
Schema:
id: string - Unique comment identifierassetId: string - Asset being commented onuser: string - User ID who commentedtext: string - Comment textcreatedAt: string - ISO8601 timestamp
Example:
search_asset_files
Search files in the Firebase Storage bucket.
Returns:
name: string - Full file pathsize: number - File size in bytescontentType: string - MIME typeuploadedAt: string - ISO8601 timestampdownloadUrl: string - Public URLetag: string - ETag for versioninggeneration: number - File generation
Example:
Filter Operators
==- Equality (default)>=- Greater than or equal (for dates)<=- Less than or equal (for dates)array_contains_any- Array contains any of the valuesin- Value is in the provided array
Architecture
Security Notes
Collections and bucket names are hardcoded in the source code
Access is restricted to read-only operations
Service account credentials are required for authentication
No sensitive data is logged or exposed
Development
Setup Development Environment
Running Tests
Code Quality
Test Coverage
Docker Testing
Test Categories
Unit Tests (
tests/unit/): Fast tests with mocked dependenciesIntegration Tests (
tests/integration/): Tests MCP protocol communicationSlow Tests (marked with
@pytest.mark.slow): Performance and stress tests
Writing Tests
Continuous Integration
Tests run automatically on:
Push to
main/masterbranchPull request creation
Multiple Python versions (3.10, 3.11, 3.12)
The CI pipeline includes:
Unit tests with coverage
Integration tests
Code quality checks (linting, typing, security)
Docker build verification
Troubleshooting
Common Issues
Credentials not found: Ensure the service account JSON file path is correct
Permission denied: Verify the service account has the required Firebase permissions
Connection issues: Check network connectivity and Firebase project settings
Import errors: Ensure all dependencies are installed correctly
Debug Mode
Enable debug logging to see detailed operation logs:
License
This project is licensed under the MIT License.