Enables AI agents to interact with Firestore databases through complete CRUD operations including getting, setting, adding, deleting documents, and querying collections with filters and limits, while respecting Firestore Security Rules through the Firebase Client SDK.
FireMCP š„
A Model Context Protocol (MCP) server for Firestore, enabling AI agents and LLMs to interact with Firestore databases securely through multiple transport protocols.
š Features
Multiple Transport Protocols: Support for stdio, HTTP Streamable, and Server-Sent Events (SSE)
Secure by Design: Uses Firebase Client SDK with Firestore Security Rules instead of Admin SDK
Complete CRUD Operations: Get, set, add, delete, and query Firestore documents
Type-Safe: Built with TypeScript and Zod schemas
MCP Compatible: Works with any MCP-compatible client (Claude Desktop, etc.)
š Security Philosophy
FireMCP uses the Firebase Client SDK instead of the Admin SDK for a critical security reason:
The Client SDK respects Firestore Security Rules, ensuring that AI agents can only access data they're explicitly permitted to. This prevents unauthorized access to sensitive resources, even if the AI behaves unexpectedly.
With the Admin SDK, an AI would have unrestricted access to all Firestore data, which could be a significant security risk in production environments.
š Prerequisites
Bun v1.0 or higher
A Firebase project with Firestore enabled
Firebase Authentication configured with at least one user
š Quick Start
1. Clone the Repository
2. Install Dependencies
3. Configure Environment Variables
Copy the example environment file and fill in your Firebase credentials:
Edit .env with your Firebase configuration:
Note: You can find these values in your Firebase Console under Project Settings.
4. Run the Server
Choose your preferred transport protocol:
š§ Available Tools
FireMCP provides five Firestore operations as MCP tools:
1. get_document
Retrieve a document from Firestore by its path.
Input:
Output:
2. set_document
Create or overwrite a document in Firestore.
Input:
Output:
3. add_document
Add a new document to a collection with an auto-generated ID.
Input:
Output:
4. delete_document
Delete a document from Firestore.
Input:
Output:
5. query_collection
Query a Firestore collection with filters and limits.
Input:
Output:
š Integration with MCP Clients
Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
MCP Inspector
For debugging and testing:
š ļø Development
Scripts
bun run start- Start with default transport (stdio)bun run dev- Same as startbun run http- Start with HTTP Streamable transportbun run sse- Start with SSE transportbun run stdio- Start with stdio transportbun run inspect- Launch MCP Inspector for debuggingbun run kill- Kill any process running on port 3003
Adding New Tools
Create a new file in
src/tools/Define input/output schemas using Zod
Implement the tool function
Register the tool in
src/server.ts
Example:
š Firestore Security Rules
Since FireMCP uses the Client SDK, you must configure Firestore Security Rules. Example rules:
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
Built with the Model Context Protocol SDK
Powered by Firebase
Runtime by Bun
š§ Support
If you have any questions or run into issues, please open an issue on GitHub.