MCP Server Firebase logo

MCP Server Firebase

by sheep52031

This is a Model Context Protocol (MCP) server implementation based on Firebase. It offers two running modes: local Node.js mode (using Firebase Admin SDK) and Cloudflare Workers mode (using Firebase REST API).

View on GitHub

Last updated: N/A

What is MCP Server Firebase?

MCP Server Firebase is a server implementation of the Model Context Protocol (MCP) that utilizes Firebase as its backend. It allows you to interact with Firestore databases using MCP tools, offering functionalities like reading, writing, updating, and deleting documents.

How to use MCP Server Firebase?

To use MCP Server Firebase, you need to clone the repository, install dependencies, configure either the local Node.js mode or the Cloudflare Workers mode with the appropriate Firebase credentials, and then run the server in your desired mode. You can then connect to the server using an MCP client and use the provided MCP tools to interact with Firestore.

Key features of MCP Server Firebase

  • Firestore database operations (read, write, update, delete documents)

  • Collection and subcollection listing

  • Support for filtered queries

  • Two running modes: Node.js and Cloudflare Workers

Use cases of MCP Server Firebase

  • Building applications that require real-time data synchronization with Firebase

  • Creating APIs for accessing and manipulating Firestore data

  • Integrating Firebase with other services using MCP

  • Developing serverless applications with Firebase and Cloudflare Workers

FAQ from MCP Server Firebase

What is the difference between the local Node.js mode and the Cloudflare Workers mode?

The local Node.js mode uses the Firebase Admin SDK and requires a service account key, while the Cloudflare Workers mode uses the Firebase REST API and requires a Firebase Web API key.

How do I configure the Firebase credentials?

For the local mode, you need to download a service account key from the Firebase console and set the SERVICE_ACCOUNT_KEY_PATH environment variable. For the Cloudflare Workers mode, you need to set the FIREBASE_PROJECT_ID, FIREBASE_API_KEY, and FIREBASE_AUTH_DOMAIN environment variables.

How do I connect to the MCP server from my client application?

You can use an MCP SDK to connect to the server, providing the endpoint URL for either the local mode (e.g., http://localhost:8765) or the Cloudflare Workers mode (e.g., https://your-worker.workers.dev).

What are the security considerations when using MCP Server Firebase?

You should avoid committing service account keys or API keys to Git repositories and ensure that all sensitive information is set as environment variables or Secrets. Also, set appropriate security rules for Firestore.

What permissions are required for the Firebase service account?

The Firebase service account needs to have appropriate permissions to read, write, update, and delete documents in Firestore, depending on the operations you want to perform.