FI

Firebase MCP Server Command Line Tools

Manage, test, and deploy Firebase projects from the command line with the MCP server and CLI tools - see documentation.

Quick Install
npx -y @src/mcp

Overview

The Firebase MCP Server sits alongside the Firebase CLI (firebase-tools) to enable programmatic, model-driven interactions with Firebase projects. In practice, you use the CLI to manage projects, run local emulators, deploy hosting and functions, and import/export auth data; the MCP server provides a lightweight bridge so external tools (scripts, CI systems, or language‑model-driven agents) can invoke those CLI capabilities over a simple protocol/endpoint.

This hybrid approach is useful when you need automation beyond ad-hoc shell calls: test harnesses that start emulators, reproducible deployment flows driven by automation, or AI assistants that must query and act on project state. The MCP server code is part of the firebase-tools repository (see src/mcp) and is intended for local development, integration testing, and tooling that needs stable, scriptable control of firebase-tools commands.

GitHub: https://github.com/firebase/firebase-tools/tree/master/src/mcp

Features

  • Runs and controls firebase-tools commands programmatically (deploy, emulators, hosting, functions).
  • Starts local emulators and executes test scripts (emulators:start, emulators:exec).
  • Deploys hosting and Cloud Functions using your firebase.json configuration.
  • Interacts with Realtime Database, Firestore, and Authentication for imports/exports.
  • Provides a request/response protocol for automation or language-model-driven tooling (Model Context Protocol).
  • Supports authentication flows and CI tokens for non-interactive environments.

Installation / Configuration

Install the Firebase CLI (firebase-tools) using npm or the standalone installer. These commands also provide the code base that includes the MCP server in src/mcp.

Install via npm (recommended):

# Requires Node.js and npm
npm install -g firebase-tools

Standalone installer:

curl -sL firebase.tools | bash

If you want to run the MCP server directly from the firebase-tools source (useful for hacking or running the latest local copy):

# Clone the repository and install dependencies
git clone https://github.com/firebase/firebase-tools.git
cd firebase-tools
npm install

# Start the MCP server from the source folder.
# The exact entrypoint name can change; check src/mcp/README.md in the repo.
node src/mcp/index.js --port 8080

Notes:

  • Running the MCP server typically requires you to be authenticated with Firebase (use firebase login) or to pass a CI token for non-interactive environments (firebase login:ci).
  • Configuration (project id, firebase.json) still comes from your project directory or CLI flags like --project.

Available Tools / Resources

Common firebase CLI commands you’ll use via the MCP server or directly:

CommandPurpose
firebase loginAuthenticate to Firebase (interactive)
firebase login:ciCreate a CI token for non-interactive use
firebase initInitialize a project and generate firebase.json
firebase use -P <project_id>Set active project
firebase emulators:startRun local emulators (Firestore, Auth, Hosting, etc.)
firebase emulators:execStart emulators, run a script, then shut down
firebase deployDeploy hosting, functions, rules, indexes
firebase projects:createCreate a new Firebase project
firebase apps:createRegister apps for a project
firebase auth:export / auth:importExport or import users

Resources

  • Source (MCP folder): https://github.com/firebase/firebase-tools/tree/master/src/mcp
  • Firebase CLI docs: https://firebase.google.com/docs/cli

Example: Using the CLI directly

Start local emulators and open