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.
npx -y @src/mcpOverview
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
Standalone installer:
|
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
# Start the MCP server from the source folder.
# The exact entrypoint name can change; check src/mcp/README.md in the repo.
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:
| Command | Purpose |
|---|---|
| firebase login | Authenticate to Firebase (interactive) |
| firebase login:ci | Create a CI token for non-interactive use |
| firebase init | Initialize a project and generate firebase.json |
| firebase use -P <project_id> | Set active project |
| firebase emulators:start | Run local emulators (Firestore, Auth, Hosting, etc.) |
| firebase emulators:exec | Start emulators, run a script, then shut down |
| firebase deploy | Deploy hosting, functions, rules, indexes |
| firebase projects:create | Create a new Firebase project |
| firebase apps:create | Register apps for a project |
| firebase auth:export / auth:import | Export 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