firebase-mcp-server

minhquoctran2604/firebase-mcp-server

3.2

If you are the rightful owner of firebase-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Firebase MCP Server is a self-hosted Model Context Protocol server that provides long-term memory for AI assistants using Firebase Realtime Database.

Tools
5
Resources
0
Prompts
0

Firebase MCP Server

License: MIT Node.js Firebase

🧠 Self-hosted MCP Server providing long-term memory for AI assistants using Firebase Realtime Database

✨ Features

  • šŸ”„ Firebase Integration: Uses Firebase Realtime Database for reliable, real-time data storage
  • 🧠 Long-term Memory: Persistent memory across chat sessions
  • šŸ·ļø Flexible Metadata: Store memories with tags, importance levels, and custom types
  • šŸ” Smart Search: Search by content, tags, or memory types
  • šŸ›”ļø Privacy-First: Your data stays in YOUR Firebase project
  • ⚔ Real-time Sync: Changes sync instantly across devices
  • šŸ’° Cost-Effective: Firebase free tier supports substantial usage

šŸŽÆ Why Choose This Over Cloud Solutions?

FeatureFirebase MCP ServerCloud Alternatives (e.g. HPKV)
Data Ownershipāœ… Your Firebase, your dataāŒ Third-party servers
Costāœ… Firebase free tier + unlimited usageāŒ API call limits (100/month free)
Customizationāœ… Fully customizableāŒ Limited to provider features
Privacyāœ… Complete controlāŒ Data shared with providers
Setupāš ļø Manual setup requiredāœ… Plug & play
AI Featuresāš ļø Basic searchāœ… Semantic search, vector similarity

šŸš€ Quick Start

šŸš€ Quick Start

1. Clone & Install

git clone https://github.com/minhquoctran2604/firebase-mcp-server.git
cd firebase-mcp-server
npm install

2. Firebase Setup

  1. Go to Firebase Console
  2. Create a new project
  3. Enable Realtime Database
  4. Choose region (recommend: asia-southeast1 for Vietnam)
  5. Get your Firebase config from Project Settings

3. Environment Configuration

cp .env.example .env
# Edit .env with your Firebase credentials

4. Test Connection

npm test
npm run demo  # See it in action!

5. Configure Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "firebase-memory": {
      "command": "node",
      "args": ["/path/to/firebase-mcp-server/firebase-mcp-server.js"],
      "env": {
        "FIREBASE_API_KEY": "your-api-key",
        "FIREBASE_AUTH_DOMAIN": "your-project.firebaseapp.com",
        "FIREBASE_PROJECT_ID": "your-project-id",
        "FIREBASE_STORAGE_BUCKET": "your-project.appspot.com",
        "FIREBASE_MESSAGING_SENDER_ID": "your-sender-id",
        "FIREBASE_APP_ID": "your-app-id",
        "FIREBASE_DATABASE_URL": "https://your-project-default-rtdb.region.firebasedatabase.app/"
      }
    }
  }
}

šŸ› ļø Available Tools

šŸ› ļø Available Tools

Once configured, Claude Desktop will have access to these memory tools:

bb7_store_memory

Store a memory with flexible metadata.

// Example usage in Claude
{
  "content": "User prefers React with TypeScript for frontend projects",
  "metadata": {
    "tags": ["preference", "tech", "frontend"],
    "importance": 8,
    "type": "preference"
  }
}

bb7_search_memories

Search memories by content, tags, or type.

// Search examples
{ "query": "React" }                    // Content search
{ "tag": "preference" }                 // Tag filter
{ "type": "preference", "limit": 5 }    // Type + limit

bb7_get_memory

Retrieve specific memory by ID.

bb7_delete_memory

Delete specific memory by ID.

bb7_list_recent_memories

List recent memories with optional limit.

šŸ“Š Memory Structure

Each memory is stored with this structure:

{
  "id": "unique-firebase-key",
  "content": "The actual memory content",
  "metadata": {
    "tags": ["tag1", "tag2"],
    "importance": 5,
    "type": "preference",
    "custom_field": "any custom data"
  },
  "timestamp": 1672531200000
}

šŸŽÆ Use Cases

Personal AI Assistant

  • Remember user preferences and habits
  • Track important dates and deadlines
  • Store personal facts and relationships

Coding Assistant

  • Remember coding style preferences
  • Track project patterns and decisions
  • Store solutions to recurring problems

Learning Assistant

  • Track learning progress and weak areas
  • Remember key concepts and explanations
  • Store study schedules and goals

šŸ”§ Development

Project Structure

firebase-mcp-server/
ā”œā”€ā”€ firebase-mcp-server.js    # Main MCP server
ā”œā”€ā”€ package.json              # Dependencies & scripts
ā”œā”€ā”€ .env.example              # Environment template
ā”œā”€ā”€ test.js                   # Connection tests
ā”œā”€ā”€ demo.js                   # Usage demonstration
ā”œā”€ā”€ workflow-demo.js          # Workflow examples
ā”œā”€ā”€ check-config.js           # Config verification
ā”œā”€ā”€ README.md                 # This file
ā”œā”€ā”€ HOW-IT-WORKS.md          # Detailed explanation
ā”œā”€ā”€ COMPARISON.md             # vs other solutions
└── .gitignore               # Git ignore rules

NPM Scripts

npm start          # Start the MCP server
npm test          # Test Firebase connection
npm run demo      # Run usage demonstration
npm run dev       # Development mode

šŸ”’ Security & Privacy

Quick Security Setup

// Firebase Database Rules - Production
{
  "rules": {
    "memories": {
      ".read": "auth != null",
      ".write": "auth != null && auth.uid == $uid"
    }
  }
}

Security Checklist

  • āœ… Never commit .env files (already in .gitignore)
  • āœ… Use Firebase project-level security
  • āœ… Implement authentication for production
  • āœ… Monitor Firebase console for unusual activity
  • āœ… Keep dependencies updated: npm audit

šŸ› ļø How It Works

Architecture

Claude Desktop ↔ MCP Protocol ↔ Firebase MCP Server ↔ Firebase Realtime Database

Tool Flow Example

// 1. User talks to Claude
User: "I like React with TypeScript"

// 2. Claude stores memory
bb7_store_memory({
  content: "User likes React with TypeScript",
  metadata: { tags: ["preference", "tech"], importance: 8 }
})

// 3. Later, Claude retrieves relevant info
bb7_search_memories({ tag: "preference" })
// Returns: "User likes React with TypeScript"

// 4. Claude gives personalized advice
Claude: "Based on your React+TS preference, I recommend..."