Stay organized with collections
Save and categorize content based on your preferences.
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:
Run gcloud auth application-default login to authenticate
Install MCP Toolbox
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.13.0 or later.
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-add-documents: Add document to a Firestore collection path.
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-update-document: Update an existing document in Firestore by its path.
firestore-validate-rules: Validates Firestore security rules syntax and errors.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["Connect your IDE to Firestore using MCP Toolbox\n\nThis page describes how to use the [MCP Toolbox for databases](https://github.com/googleapis/genai-toolbox) to connect your Firestore instance to integrated development environments (IDE) and developer tools that support [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction). 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.\n\n[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) 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](https://github.com/googleapis/genai-toolbox) to expose your developer assistance tools to a Firestore instance using the following IDEs:\n\n- [Cursor](#configure-your-mcp-client)\n- [Windsurf](#configure-your-mcp-client) (Codium)\n- [Visual Studio Code](#configure-your-mcp-client) (Copilot)\n- [Cline](#configure-your-mcp-client) (VS Code extension)\n- [Claude desktop](#configure-your-mcp-client)\n- [Claude code](#configure-your-mcp-client)\n- [Gemini CLI](#configure-your-mcp-client)\n- [Gemini Code Assist](#configure-your-mcp-client)\n\nSet up Firestore\n\n1. [Create a new Google Cloud project](/resource-manager/docs/creating-managing-projects) or [select an existing one](/resource-manager/docs/creating-managing-projects#identifying_projects).\n\n2. [Enable the Firestore API](https://console.cloud.google.com/apis/library/firestore.googleapis.com) for your project.\n\n3. [Create a Firestore database](/firestore/docs/create-database-web-mobile-client-library) if you haven't already.\n\n4. Set up authentication for your local environment.\n\n - [Install gcloud CLI](/sdk/docs/install)\n - Run `gcloud auth application-default login` to authenticate\n\nInstall MCP Toolbox\n\n1. Download the latest version of MCP Toolbox as a binary. Select the [binary](https://github.com/googleapis/genai-toolbox/releases) corresponding to your operating system (OS) and CPU architecture. You must use MCP Toolbox version V0.13.0 or later.\n\n linux/amd64 \n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/version/linux/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eversion\u003c/var\u003e with the MCP Toolbox\n version number, for example `v0.13.0`.\n\n darwin/arm64 \n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/version/darwin/arm64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eversion\u003c/var\u003e with the MCP Toolbox\n version number, for example `v0.13.0`.\n\n darwin/amd64 \n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/version/darwin/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eversion\u003c/var\u003e with the MCP Toolbox\n version number, for example `v0.13.0`.\n\n windows/amd64 \n\n ```\n curl -O https://storage.googleapis.com/genai-toolbox/version/windows/amd64/toolbox\n ```\n\n Replace \u003cvar translate=\"no\"\u003eversion\u003c/var\u003e with the MCP Toolbox\n version number, for example `v0.13.0`.\n2. Make the binary executable.\n\n chmod +x toolbox\n\n3. Verify the installation.\n\n ./toolbox --version\n\nConfigure the MCP client \n\nClaude code\n\n1. Install [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview).\n2. Create the `.mcp.json` file in your project root, if it doesn't exist.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n\u003cbr /\u003e\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\n4. Restart Claude code to apply the new configuration.\n\nClaude desktop\n\n1. Open [Claude Desktop](https://claude.ai/download) and navigate to **Settings**.\n2. In the **Developer** tab, click **Edit Config** to open the configuration file.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n\u003cbr /\u003e\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\n4. Restart Claude Desktop.\n5. From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available.\n\nCline\n\n1. Open the [Cline](https://github.com/cline/cline) extension in VS Code and tap **MCP Servers** icon.\n2. Click **Configure MCP Servers** to open the configuration file.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n\u003cbr /\u003e\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\nA green active status appears after the server connects successfully. \n\nCursor\n\n1. Create the `.cursor` directory in your project root if it doesn't exist.\n2. Create the `.cursor/mcp.json` file if it doesn't exist, and open it.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\n4. Open [Cursor](https://www.cursor.com/) and navigate to **Settings \\\u003e Cursor Settings \\\u003e MCP**. A green active status appears when the server connects.\n\nVisual Studio Code (Copilot)\n\n1. Open [VS Code](https://code.visualstudio.com/docs/copilot/overview) and create `.vscode` directory in your project root if it does not exist.\n2. Create the `.vscode/mcp.json` file if it doesn't exist, and open it.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n```\n {\n \"servers\":{\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\nWindsurf\n\n1. Open [Windsurf](https://docs.codeium.com/windsurf) and navigate to Cascade assistant.\n2. Click the MCP icon, then click **Configure** to open the configuration file.\n3. Add the following configuration, replace the environment variables with your values, and save.\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\nGemini CLI\n\n1. Install the [Gemini CLI](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#quickstart).\n2. In your working directory, create a folder named `.gemini`. Within it, create a `settings.json` file.\n3. Add the following configuration, replace the environment variables with your values, and then save.\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\nGemini Code Assist\n\n1. Install the [Gemini Code Assist](https://marketplace.visualstudio.com/items?itemName=Google.geminicodeassist) extension in Visual Studio Code.\n2. Enable Agent Mode in Gemini Code Assist chat.\n3. In your working directory, create a folder named `.gemini`. Within it, create a `settings.json` file.\n4. Add the following configuration, replace the environment variables with your values, and then save.\n\n```\n {\n \"mcpServers\": {\n \"firestore\": {\n \"command\": \"./PATH/TO/toolbox\",\n \"args\": [\"--prebuilt\",\"firestore\",\"--stdio\"],\n \"env\": {\n \"FIRESTORE_PROJECT\": \"PROJECT_ID\",\n \"FIRESTORE_DATABASE\": \"DATABASE_NAME\"\n }\n }\n }\n }\n```\n\nUse the tools\n\nYour AI tool is now connected to Firestore using MCP. Try asking your AI\nassistant to list collections, get documents, query collections, or manage\nsecurity rules.\n\nThe following tools are available to the LLM:\n\n- **firestore-add-documents**: Add document to a Firestore collection path.\n- **firestore-get-documents**: Gets multiple documents from Firestore by their paths.\n- **firestore-list-collections**: List Firestore collections for a given parent path.\n- **firestore-delete-documents**: Delete multiple documents from Firestore.\n- **firestore-query-collection**: Query documents from a collection with filtering, ordering, and limit options.\n- **firestore-get-rules**: Retrieves the active Firestore security rules for the current project.\n- **firestore-update-document**: Update an existing document in Firestore by its path.\n- **firestore-validate-rules**: Validates Firestore security rules syntax and errors.\n\n| **Note:** Prebuilt tools are pre-1.0, so expect some tool changes between versions. LLMs will adapt to the tools available, so this doesn't affect most users."]]