Connect your IDE to Firestore using MCP Toolbox

This page describes how to use the MCP Toolbox for databases to connect your Firestore instance to integrated development environments (IDE) and developer tools that support Model Context Protocol (MCP). Use these tools to execute queries and interact with your database. This guide is for developers who use their existing IDEs and developer tools to work with Firestore.

Model Context Protocol (MCP) is an open protocol for connecting large language models (LLMs) to data sources like Firestore. This page describes how to use the MCP Toolbox for Databases to expose your developer assistance tools to a Firestore instance using the following IDEs:

Set up Firestore

  1. Create a new Google Cloud project or select an existing one.

  2. Enable the Firestore API for your project.

  3. Create a Firestore database if you haven't already.

  4. Set up authentication for your local environment.

Install MCP Toolbox

  1. Download the latest version of MCP Toolbox as a binary. Select the binary corresponding to your operating system (OS) and CPU architecture. You must use MCP Toolbox version V0.12.0 or later.

    linux/amd64

    curl -O https://storage.googleapis.com/genai-toolbox/version/linux/amd64/toolbox
    

    Replace version with the MCP Toolbox version number, for example v0.12.0.

    darwin/arm64

    curl -O https://storage.googleapis.com/genai-toolbox/version/darwin/arm64/toolbox
    

    Replace version with the MCP Toolbox version number, for example v0.12.0.

    darwin/amd64

    curl -O https://storage.googleapis.com/genai-toolbox/version/darwin/amd64/toolbox
    

    Replace version with the MCP Toolbox version number, for example v0.12.0.

    windows/amd64

    curl -O https://storage.googleapis.com/genai-toolbox/version/windows/amd64/toolbox
    

    Replace version with the MCP Toolbox version number, for example v0.12.0.

  2. Make the binary executable.

    chmod +x toolbox
    
  3. Verify the installation.

    ./toolbox --version
    

Configure the MCP client

Claude code

  1. Install Claude Code.
  2. Create the .mcp.json file in your project root, if it doesn't exist.
  3. Add the following configuration, replace the environment variables with your values, and save.

 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }
  1. Restart Claude code to apply the new configuration.

Claude desktop

  1. Open Claude Desktop and navigate to Settings.
  2. In the Developer tab, click Edit Config to open the configuration file.
  3. Add the following configuration, replace the environment variables with your values, and save.

 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }
  1. Restart Claude Desktop.
  2. From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available.

Cline

  1. Open the Cline extension in VS Code and tap MCP Servers icon.
  2. Click Configure MCP Servers to open the configuration file.
  3. Add the following configuration, replace the environment variables with your values, and save.

 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }

A green active status appears after the server connects successfully.

Cursor

  1. Create the .cursor directory in your project root if it doesn't exist.
  2. Create the .cursor/mcp.json file if it doesn't exist, and open it.
  3. Add the following configuration, replace the environment variables with your values, and save.
 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }
  1. Open Cursor and navigate to Settings > Cursor Settings > MCP. A green active status appears when the server connects.

Visual Studio Code (Copilot)

  1. Open VS Code and create .vscode directory in your project root if it does not exist.
  2. Create the .vscode/mcp.json file if it doesn't exist, and open it.
  3. Add the following configuration, replace the environment variables with your values, and save.
 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }

Windsurf

  1. Open Windsurf and navigate to Cascade assistant.
  2. Click the MCP icon, then click Configure to open the configuration file.
  3. Add the following configuration, replace the environment variables with your values, and save.
 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }

Gemini CLI

  1. Install the Gemini CLI.
  2. In your working directory, create a folder named .gemini. Within it, create a settings.json file.
  3. Add the following configuration, replace the environment variables with your values, and then save.
 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }

Gemini Code Assist

  1. Install the Gemini Code Assist extension in Visual Studio Code.
  2. Enable Agent Mode in Gemini Code Assist chat.
  3. In your working directory, create a folder named .gemini. Within it, create a settings.json file.
  4. Add the following configuration, replace the environment variables with your values, and then save.
 {
    "mcpServers": {
      "firestore": {
        "command": "./PATH/TO/toolbox",
        "args": ["--prebuilt","firestore","--stdio"],
        "env": {
          "FIRESTORE_PROJECT": "PROJECT_ID",
          "FIRESTORE_DATABASE": "DATABASE_NAME"
        }
      }
    }
  }

Use the tools

Your AI tool is now connected to Firestore using MCP. Try asking your AI assistant to list collections, get documents, query collections, or manage security rules.

The following tools are available to the LLM:

  • firestore-get-documents: Gets multiple documents from Firestore by their paths.
  • firestore-list-collections: List Firestore collections for a given parent path.
  • firestore-delete-documents: Delete multiple documents from Firestore.
  • firestore-query-collection: Query documents from a collection with filtering, ordering, and limit options.
  • firestore-get-rules: Retrieves the active Firestore security rules for the current project.
  • firestore-validate-rules: Validates Firestore security rules syntax and errors.