fi

firebase-mcp

Firebase services including Auth, Firestore and Storage.

Publisherfirebase-mcp
Submitted date4/13/2025

Firebase MCP: Supercharge Your LLMs with Firebase Integration ๐Ÿš€

Project Logo

Firebase MCP server

Firebase Tests CI

Overview

Firebase MCP bridges the gap between Large Language Models (LLMs) and the robust backend services of Firebase, enabling AI assistants to seamlessly interact with your data and infrastructure. By leveraging the Model Context Protocol (MCP), this integration empowers LLMs to perform real-time operations on:

  • Firestore: Execute complex document database operations with ease.
  • Storage: Manage files effortlessly, including advanced upload capabilities.
  • Authentication: Securely manage and verify user identities.

This server is designed to be compatible with leading MCP client applications such as Claude Desktop, Augment Code, VS Code, and Cursor, providing a unified experience across your AI development workflow.

โšก Quick Start: Get Up and Running in Minutes

Prerequisites

  • A Firebase project with service account credentials.
  • A Node.js environment (v16 or higher recommended).

1. Installation and Configuration

Choose your preferred installation method:

Option 1: Runtime Installation with npx (Recommended)

This method offers the simplest setup and ensures you're always running the latest version.

  1. Locate 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
  2. Add the following configuration to your MCP settings file:

    { "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.appspot.com" } } }
    • Replace /absolute/path/to/serviceAccountKey.json with the actual path to your Firebase service account key file.
    • Replace your-project-id.appspot.com with your Firebase Storage bucket name. If you haven't customized your storage bucket, it will follow this naming convention.

Option 2: Manual Installation

This method provides more control over the installation process.

  1. Install the package:

    npm install -g @gannonh/firebase-mcp
  2. Locate your MCP settings file: (See paths above)

  3. Add the following configuration to your MCP settings file:

    { "firebase-mcp": { "command": "node", "args": [ "/path/to/global/node_modules/@gannonh/firebase-mcp/dist/index.js" ], "env": { "SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/serviceAccountKey.json", "FIREBASE_STORAGE_BUCKET": "your-project-id.appspot.com" } } }
    • Replace /path/to/global/node_modules/@gannonh/firebase-mcp/dist/index.js with the actual path to the index.js file within the installed package. You can find this path by running npm list -g @gannonh/firebase-mcp.
    • Replace /absolute/path/to/serviceAccountKey.json with the actual path to your Firebase service account key file.
    • Replace your-project-id.appspot.com with your Firebase Storage bucket name.

2. Verification

After configuring Firebase MCP, verify the installation by prompting your AI client with:

"Please test all Firebase MCP tools."

This will trigger a series of tests to ensure that all Firebase services are correctly connected and functioning.

๐Ÿ”ฅ Unleash the Power: Storage Upload Features (v1.3.3)

Firebase MCP v1.3.3 introduces advanced file upload capabilities, enabling seamless integration of files into your Firebase Storage. This release includes two specialized tools:

  • storage_upload: Upload files from various sources, including text, base64 encoded data, and local file paths.
  • storage_upload_from_url: Import files directly from external URLs, streamlining content ingestion.

Key Advantages

  • Permanent Public URLs: Generate non-expiring public URLs for easy access and sharing.
  • Intelligent Content Type Detection: Automatically detect content types based on file extensions and data, ensuring proper handling of uploaded files.
  • Versatile Upload Methods: Choose the most suitable method for your specific use case, providing maximum flexibility.
  • Informative Response Formatting: Receive clear and well-structured upload confirmations, simplifying integration and debugging.

Supported Upload Methods

  1. Local File Path (Recommended for all file types)

    { filePath: "my-report.pdf", content: "/path/to/local/file.pdf" }
  2. Base64 Data URL (Ideal for smaller files)

    { filePath: "my-image.png", content: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." }
  3. Plain Text (Suitable for text-based files)

    { filePath: "readme.md", content: "# My README\n\nThis is a markdown file." }
  4. External URL (Utilizing storage_upload_from_url)

    { filePath: "document.pdf", url: "https://example.com/document.pdf" }

โš ๏ธ Important: For optimal reliability with binary files (e.g., images, PDFs), always prioritize the direct file path method.

๐Ÿ› ๏ธ Detailed Setup and Configuration Guide

1. Firebase Project Setup

  1. Navigate to the Firebase Console.
  2. Select your project and go to "Project Settings" โ†’ "Service Accounts".
  3. Click "Generate new private key" to download your service account key JSON file.
  4. Store the JSON file securely, as it grants administrative access to your Firebase project.

2. Environment Variables

Configure the following environment variables for Firebase MCP:

  • SERVICE_ACCOUNT_KEY_PATH: The absolute path to your Firebase service account key JSON file (required).
  • FIREBASE_STORAGE_BUCKET: The name of your Firebase Storage bucket (optional). If not specified, it defaults to [projectId].appspot.com.

3. Client-Specific Integration

Refer to the following paths for configuring Firebase MCP within your preferred client application:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • VS Code / Augment: ~/Library/Application Support/Code/User/settings.json
  • Cursor: [project root]/.cursor/mcp.json

๐Ÿ“š Comprehensive API Reference

Firestore Tools

| Tool | Description document.

Visit More

View All