Back to Browse

Firebase MCP Server

Data & AnalyticsUse Caution4.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

MCP server for Firebase — Firestore, Storage, Auth, and Cloud Logging, with schema validation.

About

MCP server for Firebase — Firestore, Storage, Auth, and Cloud Logging, with schema validation.

Security Report

4.2
Use Caution4.2High Risk

This Firebase MCP server is well-structured with appropriate authentication via Application Default Credentials and properly scoped permissions matching its data analytics purpose. However, several security concerns warrant attention: the server reads and processes potentially sensitive log data without strict output filtering, environment variables are used for configuration but not always validated, and error messages may leak implementation details. The code quality is generally good with proper input validation, but some error handling could be improved. The permissions (Firebase access, environment variables, network I/O) are reasonable for a data analytics tool but users should understand the sensitivity of Cloud Logging access. Supply chain analysis found 5 known vulnerabilities in dependencies (2 critical, 1 high severity). Package verification found 1 issue.

5 files analyzed · 14 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

What You'll Need

Set these up before or after installing:

FIRESTORE_AUTO_DISCOVERRequired
FIRESTORE_DISCOVERY_CACHE_TTLRequired

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-dasasian-firebase-mcp-server": {
      "env": {
        "FIRESTORE_AUTO_DISCOVER": "your-firestore-auto-discover-here",
        "FIRESTORE_DISCOVERY_CACHE_TTL": "your-firestore-discovery-cache-ttl-here"
      },
      "args": [
        "-y",
        "@dasasian/firebase-mcp-server"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Firebase MCP Server

General-purpose Model Context Protocol (MCP) server for Firebase (Firestore, Storage, Auth, Functions Logging) with schema-driven validation and context-efficient tools.

Features

  • @ Mention Support - Reference Firestore documents with @firebase:firestore://users/user-123
  • Smart Autocomplete - MRU cache tracks accessed documents for quick re-reference
  • Auto-Discovery - Shows both schema-based AND discovered collections
  • Path-based schemas - Follows Firebase firestore.rules convention
  • Schema evolution - Field status metadata (experimental → official → legacy)
  • Hot reload - File watching, no restart needed when schemas change
  • Flexible validation - Three modes: strict, warn (default), permissive
  • Works without schemas - Discovery mode for exploring unknown databases
  • Context-efficient tools - 99% token reduction for large datasets
  • Index-aware queries - Validates queries against firestore.indexes.json
  • Functions logging - SQL-like queries for Cloud Functions logs with aggregations and label filtering

Install

Add it to your MCP client (e.g. Claude Code) — runs via npx, no global install needed:

{
  "mcpServers": {
    "firebase": {
      "command": "npx",
      "args": ["-y", "@dasasian/firebase-mcp-server", "start", "./firestore-schemas.json"]
    }
  }
}

start takes an optional schema config path (default ./firestore-schemas.json) and an optional indexes path (default ./firestore.indexes.json) — see Schema Format. Firebase auth uses Application Default Credentials.

Or install the CLI globally:

npm install -g @dasasian/firebase-mcp-server
firebase-mcp start ./firestore-schemas.json

Development (from source)

npm install
npm run build
npm run cli -- start --config ./examples/basic/firestore-schemas.json

@ Mention Support (Resources)

Reference Firestore documents directly in Claude Code:

What's the email for @firebase:firestore://users/user-123?
Show me all posts: @firebase:firestore://posts/*

How It Works

When you type @firebase in Claude Code:

Shows schema-based collections (with validation):

  • 📋 Users (User account documents)
  • 📋 Posts (Blog post documents)
  • 📋 Comments (Comments on posts)

Plus auto-discovered collections (no schema):

  • 🔍 analytics
  • 🔍 sessions
  • 🔍 audit_logs

Configuration

# Enable/disable auto-discovery (default: true)
export FIRESTORE_AUTO_DISCOVER=true

# Cache duration in seconds (default: 300 = 5 minutes)
export FIRESTORE_DISCOVERY_CACHE_TTL=300

Auto-discovery cost: ~$0.0003/day (negligible)

Tools

Core Tools (6)

  • firestore_read - Read single document
  • firestore_export - Batch export collections
  • firestore_validate - Schema validation
  • firestore_import - Import with dry-run
  • firestore_update - Safe field updates
  • firestore_query - Index-aware queries

Context-Efficient Tools (4)

  • firestore_count - Count without fetching documents (99.96% savings)
  • firestore_select - Field projection (90% savings)
  • firestore_sum - Aggregate without fetching (99.91% savings)
  • firestore_stats - Collection overview (99.3% savings)

Firebase Functions Tools (1)

  • firebase_functions_logs - Query Cloud Functions logs with SQL-like syntax

Example queries:

// Discover what functions exist
{"distinct": "functionName"}

// Show recent errors
{"where": [{"field": "severity", "operator": "==", "value": "ERROR"}], "limit": 20}

// Top error patterns with counts
{"groupBy": ["textPayload"], "aggregates": [{"field": "*", "operation": "count", "alias": "count"}], "where": [{"field": "severity", "operator": "==", "value": "ERROR"}], "orderBy": [{"field": "count", "direction": "desc"}], "limit": 10}

// Filter by custom labels (e.g., user, environment)
{"where": [{"field": "labels.user_id", "operator": "==", "value": "123"}]}

Schema Format

Schemas follow Firebase's path-based convention:

{
  "schemas": {
    "/organizations/{organizationId}": {
      "description": "Organization documents",
      "schema": {
        "type": "object",
        "required": ["id", "name"],
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" }
        }
      }
    },
    "/organizations/{organizationId}/products/{productId}": {
      "description": "Product catalog",
      "schema": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "category": {
            "type": "string",
            "x-status": "legacy",
            "x-replacedBy": "productType"
          },
          "productType": {
            "type": "string",
            "x-status": "experimental"
          }
        }
      },
      "timestampFields": ["createdAt", "updatedAt"]
    }
  }
}

Documentation

License

MIT

Reviews

No reviews yet

Be the first to review this server!