Firebase MCP enables AI assistants to interact directly with Firebase services, including Firestore for database operations, Storage for file management, and Authentication for user management. This server works with various MCP client applications such as Claude Desktop, Augment Code, VS Code, and Cursor.
Add the server configuration to your MCP settings file:
~/Library/Application Support/Claude/claude_desktop_config.json
~/Library/Application Support/Code/User/settings.json
[project root]/.cursor/mcp.json
You can install the server using npx (recommended) or locally:
{
"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"
}
}
}
{
"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"
}
}
}
Ask your AI client: "Please test all Firebase MCP tools."
SERVICE_ACCOUNT_KEY_PATH
: Path to your Firebase service account key JSONFIREBASE_STORAGE_BUCKET
: Bucket name for Firebase Storage (defaults to [projectId].appspot.com
)MCP_TRANSPORT
: Transport type to use (stdio
or http
) (defaults to stdio
)MCP_HTTP_PORT
: Port for HTTP transport (defaults to 3000
)MCP_HTTP_HOST
: Host for HTTP transport (defaults to localhost
)MCP_HTTP_PATH
: Path for HTTP transport (defaults to /mcp
)DEBUG_LOG_FILE
: Enable file logging (set to true
or a file path)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 |
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 |
Tool | Description | Required Parameters |
---|---|---|
auth_get_user |
Get user by ID or email | identifier |
Firebase MCP supports HTTP transport in addition to the default stdio transport, allowing you to run the server as a standalone HTTP service for multiple clients.
# Using environment variables
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/index.js
# Or with npx
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 npx @gannonh/firebase-mcp
{
"firebase-mcp": {
"url": "http://localhost:3000/mcp"
}
}
If you see "The specified bucket does not exist" error:
FIREBASE_STORAGE_BUCKET
environment variableIf you see "Firebase is not initialized" error:
If you receive "This query requires a composite index" error:
# Log to default location (~/.firebase-mcp/debug.log)
DEBUG_LOG_FILE=true npx @gannonh/firebase-mcp
# Log to a custom location
DEBUG_LOG_FILE=/path/to/custom/debug.log npx @gannonh/firebase-mcp
Or in your configuration:
{
"firebase-mcp": {
"command": "npx",
"args": ["-y", "@gannonh/firebase-mcp"],
"env": {
"SERVICE_ACCOUNT_KEY_PATH": "/path/to/serviceAccountKey.json",
"FIREBASE_STORAGE_BUCKET": "your-project-id.firebasestorage.app",
"DEBUG_LOG_FILE": "true"
}
}
}
# Using tail to follow the log file
tail -f ~/.firebase-mcp/debug.log
# Using a split terminal to capture stderr
npm start 2>&1 | tee logs.txt
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.