Firebase MCP
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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
1. Go to Firebase Console → Project Settings → Service Accounts
2. Click "Generate new private key"
3. 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 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:
- Set to true to log to ~/.firebase-mcp/debug.log
- Set to a file path to log to a custom location
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 |
| ------------------------- | ------------------------- | -------------------------------- |