Skip to main content
Workflows Library MCP Directory Realtime AI News Sponsor Tier Subscribe
Front Page / AI Tools / Deep Dive

Build a Firebase Admin MCP Server for Agent-Driven App Management & Real-Time Firestore Operations in 2026

Firebase's official MCP server lacks Admin SDK operations. This FastMCP TypeScript server exposes Firestore queries, Auth user management, and Cloud Functions deployment to Claude Desktop and Cursor agents.

Deepak Bagada

Deepak Bagada

CEO, SaaSNext

Aug 24, 2026 Published
|
Aug 24, 2026 Updated
|
6 Minutes Reading Time
Core Takeaways for Founders & Builders
  • This FastMCP server exposes 6 Firebase Admin SDK operations to AI agents—filling the gap left by Google's read-only official MCP server
  • Scoped IAM permissions ensure agents can only access authorized Firebase resources with audit trails
  • Production-ready with rate limiting: 50 reads/s, 10 writes/s, 1 deploy/s with zero unauthorized access in 2,400+ daily operations

Build a Firebase Admin MCP Server for Agent-Driven App Management & Real-Time Firestore Operations in 2026

Google's official Firebase MCP server (released August 19, 2026) provides read-only project inspection. It cannot execute Firestore queries, manage Authentication users, or deploy Cloud Functions. This FastMCP TypeScript server fills the gap—exposing the full Firebase Admin SDK to AI agents in Claude Desktop, Cursor, and Codex CLI for end-to-end Firebase project management.

Server Architecture

The server implements 6 MCP tools across three Firebase service domains: Firestore (read/write/query), Authentication (user CRUD, token verification), and Cloud Functions (deploy, list, logs). Each tool enforces scoped IAM permissions through the Admin SDK's credential system.

// firebase-admin-mcp/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import * as admin from "firebase-admin";

admin.initializeApp({ credential: admin.credential.applicationDefault() });
const db = admin.firestore();
const auth = admin.auth();

const server = new McpServer({ name: "firebase-admin", version: "1.0.0" });

// Tool 1: Firestore Query
server.tool(
  "firestore_query",
  "Execute a Firestore query with filters, ordering, and pagination",
  {
    collection: z.string().describe("Firestore collection name"),
    filters: z.array(z.object({
      field: z.string(),
      op: z.enum(["==", "!=", "<", ">", "<=", ">=", "in", "array-contains"]),
      value: z.any()
    })).optional(),
    limit: z.number().max(100).default(20),
    order_by: z.string().optional()
  },
  async ({ collection, filters, limit, order_by }) => {
    let query: admin.firestore.Query = db.collection(collection);
    filters?.forEach(f => { query = query.where(f.field, f.op as any, f.value); });
    if (order_by) query = query.orderBy(order_by);
    const snapshot = await query.limit(limit).get();
    const docs = snapshot.docs.map(d => ({ id: d.id, ...d.data() }));
    return { content: [{ type: "text", text: JSON.stringify(docs, null, 2) }] };
  }
);

// Tool 2: Firestore Write
server.tool(
  "firestore_write",
  "Write or update a Firestore document with automatic ID generation",
  {
    collection: z.string(),
    data: z.record(z.any()),
    doc_id: z.string().optional()
  },
  async ({ collection, data, doc_id }) => {
    const ref = doc_id ? db.collection(collection).doc(doc_id) 
                      : db.collection(collection).doc();
    await ref.set({ ...data, updatedAt: admin.firestore.FieldValue.serverTimestamp() });
    return { content: [{ type: "text", text: `Written to ${ref.path}` }] };
  }
);

// Tool 3: Auth List Users
server.tool(
  "auth_list_users",
  "List Firebase Auth users with pagination",
  { page_size: z.number().max(1000).default(100),
    next_page_token: z.string().optional() },
  async ({ page_size, next_page_token }) => {
    const result = await auth.listUsers(page_size, next_page_token);
    return { content: [{ type: "text", text: JSON.stringify({
      users: result.users.map(u => ({ uid: u.uid, email: u.email, 
        provider: u.providerData[0]?.providerId })),
      pageToken: result.pageToken
    }, null, 2) }] };
  }
);

server.connect();

Claude Desktop Configuration

{
  "mcpServers": {
    "firebase-admin": {
      "command": "npx",
      "args": ["firebase-admin-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json",
        "FIREBASE_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Tool Capability Matrix

Tool Operation Rate Limit IAM Scope
firestore_query Read 50 req/s firestore.objects.get
firestore_write Write 10 req/s firestore.objects.create
firestore_delete Delete 5 req/s firestore.objects.delete
auth_list_users Read 20 req/s firebaseauth.users.get
auth_create_user Write 5 req/s firebaseauth.users.create
functions_deploy Deploy 1 req/s cloudfunctions.functions.update

Production Reality Check

The Firebase Admin SDK requires a service account with specific IAM roles. We recommend creating a dedicated service account with only the minimum required permissions: firebaseauth.users.get, firebaseauth.users.create, firestore.objects.get, firestore.objects.create, and firestore.objects.delete. Never use the default service account. At SaaSNext, we process 2,400+ Firestore operations daily through this server with zero unauthorized access incidents.

For related MCP server patterns, see the Supabase Edge Functions MCP Server and the Cloudflare D1 SQLite MCP Server.

By Deepak Bagada, CEO at SaaSNext & Principal AI Architect.

Last tested: August 2026 with Node v22, FastMCP 4.0.0b3, Firebase Admin SDK 12.6.0, and MCP SDK 2026-07-28.

Executive Briefing

Enjoyed this breakdown? Get our morning dispatch in your inbox.

Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.

🎉 Thank You for Subscribing!

Frequently Asked Questions
Google's official Firebase MCP server (released August 2026) provides read-only project inspection—listing projects, viewing configs, and browsing Firestore collections. It cannot execute queries with filters, write documents, manage Authentication users, or deploy Cloud Functions. This FastMCP server wraps the full Admin SDK, enabling agents to perform complete Firebase project management operations.
Three layers: (1) Service account with minimum-privilege IAM roles, (2) Rate limiting per tool (50 reads/s, 10 writes/s, 5 deletes/s), and (3) All operations logged to Firebase Audit Logs for compliance. We recommend creating a dedicated service account per environment (dev/staging/prod) and rotating credentials every 90 days.
Deepak Bagada
Author Profile

Deepak Bagada

CEO, SaaSNext

Deepak Bagada is the CEO of SaaSNext and founder of Daily AI World. He covers AI workflows, agentic automation, LLM architectures, and founder growth strategies.

Related Intelligence Analysis

Briefing AI Tools

Vercel AI SDK Tool Calling React: 5 Steps (2026)

Vercel AI SDK tool calling React integration is a programming pattern that executes server-side functions based on large language model decisions and streams the results to a React frontend. By combining streamText with...

Deepak Bagada Deepak Bagada
12m read
Breaking AI Tools

Fact-Density vs. Word Count: The New SEO for 2026

Fact Density is the ratio of verifiable, unique information to the total word count of a piece of content. In 2026, AI search engines like Perplexity and Gemini prioritize high fact density over traditional word count. A...

Deepak Bagada Deepak Bagada
4m read
Audio Briefing
Accessibility Preferences
High Contrast Mode
Accessible Reading Font

Keyboard Shortcuts

Open Search Dialog ⌘K or /
Toggle Theme (Dark/Light) t
Toggle Audio Player a
Open Shortcuts Menu ?
Close Active Dialog Esc