minhquoctran2604/firebase-mcp-server
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.
Firebase MCP Server
š§ 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?
Feature | Firebase MCP Server | Cloud 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
- Go to Firebase Console
- Create a new project
- Enable Realtime Database
- Choose region (recommend:
asia-southeast1
for Vietnam) - 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..."