Sponsor Suno AI Music arrow_forward
Slash Command

Firestore Setup

Initialize Firebase Admin SDK, configure Firestore, and setup A2A/MCP

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026
Model
sonnet

What Firestore Setup is

Firestore Setup is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Firestore Setup gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Firestore Setup

Claude Code

  1. Download firestore-setup.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/community/jeremy-firestore/commands/firestore-setup.md, shared under the repository's MIT license. Read the full file on GitHub.

Initialize Firebase Admin SDK in your project with support for:

  • Basic Firestore operations (CRUD, queries)
  • A2A (Agent-to-Agent) framework integration
  • MCP server communication patterns
  • Cloud Run service integration
  • Service account authentication

Your Mission

Set up Firebase Admin SDK with proper configuration for both regular users and AI agents. Guide the user through:

  1. Environment detection - Check if Firebase is already configured
  2. Dependency installation - Install firebase-admin package
  3. Credential setup - Configure service account authentication
  4. Firestore initialization - Initialize and test connection
  5. A2A/MCP setup (optional) - Configure for agent communication
  6. Security rules (optional) - Deploy initial security rules

Step-by-Step Workflow

Step 1: Check Existing Setup

First, check if Firebase is already configured:

# Check if firebase-admin is installed
npm list firebase-admin

# Check for existing Firebase initialization
grep -r "firebase-admin" .

# Check for service account credentials
ls -la *.json | grep -i firebase

If Firebase is already set up, ask the user if they want to reconfigure.

Step 2: Install Dependencies

# Install firebase-admin
npm install firebase-admin

# For A2A/MCP integration, also install:
npm install @google-cloud/firestore
npm install dotenv  # For environment variables

Step 3: Get Service Account Credentials

Ask the user:

Option A: Download from Firebase Console

1. Go to https://console.firebase.google.com
2. Select your project
3. Settings (gear icon) → Project Settings → Service Accounts
4. Click "Generate new private key"
5. Save JSON file to your project (e.g., serviceAccountKey.json)

Option B: Use existing GCP credentials

# If using Google Cloud SDK
gcloud auth application-default login

Option C: Environment variable (production)

# Set environment variable
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/serviceAccountKey.json"

Step 4: Create Firebase Initialization File

Create src/firebase.js (or src/firebase.ts for TypeScript):

const admin = require('firebase-admin');

// Initialize Firebase Admin SDK
if (!admin.apps.length) {
  // Option 1: Using service account key file
  const serviceAccount = require('../serviceAccountKey.json');

  admin.initializeApp({
    credential: admin.credential.cert(serviceAccount),
    databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`
  });

  // Option 2: Using environment variable (recommended for production)
  // admin.initializeApp({
  //   credential: admin.credential.applicationDefault(),
  //   projectId: process.env.FIREBASE_PROJECT_ID
  // });
}
…

For TypeScript:

import * as admin from 'firebase-admin';

if (!admin.apps.length) {
  const serviceAccount = require('../serviceAccountKey.json');

  admin.initializeApp({
    credential: admin.credential.cert(serviceAccount),
    databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`
  });
}

export const db = admin.firestore();
export { admin };

Step 5: Test Connection

Create a test script to verify Firestore works:

const { db } = require('./src/firebase');

async function testFirestore() {
  try {
    // Test write
    const testRef = await db.collection('_test').add({
      message: 'Firebase connected successfully!',
      timestamp: admin.firestore.FieldValue.serverTimestamp()
    });

    console.log('✅ Write successful. Document ID:', testRef.id);

    // Test read
    const doc = await testRef.get();
    console.log('✅ Read successful. Data:', doc.data());

    // Clean up test document
    await testRef.delete();
…

Run the test:

node test-firestore.js

Step 6: A2A/MCP Setup (Optional)

If the user needs A2A or MCP integration, create additional configuration:

A. Create A2A configuration file (src/a2a-config.js):

const { db } = require('./firebase');

// A2A Framework Configuration
const A2A_CONFIG = {
  collections: {
    sessions: 'agent_sessions',
    memory: 'agent_memory',
    tasks: 'a2a_tasks',
    messages: 'a2a_messages',
    logs: 'agent_logs'
  },

  serviceAccounts: [
    '[email protected]',
    '[email protected]'
  ],

  sessionTTL: 3600, // 1 hour in seconds
…

B. Create MCP service integration (src/mcp-service.js):

const { db } = require('./firebase');
const { A2A_CONFIG } = require('./a2a-config');

class MCPService {
  constructor(serviceAccountEmail) {
    this.serviceAccountEmail = serviceAccountEmail;
    this.db = db;
  }

  // Create a new agent session
  async createSession(sessionData) {
    const sessionRef = this.db.collection(A2A_CONFIG.collections.sessions).doc();

    await sessionRef.set({
      ...sessionData,
      agentId: this.serviceAccountEmail,
      status: 'active',
      createdAt: admin.firestore.FieldValue.serverTimestamp(),
…

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Firestore Setup?

Firestore Setup is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Initialize Firebase Admin SDK, configure Firestore, and setup A2A/MCP

How do I install Firestore Setup in Claude Code?

Download firestore-setup.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Firestore Setup in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Firestore Setup safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.