Integrate Firebase services using AI assistance

Streamline your Firebase setup for web apps by using AI-powered development tools such as Antigravity, Claude Code, Codex, and Cursor. By using Firebase agent skills together with the Firebase CLI and Firebase MCP server, you can transform your AI coding agent into a specialized Firebase expert that can write code, configure Firebase Security Rules, and manage live resources.

This guide covers using an AI coding agent to help set up Cloud Firestore, Firebase Authentication, and Firebase Hosting for a web app. Check back soon for information about iOS, Android, and Flutter apps!

Why use Firebase agent skills and tools?

AI coding agents often struggle with specific project configurations or outdated information. This toolkit bridges that gap by combining specialized instructions (agent skills) with two complementary types of agent execution tools (CLI and MCP server):

  • Firebase agent skills: Provide the coding agent with domain expertise and workflows. As the instruction layer, skills guide the agent on best practices for working with Firebase, including writing code. Skills also teach the agent when and how to use the Firebase CLI and the Firebase MCP server.

  • Agent execution tools:

    • Firebase CLI (command-line tools): Provides tools for project lifecycle and environment tasks. The agent can run CLI commands in a terminal environment to set up services in a Firebase project, deploy full sites or backend resources, start local emulators, and more.

    • Firebase MCP server (programmatic tools and resources): Provides tools for real-time inspection, live data operations, and official documentation search. Through structured tool calls, the agent can programmatically query and update Cloud Firestore data, manage Firebase Authentication users, validate Security Rules, pull live logs or official Firebase documentation directly into context, and more.

Using Firebase agent skills alongside the Firebase CLI and the Firebase MCP server gives your AI coding agent additional abilities:

  • Take action: Do more than just write code. Your agent can initialize services, manage Firebase Authentication users, deploy new Firebase Security Rules, and work directly with your Cloud Firestore data.

  • Stay up-to-date: Rely on actively maintained agent skills and live official Firebase documentation search via the MCP server, rather than outdated model training data.

  • Improve accuracy: Access your project's environment and schemas to provide more relevant and accurate help.

  • Reduce token costs: Agent skills load detailed instructions and resources only when a specific task requires them, which minimizes session overhead.

Applicable Firebase services

This guide focuses primarily on how agent skills, the Firebase CLI, and the Firebase MCP server work together to help you quickly set up these services and features:

  • Cloud Firestore: Provision a NoSQL database.
  • Firebase Authentication: Set up secure user sign-in.
  • Firebase Security Rules: Generate and refine Security Rules for your app.
  • Firebase Hosting: Set up your project for static web app deployment.

For a complete list of what's available, browse the complete list of Firebase agent skills.

General workflow

The following steps describe a generalized workflow for how to use Firebase agent skills to set up and use Firebase services in a web app. Behind the scenes, agent skills are using the Firebase CLI and the Firebase MCP server to complete these tasks.

Step 1: Install Firebase agent skills

Select your AI coding agent to learn how to install Firebase agent skills:

Antigravity

Use either of the following options to install Firebase agent skills in Antigravity:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin to make Firebase agent skills available across all your projects. Use any of the following options:

    • Antigravity Marketplace: Click Customizations, select the Marketplace tab, and then click + on the Firebase plugin card.

    • Antigravity CLI: In an interactive session, run /plugin install firebase@antigravity-plugins-official (or run /plugin, and then install Firebase from the Discover tab). Plugins installed in Antigravity sync automatically to Antigravity CLI.

    • During onboarding: Select the Firebase plugin on the Build with Google screen.

  • Option 2: Install project-level agent skills

    To install Firebase agent skills for a single project, run the following command in your project directory:

    npx skills add firebase/agent-skills --agent=antigravity

Claude Code

Use either of the following options to install Firebase agent skills in Claude Code:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin to get both Firebase agent skills and the Firebase MCP server:

    1. Add the Firebase marketplace:

      claude plugin marketplace add firebase/agent-skills
    2. Install the Firebase plugin:

      claude plugin install firebase@firebase
    3. (Optional) Verify the installation:

      claude plugin list
  • Option 2: Install agent skills only

    To install only Firebase agent skills (without the Firebase MCP server), run the following command in your project directory:

    npx skills add firebase/agent-skills --agent=claude-code

Codex

Use either of the following options to install Firebase agent skills in Codex:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin to get both Firebase agent skills and the Firebase MCP server. Use either of the following options:

    • Codex CLI:

      1. Add the Firebase marketplace:

        codex plugin marketplace add firebase/agent-skills
      2. Install the Firebase plugin:

        codex plugin add firebase@firebase
    • Codex app:

      1. Add the Firebase marketplace:

        codex plugin marketplace add firebase/agent-skills
      2. Fully restart the Codex app.

      3. Open Plugins, select the Firebase marketplace, open Firebase, and then click + Install.

      4. Start a new task, and then type @Firebase to select the plugin (or ask Codex to perform a Firebase task).

  • Option 2: Install agent skills only

    To install only Firebase agent skills (without the Firebase MCP server), run the following command in your project directory:

    npx skills add firebase/agent-skills --agent=codex

Cursor

Use either of the following options to install Firebase agent skills in Cursor:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin from the Cursor Marketplace to get both Firebase agent skills and the Firebase MCP server.

  • Option 2: Install agent skills only

    To install only Firebase agent skills (without the Firebase MCP server), run the following command in your project directory:

    npx skills add firebase/agent-skills --agent=cursor

Other agents

To install Firebase agent skills for other compatible AI coding agents, run the following command in your project directory:

npx skills add firebase/agent-skills

Step 2: Connect to the Firebase MCP server

While many Firebase agent skills use the Firebase CLI for tasks, you'll have the best experience if you also connect your AI coding agent to the Firebase MCP server. In fact, the MCP server is required to search official Firebase documentation or for features that access live project data directly (such as querying Cloud Firestore or debugging Firebase Crashlytics issues).

AI-assisted method

In most cases, you can ask your AI coding agent to set up the Firebase MCP server. However, if it struggles or you don't see the Firebase MCP server listed, switch to the Manual method.

Manual method

Select your AI coding agent to configure the Firebase MCP server:

Antigravity

To configure the Firebase MCP server in Antigravity:

  1. In Antigravity, open the menu in the Agent pane, and then select MCP Servers.

  2. Select Firebase > Install.

Installing from the MCP Store updates your mcp_config.json file. You can view or customize the config from the MCP Store pane via Manage MCP Servers > View raw config.

{
  "mcpServers": {
    "firebase-mcp-server": {
      "command": "npx",
      "args": ["-y", "firebase-tools@latest", "mcp"]
    }
  }
}

Claude

Claude Code

Use either of the following options to configure the Firebase MCP server in Claude Code:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin to get both the Firebase MCP server and Firebase agent skills:

    1. Add the Firebase marketplace:

      claude plugin marketplace add firebase/agent-skills
    2. Install the Firebase plugin:

      claude plugin install firebase@firebase
    3. (Optional) Verify the installation:

      claude plugin list
  • Option 2: Install the Firebase MCP server only

    To configure only the Firebase MCP server (without Firebase agent skills):

    1. Run the following command in your project directory:

      claude mcp add firebase -- npx -y firebase-tools@latest mcp
    2. (Optional) Verify the connection:

      claude mcp list

      The output should include:

      firebase: npx -y firebase-tools@latest mcp - ✓ Connected
      

Claude Desktop

To configure the Firebase MCP server in Claude Desktop:

  1. Open Claude > Settings, select the Developer tab, and then click Edit Config to open claude_desktop_config.json.

  2. Add the firebase server entry:

    {
      "mcpServers": {
        "firebase": {
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp"]
        }
      }
    }
    

Codex

Use either of the following options to configure the Firebase MCP server in Codex:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin to get both the Firebase MCP server and Firebase agent skills. Use either of the following options:

    • Codex CLI:

      1. Add the Firebase marketplace:

        codex plugin marketplace add firebase/agent-skills
      2. Install the Firebase plugin:

        codex plugin add firebase@firebase
    • Codex app:

      1. Add the Firebase marketplace:

        codex plugin marketplace add firebase/agent-skills
      2. Fully restart the Codex app.

      3. Open Plugins, select the Firebase marketplace, open Firebase, and then click + Install.

      4. Start a new task, and then type @Firebase to select the plugin (or ask Codex to perform a Firebase task).

  • Option 2: Install the Firebase MCP server only

    To configure only the Firebase MCP server (without Firebase agent skills), use either of the following options:

    • Codex CLI: Run the following command in your terminal:

      codex mcp add firebase -- npx -y firebase-tools@latest mcp
    • Manual configuration (config.toml): Add the following to ~/.codex/config.toml (global) or .codex/config.toml (project):

      [mcp_servers.firebase]
      command = "npx"
      args = ["-y", "firebase-tools@latest", "mcp"]
      

Cursor

Use any of the following options to configure the Firebase MCP server in Cursor:

  • Option 1: Install the Firebase plugin (recommended)

    Install the official Firebase plugin from the Cursor Marketplace to get both the Firebase MCP server and Firebase agent skills.

  • Option 2: One-click MCP setup (MCP server only)

    To add only the Firebase MCP server to your global configuration (without Firebase agent skills), click the following button:

    Install MCP Server

  • Option 3: Configure manually (MCP server only)

    To configure only the Firebase MCP server manually, add the firebase server entry to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

    {
      "mcpServers": {
        "firebase": {
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp"]
        }
      }
    }
    

Cline

To configure the Firebase MCP server in Cline:

  1. Click the MCP Servers icon at the top of the Cline pane, and then click Configure MCP Servers to open cline_mcp_settings.json.

  2. Add the firebase server entry:

    {
      "mcpServers": {
        "firebase": {
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp"],
          "disabled": false
        }
      }
    }
    

VS Code Copilot

Use either of the following options to configure the Firebase MCP server in VS Code Copilot:

  • Option 1: Workspace configuration (single project)

    Add the firebase server entry to .vscode/mcp.json in your workspace:

    {
      "servers": {
        "firebase": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp"]
        }
      }
    }
    
  • Option 2: User configuration (all projects)

    Open the Command Palette, run MCP: Open User Configuration to open your user mcp.json file, and then add the firebase server entry:

    {
      "servers": {
        "firebase": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp"]
        }
      }
    }
    

Windsurf

To configure the Firebase MCP server in Windsurf Editor, add the firebase server entry to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "firebase": {
      "command": "npx",
      "args": ["-y", "firebase-tools@latest", "mcp"]
    }
  }
}

Step 3: Initialize Firebase services

With the agent skills and tools set up, you can now use natural language to have your AI coding agent set up Cloud Firestore, Firebase Authentication, and Firebase Hosting.

  1. Request that your agent set up a service. For example, you can use prompts like these:

    • Set up Cloud Firestore as the database for this app.
    • Build a login page using Authentication and update Security Rules to ensure only authorized users can read and write their own data.
    • Set up Firebase Hosting and deploy the app to production.
    • Look up the current Cloud Firestore documentation for paginating query results, and then add paginated loading to the posts list.
  2. Review any information and follow any guided steps that your agent might provide, such as:

    1. Plans: Your agent proposes a strategy based on your existing codebase.
    2. Connects: Your agent links your local code to an existing Firebase project or helps you create a new Firebase project.
    3. Initializes resources: Your agent adds the required Firebase libraries and configuration to your codebase.
    4. Updates files: Your agent creates and updates any necessary files, such as firestore.rules (to define who can read, write, or query data within your database) or firebase.json (to inform the Firebase CLI which services to deploy and how to configure them).
    5. Executes: Your agent guides you through additional configuration or deployment steps.

Ground your agent in official Firebase documentation

The Firebase MCP server includes tools that let your agent search live, official Google developer documentation (including firebase.google.com) as it writes code and works with your Firebase project. This means your agent can use current SDKs and APIs, new features, proper Security Rules syntax, etc. rather than relying only on its training data. These tools come from the Developer Knowledge MCP server.

If your agent doesn't support MCP servers, or if you want to reference specific documentation in your prompts or project instruction files (such as AGENTS.md or CLAUDE.md), then you can point your agent to Firebase's machine-readable documentation:

  • Documentation indexes (llms.txt): Provide your agent with the full Firebase documentation index at https://firebase.google.com/docs/llms.txt, or use a product-specific index (such as https://firebase.google.com/docs/firestore/llms.txt for Cloud Firestore or https://firebase.google.com/docs/auth/llms.txt for Authentication).

  • Markdown pages (.md.txt): Append .md.txt to any Firebase documentation page URL (for example, https://firebase.google.com/docs/firestore/quickstart.md.txt) to fetch clean Markdown that's formatted for language models. Also, at the top of any Firebase documentation page, you can click Copy page as markdown or open its menu and select View as Markdown.

General tips for prompting an AI coding agent

To get the most out of your AI coding agent, especially when working with multi-faceted integrations like Firebase, treat the interaction as a collaboration rather than a single-shot command.

Be specific and provide context

While the Firebase MCP server provides the agent with significant context about your project, clear and specific natural language prompts yield the best results. Avoid vague requests.

  • Vague: "Fix the database error."
  • Specific: "I'm getting a 'permission denied' error when trying to write to the 'users' collection in Cloud Firestore. Review my firestore.rules and suggest a fix that allows authenticated users to write to their own document."

Iterate and refine

AI coding agents rarely generate perfect code on the first try for complex tasks. If an answer isn't quite right, keep the conversation going:

  • Provide error messages: Paste any terminal errors or console logs back into the chat.
  • Ask for adjustments: "That code uses the older v8 SDK. Rewrite it using the Firebase v9 modular SDK."
  • Request explanations: "Explain how those Firebase Security Rules protect user data."

Verify before you execute

AI coding agents are powerful, but they can make mistakes or "hallucinate" (invent incorrectly named functions or services).

  • Review code: Always read through generated code, especially Firebase Security Rules and configuration files (like firebase.json), before deploying to production.
  • Test locally: Whenever possible, ask the agent to help you test changes locally before pushing them live.

Use the MCP connection

Because the Firebase MCP server gives your agent direct visibility into your project structure, you can reference specific files to get tailored implementation advice.

  • Example: "Look at my src/web/index.html file and show me where to add the standard Firebase initialization script."

Next steps