{"id":16646,"library":"mcpfirestoredb","title":"Google Cloud Firestore MCP Server","description":"MCP FirestoreDB is a Node.js-based server that implements the Model Context Protocol (MCP) for Google Cloud Firestore operations. Currently at version 1.1.2, this package provides a robust set of 17 specialized tools, including document CRUD, batch operations, collection management, and advanced index configuration and analysis. It acts as an intermediary, enabling MCP-compatible clients (such as AI agents like Claude Desktop or Cursor IDE) to interact with Firestore databases via a standardized protocol. Key differentiators include its adherence to the MCP standard, comprehensive tooling for common and complex Firestore tasks (e.g., schema analysis, index generation), and capabilities for real-time operations, advanced querying, and high-performance batch processing. The package emphasizes production readiness with robust error handling and validation, and is primarily consumed by configuring it within an MCP client environment rather than requiring direct programmatic integration of its individual tools into an application. It provides the server-side logic for managing Firestore resources.","status":"active","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/hendrickcastro/MCPFirestoreDB","tags":["javascript","mcp","model-context-protocol","firestore","google-firestore","nosql","document-database","database","database-operations"],"install":[{"cmd":"npm install mcpfirestoredb","lang":"bash","label":"npm"},{"cmd":"yarn add mcpfirestoredb","lang":"bash","label":"yarn"},{"cmd":"pnpm add mcpfirestoredb","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for interacting with Google Cloud Firestore database operations.","package":"@google-cloud/firestore","optional":false},{"reason":"Framework or SDK for implementing the Model Context Protocol (MCP) server.","package":"@modelcontextprotocol/sdk","optional":false}],"imports":[{"note":"Primarily an ESM-only package since Node.js 18. This function programmatically initiates the MCP FirestoreDB server, often used for embedding, testing, or custom deployment scenarios.","wrong":"const { startMCPServer } = require('mcpfirestoredb');","symbol":"startMCPServer","correct":"import { startMCPServer } from 'mcpfirestoredb';"},{"note":"Type definition for configuring the MCP FirestoreDB server programmatically, including essential settings like `projectId` and `credentialsPath`.","symbol":"FirestoreMCPServerConfig","correct":"import type { FirestoreMCPServerConfig } from 'mcpfirestoredb';"},{"note":"Represents the base interface or type for a tool exposed by the MCP server. Useful for introspection or custom tool development within the server's architecture, not for direct client-side tool execution.","symbol":"MCPTool","correct":"import type { MCPTool } from 'mcpfirestoredb';"}],"quickstart":{"code":"import { startMCPServer } from 'mcpfirestoredb';\nimport dotenv from 'dotenv';\nimport path from 'path';\n\ndotenv.config(); // Load environment variables from .env\n\n// Ensure required environment variables are set\nif (!process.env.GOOGLE_APPLICATION_CREDENTIALS) {\n  console.error('Error: GOOGLE_APPLICATION_CREDENTIALS environment variable is not set. Please provide the path to your service account JSON file.');\n  process.exit(1);\n}\nif (!process.env.FIREBASE_PROJECT_ID) {\n  console.error('Error: FIREBASE_PROJECT_ID environment variable is not set. Please provide your Google Cloud Project ID.');\n  process.exit(1);\n}\n\nasync function runServer() {\n  try {\n    console.log('Starting MCP FirestoreDB Server...');\n    const serverInstance = await startMCPServer({\n      projectId: process.env.FIREBASE_PROJECT_ID,\n      credentialsPath: process.env.GOOGLE_APPLICATION_CREDENTIALS,\n      databaseId: process.env.FIRESTORE_DATABASE_ID || '(default)', // Optional\n      emulatorHost: process.env.FIRESTORE_EMULATOR_HOST // Optional\n    });\n    console.log(`MCP FirestoreDB Server started successfully on port ${serverInstance.port || 'default'}.`);\n    console.log('Ready to receive commands from MCP-compatible clients.');\n  } catch (error) {\n    console.error('Failed to start MCP FirestoreDB Server:', error);\n    process.exit(1);\n  }\n}\n\nrunServer();","lang":"typescript","description":"This quickstart demonstrates how to programmatically start the MCP FirestoreDB server, loading necessary Google Cloud credentials from environment variables. It showcases basic initialization for integration into a Node.js application."},"warnings":[{"fix":"Always double-check the target collection ID and ensure proper authorization before invoking `delete_collection`. Consider implementing additional safeguards in your client application if exposing this tool broadly.","message":"The `delete_collection` tool is powerful and, if used incorrectly, can permanently erase an entire Firestore collection and all its documents without confirmation. Use with extreme caution.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade your Node.js environment to version 18.0.0 or higher. Use a Node Version Manager (nvm) for easy switching: `nvm install 18 && nvm use 18`.","message":"This package requires Node.js version 18 or higher. Running with older Node.js versions will result in execution errors due to modern JavaScript features and API dependencies.","severity":"breaking","affected_versions":"<18.0.0"},{"fix":"Ensure `GOOGLE_APPLICATION_CREDENTIALS` points to the correct, accessible path of your service account JSON file and `FIREBASE_PROJECT_ID` matches your Firebase/GCP project ID. Verify file permissions for the credentials file.","message":"Correct configuration of `GOOGLE_APPLICATION_CREDENTIALS` and `FIREBASE_PROJECT_ID` environment variables is crucial for the server to authenticate with Google Cloud Firestore. Incorrect paths or missing variables will lead to authentication failures.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the absolute path of your service account JSON key file (e.g., `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json`).","cause":"The server failed to find the path to the Google service account credentials file.","error":"Error: GOOGLE_APPLICATION_CREDENTIALS environment variable is not set."},{"fix":"Set the `FIREBASE_PROJECT_ID` environment variable to your specific project ID (e.g., `export FIREBASE_PROJECT_ID=my-gcp-project-123`).","cause":"The Firebase/Google Cloud project ID was not provided to the server.","error":"Error: FIREBASE_PROJECT_ID environment variable is not set."},{"fix":"Ensure `FIREBASE_PROJECT_ID` is correctly loaded. For programmatic usage, explicitly pass `projectId` in the configuration object to `startMCPServer`. For CLI/agent usage, verify the client's configuration for passing the project ID.","cause":"Despite setting environment variables, the Firestore client could not pick up the project ID, possibly due to incorrect loading or application default credentials issues.","error":"FirebaseError: The project ID is not set. Either specify a project ID via the 'projectId' property in the options object or set the GOOGLE_CLOUD_PROJECT environment variable."}],"ecosystem":"npm"}