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 in tandem 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, 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?
General AI models often struggle with specific project configurations or outdated information. This toolkit bridges that gap:
- Firebase agent skills: Skills provide the coding agent with domain expertise. They provide up-to-date documentation and optimal workflows so the agent knows the correct, Firebase-recommended way to structure your architecture.
- Firebase MCP server: The MCP server gives the coding agent context and access. It establishes a standard protocol for the agent to programmatically inspect your active project resources, local files, and configurations.
- Firebase CLI: The command-line interface gives the coding agent actionable power. It's the execution tool that the agent uses to perform heavy-lifting tasks like initializing databases, managing user authentication configs, and deploying code on your behalf.
Using Firebase agent skills alongside the Firebase CLI and Firebase MCP server gives your AI coding agent additional abilities:
- Take action: Do more than just write code. Your agent can initialize services, manage Authentication users, deploy new Firebase Security Rules, and work directly with your Cloud Firestore data.
- Stay up-to-date: Use official, version-aware prompts to guide your agent through setup tasks.
- Improve accuracy: Access your project's environment and schemas to provide more relevant and accurate help.
- Reduce token costs: Agent skills load detailed documentation only when a specific task requires it, which minimizes session overhead.
Which Firebase services can the agent skills and tools assist with?
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.
- 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
In most cases, you can install Firebase agent skills in your preferred editor with a single prompt:
Antigravity
Firebase agent skills are included as one of the Build with Google integration bundles for Antigravity. You can enable this bundle for global-level access at two points:
- During onboarding: Select the checkbox for the Firebase stack.
- In settings: Navigate to Settings > Customizations. Under Build with Google Plugins, click Customize, then click Download for the Firebase integration.
If you prefer project-level access, run the following command in your project's directory:
npx skills add firebase/agent-skills --agent=antigravity
Claude Code
claude plugin marketplace add firebase/agent-skills
claude plugin install firebase@firebase
Codex
npx skills add firebase/agent-skills --agent=codex
Cursor
You can install Firebase agent skills directly from the Cursor Marketplace or by running the following command in your terminal:
npx skills add firebase/agent-skills --agent=cursor
Other agents
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, connecting your AI coding agent to the Firebase MCP server is recommended. This connection enhances your agent's ability to interact with your Firebase environment, providing deeper integration and access.
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
Antigravity
To configure Antigravity to use the Firebase MCP server:
- In Antigravity, click the menu in the Agent pane > MCP Servers.
- Select Firebase > Install.
This automatically updates your mcp_config.json file, which you can view by
clicking Manage MCP Servers at the top of the MCP Store pane >
View raw config, with the following content:
{
"mcpServers": {
"firebase-mcp-server": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
}
Firebase Studio
To configure Firebase Studio to use the Firebase MCP server, edit or
create the configuration file: .idx/mcp.json.
If the file doesn't yet exist, create it by right-clicking the parent directory and selecting New file. Add the following contents to the file:
{
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
}
Claude
Claude Code
Option 1: Install via plugin (Recommended)
The easiest way to set up the Firebase MCP server in Claude Code is to install the official Firebase plugin:
Add the Firebase marketplace for Claude plugins:
claude plugin marketplace add firebase/firebase-toolsInstall the Claude plugin for Firebase:
claude plugin install firebase@firebaseVerify the installation:
claude plugin marketplace list
Option 2: Configure MCP server manually
Alternatively, you can manually configure the Firebase MCP server:
Run the following command under your app folder:
claude mcp add firebase npx -- -y firebase-tools@latest mcpVerify the installation:
claude mcp listIt should show:
firebase: npx -y firebase-tools@latest mcp - ✓ Connected
Claude Desktop
To configure Claude Desktop to use the Firebase MCP server, edit the
claude_desktop_config.json file. You can open or create this file from the
Claude > Settings menu. Select the Developer tab, then click
Edit Config.
{
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
}
Cline
To configure Cline to use the Firebase MCP server, edit the
cline_mcp_settings.json file. You can open or create this file by clicking
the MCP Servers icon at the top of the Cline pane, then clicking the
Configure MCP Servers button.
{
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"],
"disabled": false
}
}
}
Cursor
Option 1: Marketplace plugin (recommended)
Install the Firebase plugin from the Cursor Marketplace. This automatically configures the MCP server and provides access to Firebase agent skills.
Option 2: One-click MCP setup
If you only want to add the MCP server to your global configuration, click the following button:
Option 3: Manual configuration
If you prefer to configure the server for a specific project or want to edit
your settings manually, update your mcp.json file:
- For a specific project, edit
.cursor/mcp.json - For all projects (global), edit
~/.cursor/mcp.json
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
VS Code Copilot
To configure a single project, edit the .vscode/mcp.json file in your
workspace:
"servers": {
"firebase": {
"type": "stdio",
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
To make the server available in every project you open, edit your user settings, for example:
"mcp": {
"servers": {
"firebase": {
"type": "stdio",
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}
}
Windsurf
To configure Windsurf Editor, edit the file
~/.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, Authentication, and Firebase Hosting.
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.
Review any information and follow any guided steps that your agent might provide, such as:
- Plans: Your agent proposes a strategy based on your existing codebase.
- Connects: Your agent links your local code to an existing Firebase project or helps you create a new Firebase project.
- Initializes resources: Your agent adds the required Firebase libraries and configuration to your codebase.
- 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) orfirebase.json(to inform the Firebase CLI which services to deploy and how to configure them). - Executes: Your agent guides you through additional configuration or deployment steps.
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.rulesand 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.htmlfile and show me where to add the standard Firebase initialization script."
Next steps
- Browse a complete list of all available Firebase agent skills.
- Browse a complete list of all available prompts, tools, and resources the Firebase MCP server provides.
- Learn more about the tools provided by the Firebase CLI.