Firebase MCP Tool

April 6, 2025 ยท View on GitHub

This MCP (Machine Control Protocol) tool provides a set of commands to interact with Firebase directly from Cursor.

Setup Instructions

1. Install Dependencies

npm install

2. Configure Firebase Service Account

  1. Create a src/keys directory if it doesn't exist
  2. Create a serviceAccount.ts file in the src/keys directory with your Firebase credentials:

You can get these credentials from the Firebase Console:

  1. Go to Project Settings
  2. Service Accounts tab
  3. Generate New Private Key

3. Build the application

npm run build

4. Configure Cursor MCP

  1. Open Cursor settings
  2. Go to the MCP tab and click on "add a new "
  3. Add the following configuration:
{
  "mcpServers": {
    ...Other MCP servers
    "cursor-firebase-tools": {
      "command": "node",
      "args": ["{{yourPath}}/cursor-firebase-tools/dist/index.js"],
      "cwd": "."
    }
  }
}

Replace {{yourPath}} with the absolute path to your project directory.

PROFIT!

You can now ask the cursor AI to read or update firestore documents in the project of the serviceAccount. You can also create a firebase user

Notes

  • When reading documents, Firestore Timestamps are automatically converted to JavaScript Date objects
  • When writing documents, JavaScript Date objects are automatically converted to Firestore Timestamps
  • All responses are in JSON format with success and either data or error fields

TESTING

npm run dev

Esegue una shell dove testare l'esecuzione dei comandi