home / mcp / firebase mcp server
š„ Model Context Protocol (MCP) server for Firebase.
Configuration
View docs{
"mcpServers": {
"gannonh-firebase-mcp": {
"url": "http://localhost:3000/mcp",
"headers": {
"MCP_HTTP_HOST": "localhost",
"MCP_HTTP_PATH": "/mcp",
"MCP_HTTP_PORT": "3000",
"MCP_TRANSPORT": "http",
"DEBUG_LOG_FILE": "true",
"FIREBASE_STORAGE_BUCKET": "<your-project-id>.firebasestorage.app",
"SERVICE_ACCOUNT_KEY_PATH": "<path-to-service-account-key.json>"
}
}
}
}Firebase MCP lets you operate Firebase services directly from your AI assistant workflow. You can manage Firestore data, handle Storage files, and work with Authentication user data through MCP-enabled clients, enabling powerful automation and integration scenarios.
You integrate Firebase MCP into your MCP client setup and choose either a local (stdio) or HTTP transport path. Start with the HTTP transport to run a standalone service that multiple clients can connect to, or use a local stdio setup for a single process workflow. Once running, your AI assistant can perform Firestore operations (add, list, get, update, delete), manage Storage files, and query authentication users.
Prerequisites: Node.js installed on your machine and a Firebase project with a service account key JSON.
# 1) Install MCP server via npx (recommended)
# This runs the MCP server without a local full install
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 npx @gannonh/firebase-mcp
# 2) Or install locally and run from dist
# Ensure dependencies are installed and built first, then start
node dist/index.jsYou can run the MCP server using HTTP transport or stdio transport. The HTTP setup exposes a standalone endpoint that clients can connect to, while stdio runs the server inside the same process as your client.
# HTTP transport configuration (example)
{
"firebase-mcp": {
"type": "http",
"url": "http://localhost:3000/mcp",
"args": []
}
}Provide the Firebase service account key securely as a JSON file. Do not commit credentials to source control. Use environment variables to inject sensitive values when starting the server.
# Example environment variable setup for HTTP transport
export SERVICE_ACCOUNT_KEY_PATH=/absolute/path/to/serviceAccountKey.json
export FIREBASE_STORAGE_BUCKET=your-project-id.firebasestorage.app
export MCP_TRANSPORT=http
export MCP_HTTP_PORT=3000
export MCP_HTTP_HOST=localhost
export MCP_HTTP_PATH=/mcp
export DEBUG_LOG_FILE=trueConfigure your MCP client to connect to the server endpoint you started. If you used HTTP transport, point the client to the HTTP URL and path shown in the configuration. If you used stdio, the client and server run in the same process or through shared stdio channels.
Add a document to a Firestore collection
List documents in a collection with filtering support
Retrieve a specific Firestore document by collection and id
Update an existing Firestore document by collection and id
Delete a Firestore document by collection and id
List root Firestore collections
Query across subcollections within a collection group
List files in a Firebase Storage directory
Get file metadata and download URL for a storage object
Upload a file to Storage from provided content
Upload a file to Storage from a URL
Get a user by ID or email