Get the FREE Ultimate OpenClaw Setup Guide →

firebase

🔥 Model Context Protocol (MCP) server for Firebase.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gannonh-firebase-mcp npx -y @gannonh/firebase-mcp \
  --env FIREBASE_STORAGE_BUCKET="your-project-id.appspot.com" \
  --env SERVICE_ACCOUNT_KEY_PATH="/absolute/path/to/serviceAccountKey.json"

How to use

Firebase MCP enables AI assistants to interact with Firebase services directly from MCP-enabled clients. It exposes tools for Firestore (add, list, get, update, delete documents, list root collections, and query across subcollections), Storage (list files, get file info, upload from content, upload from URL), and Authentication (retrieve user by ID or email). With HTTP transport, you can run the MCP server as a standalone HTTP service, allowing multiple clients to connect concurrently. To use, install the server (via npx or locally), provide your Firebase service account credentials, and configure the client to connect to the correct MCP endpoint. When integrated, clients such as Claude Desktop, Augment Code, VS Code, and Cursor can invoke these tools through the MCP channel to perform Firebase operations in your project context.

How to install

Prerequisites:

  • Node.js installed (for npx or local run)
  • Access to a Firebase project with a service account key JSON file
  • Optional: Firebase Tools if you plan to use emulator testing

Installation steps (recommended: use npx):

  1. Ensure you have your Firebase service account key JSON file downloaded locally.
  2. Add the MCP server configuration to your client settings as shown below (example for npx):
{
  "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"
    }
  }
}
  1. Alternatively, run the MCP server locally after building (if you prefer a local node execution):
{
  "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"
    }
  }
}
  1. If you choose to run with HTTP transport, set MCP_TRANSPORT=http and start the server accordingly, then point your MCP client to the HTTP endpoint (default path /mcp).

  2. Ensure your MCP client is configured to connect to the correct server name (e.g., firebase-mcp) and credentials are accessible in the environment where the server runs.

Additional notes

Tips and known issues:

  • Firestore queries may require composite indices; if you encounter a composite index message, set up the required index in Firebase Console.
  • The firestore_list_collections tool may produce a Zod validation error in client logs. This is a benign client SDK validation message; the tool still returns correct data.
  • Keep your SERVICE_ACCOUNT_KEY_PATH secure and absolute; verify the file has the proper permissions.
  • Optional environment variables:
    • MCP_TRANSPORT: stdio (default) or http
    • MCP_HTTP_PORT, MCP_HTTP_HOST, MCP_HTTP_PATH: configure HTTP transport endpoints
    • DEBUG_LOG_FILE: enable file logging (true or a file path)
  • When using HTTP transport, multiple clients can share a single server instance and each client receives a unique session ID.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗