Firestore MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/your-username/firestore-mcp.git
cd firestore-mcp
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "FIREBASE_PROJECT_ID=${FIREBASE_PROJECT_ID}" -e "FIREBASE_CLIENT_EMAIL=${FIREBASE_CLIENT_EMAIL}" -e "FIREBASE_PRIVATE_KEY=${FIREBASE_PRIVATE_KEY}" firestore-mcp -- node "<FULL_PATH_TO_FIRESTORE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_FIRESTORE_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:FIREBASE_PROJECT_IDFIREBASE_CLIENT_EMAILFIREBASE_PRIVATE_KEY
README.md

Interact with Firebase Firestore databases through full CRUD operations.

Firestore MCP Server

Model Context Protocol (MCP) server for Firebase Firestore. This server enables AI assistants like Claude to directly interact with your Firestore database.

Firebase Firestore用のModel Context Protocol (MCP)サーバーです。ClaudeなどのAIアシスタントがFirestoreデータベースと直接やり取りできるようになります。

Features / 機能

  • Full CRUD Operations: Create, read, update, and delete documents
  • Collection Management: List collections and subcollections
  • Query Support: Filter documents with Firestore query operators
  • Document Counting: Get document counts without fetching all data
  • Type Conversion: Automatic handling of Firestore types (Timestamp, GeoPoint, etc.)

  • フルCRUD操作: ドキュメントの作成、読み取り、更新、削除
  • コレクション管理: コレクションとサブコレクションの一覧表示
  • クエリサポート: Firestoreクエリ演算子によるドキュメントのフィルタリング
  • ドキュメントカウント: 全データを取得せずにドキュメント数を取得
  • 型変換: Firestoreの型(Timestamp、GeoPointなど)の自動処理

Requirements / 必要条件

  • Node.js 18+
  • Firebase project with Firestore enabled / Firestoreが有効なFirebaseプロジェクト
  • Firebase Admin SDK credentials (service account) / Firebase Admin SDK認証情報(サービスアカウント)

Installation / インストール

1. Clone the repository / リポジトリをクローン

git clone https://github.com/your-username/firestore-mcp.git
cd firestore-mcp

2. Install dependencies / 依存関係をインストール

npm install

3. Configure Firebase credentials / Firebase認証情報を設定

Copy the example environment file: / 環境変数ファイルをコピー:

cp .env.example .env

Edit .env with your Firebase credentials: / .envにFirebase認証情報を設定:

FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-xxxxx@your-project.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
How to get Firebase credentials / Firebase認証情報の取得方法
  1. Go to Firebase Console / Firebaseコンソールにアクセス
  2. Select your project / プロジェクトを選択
  3. Navigate to Project Settings > Service accounts / プロジェクトの設定 > サービスアカウントに移動
  4. Click Generate new private key / 新しい秘密鍵を生成をクリック
  5. Download the JSON file / JSONファイルをダウンロード
  6. Copy values to your .env file: / .envファイルに値をコピー:
    • project_idFIREBASE_PROJECT_ID
    • client_emailFIREBASE_CLIENT_EMAIL
    • private_keyFIREBASE_PRIVATE_KEY

4. Build the project / プロジェクトをビルド

npm run build

Claude Code Configuration / Claude Code設定

Project-level configuration (recommended) / プロジェクトレベル設定(推奨)

Create .mcp.json in your project root: / プロジェクトルートに.mcp.jsonを作成:

{
  "mcpServers": {
    "firestore": {
      "command": "node",
      "args": ["/path/to/firestore-mcp/dist/index.js"]
    }
  }
}

Note: The server automatically loads .env from its installation directory, so cwd is not required.

注意: サーバーはインストールディレクトリから自動的に.envを読み込むため、cwdは不要です。

With environment variables inline / 環境変数をインラインで指定

If you prefer not to use a .env file: / .envファイルを使用しない場合:

{
  "mcpServers": {
    "firestore": {
      "command": "node",
      "args": ["/path/to/firestore-mcp/dist/index.js"],
      "env": {
        "FIREBASE_PROJECT_ID": "your-project-id",
        "FIREBASE_CLIENT_EMAIL": "your-client-email",
        "FIREBASE_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n"
      }
    }
  }
}

After configuration / 設定後

  1. Restart Claude Code / Claude Codeを再起動
  2. When prompted, approve the MCP server / プロンプトが表示されたらMCPサーバーを承認
  3. The Firestore tools will be available in your conversation / Firestoreツールが会話で使用可能になります

Available Tools / 利用可能なツール

Collection Operations / コレクション操作

Tool Description Parameters
list_collections List all top-level collections / トップレベルコレクションを一覧表示 None
list_subcollections List subcollections of a document / ドキュメントのサブコレクションを一覧表示 documentPath
count_documents Count documents in a collection / コレクション内のドキュメント数をカウント collectionPath

Document Operations / ドキュメント操作

Tool Description Parameters
get_document Get a single document / 単一ドキュメントを取得 documentPath
list_documents List documents in a collection / コレクション内のドキュメントを一覧表示 collectionPath, limit?
create_document Create a new document / 新しいドキュメントを作成 collectionPath, data, documentId?
update_document Update an existing document / 既存ドキュメントを更新 documentPath, data, merge?
delete_document Delete a document / ドキュメントを削除 documentPath

Query Operations / クエリ操作

Tool Description Parameters
query_documents Query with filters / フィルタ付きクエリ collectionPath, field, operator, value, limit?
Supported Query Operators / サポートされているクエリ演算子
  • == - Equal to / 等しい
  • != - Not equa

Tools (9)

list_collectionsList all top-level collections
list_subcollectionsList subcollections of a document
count_documentsCount documents in a collection
get_documentGet a single document
list_documentsList documents in a collection
create_documentCreate a new document
update_documentUpdate an existing document
delete_documentDelete a document
query_documentsQuery with filters

Environment Variables

FIREBASE_PROJECT_IDrequiredYour Firebase project ID
FIREBASE_CLIENT_EMAILrequiredFirebase service account client email
FIREBASE_PRIVATE_KEYrequiredFirebase service account private key

Configuration

claude_desktop_config.json
{"mcpServers": {"firestore": {"command": "node", "args": ["/path/to/firestore-mcp/dist/index.js"]}}}

Try it

List all the top-level collections in my Firestore database.
Count how many documents are in the 'users' collection.
Get the document at path 'users/user_123' and show me its contents.
Find all documents in the 'orders' collection where 'status' is equal to 'pending'.
Create a new document in the 'logs' collection with the data { 'message': 'System startup', 'timestamp': 'now' }.

Frequently Asked Questions

What are the key features of Firestore MCP Server?

Full CRUD operations for documents. Collection and subcollection management. Advanced query support with filtering. Efficient document counting without fetching full data. Automatic type conversion for Firestore types like Timestamp and GeoPoint.

What can I use Firestore MCP Server for?

Managing database records directly through an AI chat interface. Performing quick database audits or document counts. Debugging or inspecting Firestore data structures during development. Automating data entry or cleanup tasks in Firestore.

How do I install Firestore MCP Server?

Install Firestore MCP Server by running: git clone https://github.com/your-username/firestore-mcp.git && cd firestore-mcp && npm install && npm run build

What MCP clients work with Firestore MCP Server?

Firestore MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Firestore MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare