Skip to content

Commit 789263e

Browse files
adjust firestore prompt to be more succinct (#9222)
* adjust firestore prompt to be more succinct * clarify schema in firestore as well * show user the schema by default * fix based on reviews
1 parent 980f161 commit 789263e

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

src/mcp/resources/guides/init_firestore.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,27 @@ export const init_firestore = resource(
1717
text: `
1818
### Setup Firestore Database
1919
**Database Setup:**
20-
- Configure Firebase Firestore as the primary database for the application
21-
- Implement client code for basic CRUD operations using the Firestore SDK
22-
- Write the default \`firestore.rules\` file (see below)
23-
- Run \`firebase deploy --only firestore\` to provision the database automatically
20+
- Configure Firestore as the application's primary database.
21+
- Implement client-side CRUD using the Firebase SDK.
22+
- Present the app's Firestore data model to the user. Do not confuse Firestore's document model (NoSQL) with Firebase Data Connect's schema.
23+
- Write the default \`firestore.rules\` file (see below) explain what they do, and obtain the user's confirmation before deploying.
24+
- Run \`firebase deploy --only firestore\` to create the database automatically Do not ask the user to create it in the console.
2425
- Use production environment directly (avoid emulator for initial setup)
2526
26-
**Pre-Deployment Security Check:**
27-
- **Important**: Before running \`firebase deploy --only firestore\`, check if the project has open security rules
28-
- If open security rules are detected, show developers the current rule content
29-
- Recommend keeping open rules for a maximum of 24 hours for development purposes only
30-
- Explain that open rules are acceptable for development but must be restricted for production
31-
32-
**Deployment:**
33-
- Run \`firebase deploy --only firestore\` to provision the database automatically
34-
35-
**Verification & Testing:**
27+
**Verify and test:**
3628
- Only proceed with verification after successfully running \`firebase deploy --only firestore\`
37-
- Guide the user to visit \`https://console.firebase.google.com/u/0/project/{PROJECT_ID}/firestore\` where \`{PROJECT_ID}\` is the project they're currently using (or use \`_\` if project id is unknown).
29+
- Guide the user to open \`https://console.firebase.google.com/u/0/project/{PROJECT_ID}/firestore\` where \`{PROJECT_ID}\` is the project they're currently using (or use \`_\` if project id is unknown) to confirm their database is created.
3830
- Have developers test their application functionality and verify test data appears in the console. Using the shell, run a local version of their app for them so they can test it. To figure out how to run their app, investigate their environment.
3931
- For web apps you can check their \`package.json\` for a "start" or "dev" script
4032
- For Flutter apps, they can use \`flutter run\`
4133
- For Android apps, ask the user to run the app from Android Studio
4234
- For iOS / Apple apps, you can check their Package.swift, or read their Xcode project for the right target and use xcrun
43-
- Only proceed to the next step after confirming successful database setup and data visibility
44-
45-
**Security Configuration:**
46-
- Guide users to navigate to "Firestore Database" → "Rules" tab to configure security rules
47-
- **Critical Warning**: Never make Firestore security rules public (allowing read/write without authentication)
48-
- Ensure security rules are properly configured and tested before moving to production
35+
- Proceed only after the user confirms the database exists and the data is visible in the Firestore console.
4936
5037
**Next Steps:**
51-
- **Authentication**: Recommend implementing Firebase Authentication if the application handles sensitive user data or has open security rules
52-
- **User Management**: Implement user sign-up and login features with Firebase Authentication to establish proper data validation and access controls
53-
- **Security Rules**: Configure user-based security rules based on your application's specific requirements
38+
- **Authentication**: Recommend implementing Firebase Authentication if the application handles sensitive user data or has open security rules.
39+
- **User Management**: Implement sign-up and sign-in flows to support user-based access control and update security rules accordingly.
40+
- **Security Rules**: Configure user-based security rules based on your application's specific requirements.
5441
5542
### Default \`firestore.rules\` file:
5643

0 commit comments

Comments
 (0)