From 86fe2daf9e75684f3e5ba659492cee781cee1ede Mon Sep 17 00:00:00 2001 From: Steven Gates Date: Tue, 23 Jun 2026 15:11:56 -0500 Subject: [PATCH] fix(crashlytics-autotriage): pre-install Firebase CLI so the MCP server connects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MCP config ran `npx -y firebase-tools@latest mcp`, which cold-downloads the whole firebase-tools package at MCP-startup time — exceeding the SDK's connection window on a fresh runner, so the firebase server "failed to connect" and the crashlytics_* tools never loaded (issue #87, 3 runs). - Add a step to `npm install -g firebase-tools@latest` before the Claude step. - Point firebase-mcp.json at the pre-installed copy (drop `@latest` force-fetch) so the MCP `npx` resolves instantly instead of re-downloading. - Temporarily enable `show_full_output: true` so the MCP startup is visible if anything still fails (revert once green). --- .github/firebase-mcp.json | 4 ++-- .github/workflows/crashlytics-autotriage.yml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/firebase-mcp.json b/.github/firebase-mcp.json index 8859083..113cc18 100644 --- a/.github/firebase-mcp.json +++ b/.github/firebase-mcp.json @@ -1,9 +1,9 @@ { - "_comment": "Firebase MCP server config for the crashlytics-autotriage workflow. `--only crashlytics` activates the (experimental) Crashlytics tool group — it is NOT in the default tool set, so without it the crashlytics_* tools never surface. Requires Application Default Credentials (from google-github-actions/auth) on a service account with roles/firebasecrashlytics.viewer. See docs/PRD-crashlytics-autotriage.md.", + "_comment": "Firebase MCP server config for the crashlytics-autotriage workflow. `--only crashlytics` activates the (experimental) Crashlytics tool group — it is NOT in the default tool set. Uses the firebase-tools pre-installed by the workflow step (no `@latest`, so npx resolves the cached global copy instantly instead of cold-downloading at MCP startup). Requires ADC (from google-github-actions/auth) on a service account with roles/firebasecrashlytics.viewer. See docs/PRD-crashlytics-autotriage.md.", "mcpServers": { "firebase": { "command": "npx", - "args": ["-y", "firebase-tools@latest", "mcp", "--dir", ".", "--project", "openloop-8c266", "--only", "crashlytics"] + "args": ["-y", "firebase-tools", "mcp", "--dir", ".", "--project", "openloop-8c266", "--only", "crashlytics"] } } } diff --git a/.github/workflows/crashlytics-autotriage.yml b/.github/workflows/crashlytics-autotriage.yml index 480f451..a4472a0 100644 --- a/.github/workflows/crashlytics-autotriage.yml +++ b/.github/workflows/crashlytics-autotriage.yml @@ -61,10 +61,20 @@ jobs: with: credentials_json: ${{ secrets.GCP_SA_KEY }} + # Install the Firebase CLI up front so the MCP server (npx firebase-tools mcp) + # starts instantly. Otherwise it cold-downloads the whole package at MCP-startup + # time and exceeds the SDK's connection window — the server then "fails to connect" + # and the crashlytics_* tools never load. + - name: Pre-install Firebase CLI + run: npm install -g firebase-tools@latest + - name: Triage the crash with Claude uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + # Temporary: surfaces the MCP server startup logs so we can diagnose connection + # issues. Remove once the Firebase MCP server connects reliably. + show_full_output: "true" prompt: | You are triaging an automated Crashlytics crash report filed as GitHub issue #${{ github.event.issue.number || github.event.inputs.issue_number }} in stozo04/OpenLoop.