Get the FREE Ultimate OpenClaw Setup Guide →

firemcp

A Model Context Protocol (MCP) server for Firestore, enabling AI agents to interact with Firestore databases through multiple transport protocols (stdio, HTTP, SSE)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio iamanishroy-firemcp bun run index.ts \
  --env PORT="3003" \
  --env FIREBASE_API_KEY="your-api-key-here" \
  --env FIREBASE_PROJECT_ID="your-project-id" \
  --env FIREBASE_USER_EMAIL="user@example.com" \
  --env FIREBASE_USER_PASSWORD="your-password-here"

How to use

FireMCP is a Firestore-backed MCP server that lets AI agents interact with your Firestore data through multiple transport protocols while enforcing security via the Firebase Client SDK. It supports stdio, HTTP Streamable, and Server-Sent Events (SSE) transports, so you can choose the communication style that best fits your MCP client (for example Claude Desktop uses stdio by default). The server exposes five well-defined Firestore operations as MCP tools: get_document, set_document, add_document, delete_document, and query_collection. Each tool enforces Firestore security rules by running under the Firebase Client SDK instead of the Admin SDK, ensuring that agents can only access data permitted by your security rules. You can invoke these tools via MCP clients, and you can extend functionality by adding new tools under src/tools and registering them in src/server.ts. The project emphasizes type-safety through TypeScript and Zod schemas, which helps ensure inputs and outputs conform to expected shapes when building prompts and tool calls.

How to install

Prerequisites:

  • Bun (v1.0 or higher)
  • Node-like environment for Bun (no Node/AWS dependencies required)
  • A Firebase project with Firestore enabled
  • A Firebase user account (email/password) configured for authentication

Steps:

  1. Clone the repository:
git clone https://github.com/iamanishroy/firemcp.git
cd firemcp
  1. Install dependencies with Bun:
bun install
  1. Configure environment variables:
  • Copy the example env file and fill in your Firebase credentials:
cp .env.example .env
  • Edit .env with your Firebase configuration, for example:
FIREBASE_API_KEY=your-api-key-here
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_USER_EMAIL=user@example.com
FIREBASE_USER_PASSWORD=your-password-here
# Optional
PORT=3003
  1. Run the server using your preferred transport:
# stdio (default - suitable for Claude Desktop)
bun run stdio

# HTTP Streamable
bun run http

# Server-Sent Events (SSE)
bun run sse

Note: The server reads Firebase credentials from the environment (or a .env file if you use a dotenv approach). Ensure Firestore Security Rules are configured to permit access only for authenticated users as described in the repository.

Additional notes

  • Firestore Security Rules: Since FireMCP uses the Firebase Client SDK, you must configure Firestore Security Rules to restrict access to authenticated users and enforce per-user data boundaries. The README provides an example ruleset.
  • Transport choice matters: stdio is typically used by MCP clients like Claude Desktop, while http and sse offer streaming capabilities suitable for web clients or custom MCP clients.
  • Tool extensibility: To add new Firestore operations, place a new tool under src/tools/, define input/output schemas with Zod, implement your logic, and register the tool in src/server.ts.
  • Environment management: Keep sensitive credentials out of version control. Use a .env file or a secure secret store in deployment environments.
  • Debugging: Use bun run inspect to launch the MCP Inspector for debugging and introspection of tool behavior and responses.

Related MCP Servers

Sponsor this space

Reach thousands of developers