Skip to content
Merged
12 changes: 4 additions & 8 deletions src/mcp/prompts/core/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export const init = prompt(
{
name: "init",
description: "Use this command to setup Firebase for the current workspace.",
description: "Use this command to set up Firebase services, like backend and AI features.",
annotations: {
title: "Initialize Firebase",
},
Expand Down Expand Up @@ -38,7 +38,7 @@
Contents of \`firebase.json\` config file:

\`\`\`json
${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })}

Check warning on line 41 in src/mcp/prompts/core/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
\`\`\`


Expand All @@ -48,12 +48,8 @@

1. If there is no active user, use the \`firebase_login\` tool to help them sign in.
- If you run into issues logging the user in, suggest that they run \`npx firebase-tools login --reauth\` in a separate terminal
2.1 If the user supplied specific instructions, determine which of the services listed below are the best match for the user's needs. Skip to 2.2 if they didn't provide a prompt
1. Backend Services: Backend services for the user such as user authentication, database, or hosting.
2. Firebase AI Logic: Add AI features such as chat experiences, multimodal prompts, image generation and editing (via nano banana), etc.
- UNAVAILABLE SERVICES: Analytics, Remote Config (feature flagging), A/B testing, Crashlytics (crash reporting), and Cloud Messaging (push notifications) are not yet available for setup via this command.
2.2 Start by listing out the existing init options that are available to the user. Ask the user which set of services they would like to add to their app. Always enumerate them and list the options out explicitly for the user.
1. Backend Services: Backend services for the user such as user authentication, database, or hosting.
2.1 Start by listing out the existing init options that are available to the user. Ask the user which set of services they would like to add to their app. Always enumerate them and list the options out explicitly for the user.
1. Backend Services: Backend services for the app, such as setting up a database, adding a user-authentication sign up and login page, and deploying a web app to a production URL.
- IMPORTANT: The backend setup guide is for web apps only. If the user requests backend setup for a mobile app (iOS, Android, or Flutter), inform them that this is not supported and do not use the backend setup guide. You can still assist with other requests.
2. Firebase AI Logic: Add AI features such as chat experiences, multimodal prompts, image generation and editing (via nano banana), etc.
- IMPORTANT: The Firebase AI Logic setup guide is for web, flutter, and android apps only. If the user requests firebase setup for unsupported platforms (iOS, Unity, or anything else), inform them that this is not supported and direct the user to Firebase Docs to learn how to set up AI Logic for their application (share this link with the user https://firebase.google.com/docs/ai-logic/get-started?api=dev). You can still assist with other requests.
Expand Down Expand Up @@ -90,7 +86,7 @@
'''
8. Read the guide for the appropriate services and follow the instructions. If no guides match the user's need, inform the user.
- Use the Firebase \`read_resources\` tool to load the instructions for the service the developer chose in step 2 of this guide
- [Backend Services](firebase://guides/init/backend): Read this resource to setup backend services for the user such as user authentication, database, or hosting.
- [Backend Services](firebase://guides/init/backend): Read this resource to set up backend services for the app, such as setting up a database, adding a user-authentication sign up and login page, and deploying a web app to a production URL.
- [Firebase AI Logic](firebase://guides/init/ai): Read this resource to add Gemini-powered AI features such as chat experiences, multimodal prompts, image generation, image editing (via nano banana), etc.
`.trim(),
},
Expand Down
4 changes: 4 additions & 0 deletions src/mcp/resources/guides/init_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const init_auth = resource(
**Testing & Deployment:**
- Test the complete sign-up and sign-in flow to verify authentication functionality
- Deploy the application to production once authentication is verified and working properly

**Next Steps:**
- **Security Rules**: If an app uses *Cloud Firestore database*, *Cloud Storage for Firebase*, or *Firebase Realtime Database*, then please update user-based Security Rules that are structured according to the app's specific requirements.
- **App Deployment**: Deploy the app to production after Security Rules are verified to be working properly.
`.trim(),
},
],
Expand Down
2 changes: 2 additions & 0 deletions src/mcp/resources/guides/init_firestore_rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Contents of the user's current \`firestore.rules\` file:

\`\`\`
${config.readProjectFile("firestore.rules", { fallback: "<FILE DOES NOT EXIST>" })}

Check warning on line 24 in src/mcp/resources/guides/init_firestore_rules.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
\`\`\`

1. Create the personalData and publicData security rules (seen below). If they have existing \`firestore.rules\`, integrate these with the user's existing rules.
Expand All @@ -31,6 +31,8 @@

For database entities that neatly fall into the "personal" and "public categories, you can use the personalData and publicData rules. Use the following firestore.rules file, and add a comment above 'personalData' and 'publicData' to note what entities apply to each rule.

**Next Steps:**
- **App Deployment**: Deploy the app to production after Security Rules are verified to be working properly.
\`\`\`
rules_version = '2';

Expand Down
Loading