feat: Add hosting to firebase_init MCP tool, and use it in the init prompt#9375
feat: Add hosting to firebase_init MCP tool, and use it in the init prompt#9375
Conversation
Adds hosting to the firebase_init MCP tool. It lets users configure the siteId, public directory, and whether to configure it as a single page app.
Summary of ChangesHello @joehan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Firebase Hosting setup into the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for initializing Firebase Hosting through the firebase_init MCP tool. The changes look good and correctly map the new tool inputs to the existing hosting setup logic. I've left a couple of suggestions to rename the public property in the new API to avoid using a reserved keyword, which will improve maintainability.
src/mcp/tools/core/init.ts
Outdated
| public: z | ||
| .string() | ||
| .optional() | ||
| .default("public") | ||
| .describe("The directory to use as the public root."), |
There was a problem hiding this comment.
public is a reserved keyword in TypeScript. While it's valid to use it as a property name here, it can lead to issues, for example with object destructuring (const { public } = ... is invalid). It's better to use a non-reserved name like publicDirectory to improve code clarity and prevent potential errors. This change will also require an update on line 247.
| public: z | |
| .string() | |
| .optional() | |
| .default("public") | |
| .describe("The directory to use as the public root."), | |
| publicDirectory: z | |
| .string() | |
| .optional() | |
| .default("public") | |
| .describe("The directory to use as the public root."), |
| text: ` | ||
| ### Configure Firebase Hosting | ||
| Default hosting site for ${ctx.projectId}: ${defaultHostingSite || "Does not exist"} | ||
| If there is not default hosting site configure, ask the user what the site ID should be, and suggest ${ctx.projectId} as a good choice. |
There was a problem hiding this comment.
Super duper nit: "configured"
Description
Adds hosting to the firebase_init MCP tool. It lets users configure the siteId, public directory, and whether to configure it as a single page app. Omitting web frameworks options for now to keep things simple.
I've also swapped the /firebase:init prompt to use the new tool. This should help with cases where the prompt would try to overwrite the entire firebase.json instead of adding hosting to it.
I started off this PR in Jules - original prompt: