[mcp] resolve project root before feature detection#10213
Merged
joehan merged 3 commits intofirebase:mainfrom Apr 6, 2026
Merged
[mcp] resolve project root before feature detection#10213joehan merged 3 commits intofirebase:mainfrom
joehan merged 3 commits intofirebase:mainfrom
Conversation
Resolve the project root inside detectActiveFeatures so auto-detection does not build MCP context before cachedProjectDir is available. Adds a regression test covering a Flutter project with firebase_crashlytics and firebase_options.dart. Refs firebase#10211.
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that detectProjectRoot is called within the detectActiveFeatures method of the FirebaseMcpServer class, guaranteeing the project environment is identified before feature detection. A new unit test has been added to src/mcp/index.spec.ts to verify this behavior by mocking a Flutter project structure and confirming the detection of Crashlytics. I have no feedback to provide.
joehan
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10211.
Resolve the project root before feature detection builds MCP context so auto-detection can safely inspect project files.
Adds a regression test for a Flutter project that uses Crashlytics. Before this change, feature detection could run before
cachedProjectDirwas initialized, which prevented Crashlytics from being detected.Tests:
npm run test:compilenpx -y node@20 --loader ts-node/esm ./node_modules/mocha/bin/mocha src/mcp/index.spec.ts