Skip to content

[mcp] resolve project root before feature detection#10213

Merged
joehan merged 3 commits intofirebase:mainfrom
lukemmtt:codex/mcp-crashlytics-root-detection
Apr 6, 2026
Merged

[mcp] resolve project root before feature detection#10213
joehan merged 3 commits intofirebase:mainfrom
lukemmtt:codex/mcp-crashlytics-root-detection

Conversation

@lukemmtt
Copy link
Copy Markdown
Contributor

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 cachedProjectDir was initialized, which prevented Crashlytics from being detected.

Tests:

  • npm run test:compile
  • npx -y node@20 --loader ts-node/esm ./node_modules/mocha/bin/mocha src/mcp/index.spec.ts

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.
Copy link
Copy Markdown
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 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 joehan merged commit db0795e into firebase:main Apr 6, 2026
1 check passed
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.

[MCP] Crashlytics auto-detection can fail in Flutter projects and hide Crashlytics tools

3 participants