Skip to content

Prompt before installing MCP servers#10122

Merged
joehan merged 1 commit intomainfrom
jh-ask-for-mcp
Mar 17, 2026
Merged

Prompt before installing MCP servers#10122
joehan merged 1 commit intomainfrom
jh-ask-for-mcp

Conversation

@joehan
Copy link
Member

@joehan joehan commented Mar 17, 2026

Description

As requested, check for npx and prompt before installing MCP servers.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 enhances the Antigravity migration process by introducing interactive prompts before configuring Firebase and Dart MCP servers. It also adds a prerequisite check for npx availability, ensuring that server installations are only attempted when necessary tools are present and with explicit user consent. This change provides greater control to the user and prevents potential issues from automatic server setups.

Highlights

  • User Prompts for MCP Servers: Introduced interactive prompts before configuring both Firebase and Dart MCP servers, giving users explicit control over their installation.
  • npx Availability Check: Added a check for the presence of the npx command before attempting to configure the Firebase MCP server, preventing errors if the dependency is missing.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/firebase_studio/migrate.spec.ts
    • Added new test cases for Firebase and Dart MCP server prompting and npx availability checks.
  • src/firebase_studio/migrate.ts
    • Implemented user prompts for Firebase and Dart MCP server configuration.
    • Added a check for npx command existence before configuring the Firebase MCP server.
Activity
  • No human activity has been recorded for this pull request yet.
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

The pull request modifies the setupAntigravityMcpServer function to introduce user prompts for configuring Firebase and Dart MCP servers, allowing users to opt-in or opt-out, and adds checks for npx and dart command availability. New test cases are included to cover these prompting and configuration scenarios. The review suggests refactoring repeated constant definitions in the new test cases to improve maintainability and reduce duplication, and also recommends refactoring the setupAntigravityMcpServer function to reduce nesting and improve readability by handling preconditions and edge cases earlier, aligning with the style guide.

Comment on lines +619 to +620
const mcpConfigDir = path.join(require("os").homedir(), ".gemini", "antigravity");
const mcpConfigPath = path.join(mcpConfigDir, "mcp_config.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

These two lines defining mcpConfigDir and mcpConfigPath are repeated across multiple new test cases. To improve maintainability and reduce code duplication, consider defining these constants once at a higher scope, for example, at the beginning of the describe("migrate", ...) block.

Comment on lines 55 to 75
if (!mcpConfig.mcpServers["firebase"]) {
mcpConfig.mcpServers["firebase"] = {
command: "npx",
args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)],
};
updated = true;
logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`);
if (utils.commandExistsSync("npx")) {
const confirmFirebase = await prompt.confirm({
message: "Would you like to enable the Firebase MCP server for Antigravity?",
default: true,
});

if (confirmFirebase) {
mcpConfig.mcpServers["firebase"] = {
command: "npx",
args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)],
};
updated = true;
logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`);
}
} else {
logger.info("ℹ️ npx not found on PATH, skipping Firebase MCP server configuration.");
}
} else {
logger.info("ℹ️ Firebase MCP server already configured in Antigravity, skipping.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This block of code has multiple levels of nesting. To improve readability and adhere to the style guide's preference for reduced nesting, consider refactoring to handle preconditions and edge cases early using an if-else if structure. This flattens the logic and makes it easier to follow.

if (mcpConfig.mcpServers["firebase"]) {
  logger.info("ℹ️ Firebase MCP server already configured in Antigravity, skipping.");
} else if (!utils.commandExistsSync("npx")) {
  logger.info("ℹ️ npx not found on PATH, skipping Firebase MCP server configuration.");
} else {
  const confirmFirebase = await prompt.confirm({
    message: "Would you like to enable the Firebase MCP server for Antigravity?",
    default: true,
  });

  if (confirmFirebase) {
    mcpConfig.mcpServers["firebase"] = {
      command: "npx",
      args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)],
    };
    updated = true;
    logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`);
  }
}
References
  1. The repository style guide recommends reducing code nesting and handling edge cases early to improve readability. (link)

@joehan joehan merged commit a64faef into main Mar 17, 2026
47 checks passed
@joehan joehan deleted the jh-ask-for-mcp branch March 17, 2026 22:52
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.

3 participants