Skip to content

Conversation

@schnecle
Copy link
Contributor

@schnecle schnecle commented Jan 8, 2026

Description

Updates the behavior of --only and --tools flags to bypass availability checks.

Why make this change?

When attempting to reproduce behavior for #9663, I noticed that --only was not working for Crashlytics in directories that have non-standard dependency management because it was still executing an availability check. This availability check looks for a dependency on Crashlytics for apps that use gradle, swift package manager, pod, carthage, and flutter's standard pubspec.yaml file.

We direct customers to use the --only flag if they do not fall into one of the supported categories above for Crashlytics MCP.

Scenarios Tested

  • Added unit tests
  • Ran the mcpinspector in a directory with no Crashlytics dependency with the --only flag and saw Crashlytics tools loaded
  • Ran the mcpinspector in a directory with no Crashlytics dependency without the --only flag and saw Crashlytics tools loaded
  • Ran the mcpinspector in a directory with no Crashlytics dependency with the --tools flag with crashlytics_create_note and saw that tool loaded
  • Ran Gemini CLI in a directory with no Crashlytics dependency with the --only flag and saw Crashlytics prompts and tools loaded
  • Ran Gemini CLI in a directory with a Crashlytics dependency and saw auto-detection still works

Sample Commands

gemini
npx @modelcontextprotocol/inspector firebase mcp --only crashlytics

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @schnecle, 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 Model Context Protocol (MCP) system by refining how feature and tool availability is determined, especially when users explicitly specify features or tools via command-line flags. The primary goal is to ensure that when --only or --tools are used, the system respects the user's intent by bypassing automatic availability checks that might otherwise prevent desired functionality from loading. This change improves the robustness and predictability of the MCP CLI for various project configurations.

Highlights

  • Bypass Availability Checks: The core change updates the behavior of the --only and --tools flags to bypass feature availability checks. This resolves an issue where features like Crashlytics were not loading correctly in projects with non-standard dependency management, even when explicitly requested.
  • Refactored Availability Logic: The isAvailable function for both prompts and tools has been refactored to defer the resolution of the availability check function until runtime. This allows for more flexible testing and mocking of availability checks.
  • Improved Feature Detection Flow: The FirebaseMcpServer now prioritizes activeFeatures and enabledTools when detecting project setup, preventing unnecessary detectActiveFeatures calls. The availableTools and availablePrompts functions now explicitly handle activeFeatures and detectedFeatures to ensure the correct set of items is returned based on user input or auto-detection.
  • Comprehensive Unit Tests: New and updated unit tests have been added for prompt, tool, availablePrompts, and availableTools to cover the new logic, including scenarios where availability checks are bypassed or fall back to detected features.

🧠 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.

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 updates the behavior of the --only and --tools flags to bypass availability checks, which is a great improvement for users with non-standard project structures. The changes are well-implemented across availableTools and availablePrompts, correctly prioritizing explicitly specified features over auto-detected ones and skipping the availability checks in those cases. I particularly appreciate the refactoring in prompt.ts and tool.ts to lazily resolve the availability check functions, which enhances testability. The accompanying unit tests are thorough, with new tests added to cover the new logic, ensuring the changes are robust. Overall, this is a high-quality contribution.

@schnecle schnecle marked this pull request as ready for review January 8, 2026 00:46
@schnecle schnecle force-pushed the schnecle/make-only-override branch from f5c9527 to 3b08248 Compare January 8, 2026 00:46
Copy link
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM! Can you also add a changelog entry like:

  • Fixes an issue where the --only flag was not always respected for firebase mcp

@schnecle schnecle force-pushed the schnecle/make-only-override branch from 3b08248 to 60c3833 Compare January 9, 2026 15:28
@schnecle schnecle enabled auto-merge (squash) January 9, 2026 15:48
@schnecle schnecle merged commit 19fd481 into main Jan 9, 2026
47 checks passed
@schnecle schnecle deleted the schnecle/make-only-override branch January 9, 2026 16:57
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