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:
- Cursor
- Windsurf (Codium)
- Visual Studio Code (Copilot)
- Cline (VS Code extension)
- Claude desktop
- Claude code
- Gemini CLI
- Gemini Code Assist
Set up Firestore
Create a new Google Cloud project or select an existing one.
Enable the Firestore API for your project.
Create a Firestore database if you haven't already.
Set up authentication for your local environment.
- Install gcloud CLI
- 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.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 examplev0.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 examplev0.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 examplev0.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 examplev0.12.0
.Make the binary executable.
chmod +x toolbox
Verify the installation.
./toolbox --version
Configure the MCP client
Claude code
- Install Claude Code.
- Create the
.mcp.json
file in your project root, if it doesn't exist. - 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" } } } }
- Restart Claude code to apply the new configuration.
Claude desktop
- Open Claude Desktop and navigate to Settings.
- In the Developer tab, click Edit Config to open the configuration file.
- 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" } } } }
- Restart Claude Desktop.
- From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available.
Cline
- Open the Cline extension in VS Code and tap MCP Servers icon.
- Click Configure MCP Servers to open the configuration file.
- 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
- Create the
.cursor
directory in your project root if it doesn't exist. - Create the
.cursor/mcp.json
file if it doesn't exist, and open it. - 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" } } } }
- Open Cursor and navigate to Settings > Cursor Settings > MCP. A green active status appears when the server connects.
Visual Studio Code (Copilot)
- Open VS Code and create
.vscode
directory in your project root if it does not exist. - Create the
.vscode/mcp.json
file if it doesn't exist, and open it. - 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
- Open Windsurf and navigate to Cascade assistant.
- Click the MCP icon, then click Configure to open the configuration file.
- 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
- Install the Gemini CLI.
- In your working directory, create a folder named
.gemini
. Within it, create asettings.json
file. - 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
- Install the Gemini Code Assist extension in Visual Studio Code.
- Enable Agent Mode in Gemini Code Assist chat.
- In your working directory, create a folder named
.gemini
. Within it, create asettings.json
file. - 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.