Firebase MCP Server
Enables interaction with Firebase Authentication and Firestore through the MCP protocol, allowing user management and database operations via natural language. Optimized for deployment on Railway.com.
README
Firebase MCP Server for Railway
A Firebase Model Context Protocol (MCP) server designed for deployment on Railway.com using Streamable HTTP transport.
Features
- Firebase Authentication: User management (create, read, update, delete users)
- Firestore Database: Document and collection operations with advanced querying
- HTTP/HTTPS API: Streamable HTTP transport for remote MCP client connections
- Railway Ready: Optimized for Railway.com deployment with proper configuration
Quick Deploy to Railway
Or manually:
- Fork this repository
- Connect to Railway.com
- Set environment variables (see below)
- Deploy!
Environment Variables
Required
Set these in Railway's environment variables:
# Firebase service account as JSON string (recommended for Railway)
FIREBASE_SERVICE_ACCOUNT_JSON='{"type":"service_account","project_id":"your-project",...}'
# OR use file path (less secure for cloud deployment)
# FIREBASE_SERVICE_ACCOUNT_PATH="/path/to/service-account.json"
# Optional API key for authentication
MCP_API_KEY="your-secret-api-key"
Getting Firebase Service Account
- Go to Firebase Console
- Select your project → Settings → Service Accounts
- Click "Generate new private key"
- Copy the entire JSON content and set as
FIREBASE_SERVICE_ACCOUNT_JSON
Local Development
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your Firebase credentials
# Run in development mode
npm run dev
# Build for production
npm run build
npm start
API Endpoints
Once deployed on Railway, your server will have:
- Health Check:
GET https://your-app.railway.app/health - MCP Endpoint:
POST https://your-app.railway.app/mcp
Connecting MCP Clients
Claude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"firebase-remote": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch", "https://your-app.railway.app/mcp"],
"env": {
"AUTHORIZATION": "Bearer your-secret-api-key"
}
}
}
}
Other MCP Clients
Configure any MCP client to connect to:
- URL:
https://your-app.railway.app/mcp - Transport: Streamable HTTP
- Auth:
Bearer your-secret-api-key(ifMCP_API_KEYis set)
Available Tools
Firebase Authentication
firebase_get_user- Get user by UIDfirebase_create_user- Create new user with email/passwordfirebase_list_users- List all users (with pagination)firebase_delete_user- Delete user by UID
Firestore Database
firebase_get_document- Get single documentfirebase_set_document- Create/overwrite documentfirebase_update_document- Update specific fieldsfirebase_delete_document- Delete documentfirebase_query_collection- Advanced collection queries with filters, ordering, limits
Example Usage
After connecting to Claude Desktop:
"Create a new user with email test@example.com and password secret123"
"Get all documents from the 'products' collection where price > 100, ordered by name"
"Update the user document in 'users' collection with ID 'user123' to set status to 'active'"
Security Considerations
- Always use HTTPS in production (Railway provides this automatically)
- Set
MCP_API_KEYfor authentication - Use Firebase security rules to restrict database access
- Never expose service account keys in client-side code
Deployment Architecture
MCP Client (Claude Desktop)
↓ HTTPS + Streamable HTTP
Railway.com Server
↓ Admin SDK
Firebase Project (Auth + Firestore)
Local vs Official Firebase MCP
| Feature | This Server | Official Firebase CLI MCP |
|---|---|---|
| Deployment | ✅ Railway.com | ❌ Local only (stdio) |
| Transport | ✅ Streamable HTTP | ❌ Stdio only |
| Remote Access | ✅ Yes | ❌ No |
| Tools Count | 9 core tools | 40+ tools |
| Maintenance | Custom | Google maintained |
Use this server for remote/cloud deployments. Use the official Firebase CLI MCP for local development.
Support
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。