home / mcp / firebase mcp server

Firebase MCP Server

šŸ”„ Model Context Protocol (MCP) server for Firebase.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "gannonh-firebase-mcp": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "MCP_HTTP_HOST": "localhost",
        "MCP_HTTP_PATH": "/mcp",
        "MCP_HTTP_PORT": "3000",
        "MCP_TRANSPORT": "http",
        "DEBUG_LOG_FILE": "true",
        "FIREBASE_STORAGE_BUCKET": "<your-project-id>.firebasestorage.app",
        "SERVICE_ACCOUNT_KEY_PATH": "<path-to-service-account-key.json>"
      }
    }
  }
}

Firebase MCP lets you operate Firebase services directly from your AI assistant workflow. You can manage Firestore data, handle Storage files, and work with Authentication user data through MCP-enabled clients, enabling powerful automation and integration scenarios.

How to use

You integrate Firebase MCP into your MCP client setup and choose either a local (stdio) or HTTP transport path. Start with the HTTP transport to run a standalone service that multiple clients can connect to, or use a local stdio setup for a single process workflow. Once running, your AI assistant can perform Firestore operations (add, list, get, update, delete), manage Storage files, and query authentication users.

How to install

Prerequisites: Node.js installed on your machine and a Firebase project with a service account key JSON.

# 1) Install MCP server via npx (recommended)
# This runs the MCP server without a local full install
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 npx @gannonh/firebase-mcp

# 2) Or install locally and run from dist
# Ensure dependencies are installed and built first, then start
node dist/index.js

Configuration and transport options

You can run the MCP server using HTTP transport or stdio transport. The HTTP setup exposes a standalone endpoint that clients can connect to, while stdio runs the server inside the same process as your client.

# HTTP transport configuration (example)
{
  "firebase-mcp": {
    "type": "http",
    "url": "http://localhost:3000/mcp",
    "args": []
  }
}

Security and environment considerations

Provide the Firebase service account key securely as a JSON file. Do not commit credentials to source control. Use environment variables to inject sensitive values when starting the server.

# Example environment variable setup for HTTP transport
export SERVICE_ACCOUNT_KEY_PATH=/absolute/path/to/serviceAccountKey.json
export FIREBASE_STORAGE_BUCKET=your-project-id.firebasestorage.app
export MCP_TRANSPORT=http
export MCP_HTTP_PORT=3000
export MCP_HTTP_HOST=localhost
export MCP_HTTP_PATH=/mcp
export DEBUG_LOG_FILE=true

Client integration notes

Configure your MCP client to connect to the server endpoint you started. If you used HTTP transport, point the client to the HTTP URL and path shown in the configuration. If you used stdio, the client and server run in the same process or through shared stdio channels.

Available tools

firestore_add_document

Add a document to a Firestore collection

firestore_list_documents

List documents in a collection with filtering support

firestore_get_document

Retrieve a specific Firestore document by collection and id

firestore_update_document

Update an existing Firestore document by collection and id

firestore_delete_document

Delete a Firestore document by collection and id

firestore_list_collections

List root Firestore collections

firestore_query_collection_group

Query across subcollections within a collection group

storage_list_files

List files in a Firebase Storage directory

storage_get_file_info

Get file metadata and download URL for a storage object

storage_upload

Upload a file to Storage from provided content

storage_upload_from_url

Upload a file to Storage from a URL

auth_get_user

Get a user by ID or email