Skip to content

feat: Add hosting to firebase_init MCP tool, and use it in the init prompt#9375

Merged
joehan merged 6 commits intomasterfrom
add-hosting-to-init
Oct 23, 2025
Merged

feat: Add hosting to firebase_init MCP tool, and use it in the init prompt#9375
joehan merged 6 commits intomasterfrom
add-hosting-to-init

Conversation

@joehan
Copy link
Member

@joehan joehan commented Oct 23, 2025

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:

I'd like to add hosting to the firebase_init MCP tool (located in src/mcp/tools/core/init.ts). It should let users configure the siteId, public directory, and whether to configure it as. a single page app. It should not ask about web frameworks related options.

Do not change eslint, tsconfig, package.json or npm-shrinkwrap files

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.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 firebase_init MCP tool. It introduces new configuration options for users to define hosting parameters like the site ID, public directory, and single-page application status, simplifying the initialization of Firebase projects that require hosting.

Highlights

  • Firebase Hosting Configuration: The firebase_init MCP tool now supports configuring Firebase Hosting, allowing users to specify siteId, public directory, and whether to set it up as a single-page application.
  • Simplified Setup: This feature focuses on core hosting options, intentionally omitting web framework configurations for now to maintain simplicity.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +149 to +153
public: z
.string()
.optional()
.default("public")
.describe("The directory to use as the public root."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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."),

@joehan joehan changed the title feat: Add hosting to firebase_init MCP tool feat: Add hosting to firebase_init MCP tool, and use it in the init prompt Oct 23, 2025
@joehan joehan requested a review from samedson October 23, 2025 19:19
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super duper nit: "configured"

@joehan joehan merged commit dbb9ddd into master Oct 23, 2025
48 checks passed
@joehan joehan deleted the add-hosting-to-init branch October 23, 2025 21:19
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants