firestore-https-flutter
A Dart package implementing a Model Context Protocol (MCP) server for accessing Cloud Firestore. It supports HTTP transport.
Prerequisites
- Dart SDK >= 3.10.4
- A Google Cloud Project with Firestore enabled.
GOOGLE_CLOUD_PROJECTenvironment variable set to your Google Cloud project ID.- Google Cloud credentials configured (e.g. via
gcloud auth application-default login).
Usage
Run the server over HTTP (SSE):
dart run bin/firestore_https_flutter.dart --port 8080 --host localhost --path /mcp
Tools
The server exposes the following MCP tools for managing a "Cymbal Superstore Inventory":
- greet: Get a greeting (test tool).
- Arguments:
name(string)
- Arguments:
- get_products: Get a list of all products from the
inventorycollection. - get_product_by_id: Get a single product by its ID.
- Arguments:
id(string)
- Arguments:
- search: Search for products in the inventory by name (case-insensitive).
- Arguments:
query(string)
- Arguments:
- seed: Seed the
inventorycollection with sample data (Apples, Bananas, etc.). - reset: Clear all documents from the
inventorycollection. - get_root: Get a welcome message from the API.
Development
Running Tests
dart test
Analysis
dart analyze