Cover image
Try Now
2025-04-12

🔥 Model Context Protocol (MCP) -Server für Firebase.

3 years

Works with Finder

2

Github Watches

16

Github Forks

78

Github Stars

Firebase MCP

Project Logo

Firebase MCP server

Firebase Tests CI

Overview

Firebase MCP enables AI assistants to work directly with Firebase services, including:

  • Firestore: Document database operations
  • Storage: File management with robust upload capabilities
  • Authentication: User management and verification

The server works with MCP client applicatios such as Claude Desktop, Augment Code, VS Code, and Cursor.

⚡ Quick Start

Prerequisites

  • Firebase project with service account credentials
  • Node.js environment

1. Install MCP Server

Add the server configuration to your MCP settings file:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Augment: ~/Library/Application Support/Code/User/settings.json
  • Cursor: [project root]/.cursor/mcp.json

MCP Servers can be installed manually or at runtime via npx (recommended). How you install determines your configuration:

Configure for npx (recommended)

{
  "firebase-mcp": {
    "command": "npx",
    "args": [
      "-y",
      "@gannonh/firebase-mcp"
    ],
    "env": {
      "SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/serviceAccountKey.json",
      "FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app"
    }
  }
}

Configure for local installation

{
  "firebase-mcp": {
    "command": "node",
    "args": [
      "/absolute/path/to/firebase-mcp/dist/index.js"
    ],
    "env": {
      "SERVICE_ACCOUNT_KEY_PATH": "/absolute/path/to/serviceAccountKey.json",
      "FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app"
    }
  }
}

2. Test the Installation

Ask your AI client: "Please test all Firebase MCP tools."

🔥 Latest Features: Storage Upload (v1.3.3)

Firebase MCP now offers powerful file upload capabilities with two specialized tools:

  • storage_upload: Upload files from text, base64 content, or local file paths
  • storage_upload_from_url: Import files directly from external URLs

Key Benefits

  • Permanent Public URLs: All uploads generate non-expiring public URLs
  • Content Type Detection: Automatic detection from file extensions and data
  • Multiple Upload Methods: Flexible options for different use cases
  • Rich Response Formatting: Clear, well-structured upload confirmations

Upload Methods

  1. Local File Path (Recommended for all file types)

    {
      filePath: "my-report.pdf",
      content: "/path/to/local/file.pdf"
    }
    
  2. Base64 Data URL (For smaller files)

    {
      filePath: "my-image.png", 
      content: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
    }
    
  3. Plain Text (For text files)

    {
      filePath: "readme.md",
      content: "# My README\n\nThis is a markdown file."
    }
    
  4. External URL (Using storage_upload_from_url)

    {
      filePath: "document.pdf",
      url: "https://example.com/document.pdf"
    }
    

⚠️ Important: For binary files like images and PDFs, always use the direct file path method for best reliability.

🛠️ Setup & Configuration

1. Firebase Configuration

  1. Go to Firebase Console → Project Settings → Service Accounts
  2. Click "Generate new private key"
  3. Save the JSON file securely

2. Environment Variables

  • SERVICE_ACCOUNT_KEY_PATH: Path to your Firebase service account key JSON (required)
  • FIREBASE_STORAGE_BUCKET: Bucket name for Firebase Storage (optional, defaults to [projectId].appspot.com)

3. Client Integration

Claude Desktop

Edit: ~/Library/Application Support/Claude/claude_desktop_config.json

VS Code / Augment

Edit: ~/Library/Application Support/Code/User/settings.json

Cursor

Edit: [project root]/.cursor/mcp.json

📚 API Reference

Firestore Tools

Tool Description Required Parameters
firestore_add_document Add a document to a collection collection, data
firestore_list_documents List documents with filtering collection
firestore_get_document Get a specific document collection, id
firestore_update_document Update an existing document collection, id, data
firestore_delete_document Delete a document collection, id
firestore_list_collections List root collections None
firestore_query_collection_group Query across subcollections collectionId

Storage Tools

Tool Description Required Parameters
storage_list_files List files in a directory None (optional: directoryPath)
storage_get_file_info Get file metadata and URL filePath
storage_upload Upload file from content filePath, content
storage_upload_from_url Upload file from URL filePath, url

Authentication Tools

Tool Description Required Parameters
auth_get_user Get user by ID or email identifier

💻 Developer Guide

Installation & Building

git clone https://github.com/gannonh/firebase-mcp
cd firebase-mcp
npm install
npm run build

Running Tests

First, install and start Firebase emulators:

npm install -g firebase-tools
firebase init emulators
firebase emulators:start

Then run tests:

# Run tests with emulator
npm run test:emulator

# Run tests with coverage
npm run test:coverage:emulator

Project Structure

src/
├── index.ts                  # Server entry point
├── utils/                    # Utility functions
└── lib/
    └── firebase/              # Firebase service clients
        ├── authClient.ts     # Authentication operations
        ├── firebaseConfig.ts   # Firebase configuration
        ├── firestoreClient.ts # Firestore operations
        └── storageClient.ts  # Storage operations

🔍 Troubleshooting

Common Issues

Storage Bucket Not Found

If you see "The specified bucket does not exist" error:

  1. Verify your bucket name in Firebase Console → Storage
  2. Set the correct bucket name in FIREBASE_STORAGE_BUCKET environment variable

Firebase Initialization Failed

If you see "Firebase is not initialized" error:

  1. Check that your service account key path is correct and absolute
  2. Ensure the service account has proper permissions for Firebase services

Composite Index Required

If you receive "This query requires a composite index" error:

  1. Look for the provided URL in the error message
  2. Follow the link to create the required index in Firebase Console
  3. Retry your query after the index is created (may take a few minutes)

📋 Response Formatting

Storage Upload Response Example

{
  "name": "reports/quarterly.pdf",
  "size": "1024000",
  "contentType": "application/pdf",
  "updated": "2025-04-11T15:37:10.290Z",
  "downloadUrl": "https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media",
  "bucket": "your-project.appspot.com"
}

Displayed to the user as:

## File Successfully Uploaded! 📁

Your file has been uploaded to Firebase Storage:

**File Details:**
- **Name:** reports/quarterly.pdf
- **Size:** 1024000 bytes
- **Type:** application/pdf
- **Last Updated:** April 11, 2025 at 15:37:10 UTC

**[Click here to download your file](https://storage.googleapis.com/bucket/reports/quarterly.pdf?alt=media)**

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Implement changes with tests (80%+ coverage required)
  4. Submit a pull request

📄 License

MIT License - see LICENSE file for details

🔗 Related Resources

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • pontusab
  • Die Cursor & Windsurf -Community finden Regeln und MCPs

  • jae-jae
  • MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.

  • ravitemer
  • Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)

  • patruff
  • Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • appcypher
  • Awesome MCP -Server - eine kuratierte Liste von Modellkontext -Protokollservern für Modellkontext

  • Mintplex-Labs
  • Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.

  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

    Reviews

    2 (1)
    Avatar
    user_1NpeiVgF
    2025-04-17

    As a loyal user of the firebase-mcp application, I am thoroughly impressed by its seamless integration and robust features. Developed by gannonh, this tool has significantly simplified my workflow and enhanced my productivity. Its intuitive interface and comprehensive documentation make it easy to use, even for beginners. I highly recommend checking it out at https://github.com/gannonh/firebase-mcp to experience its full potential.