Skip to content

[MCP] Firebase MCP server hangs/crashes during tools/list initialization with large datasets #9663

@stevexusc

Description

@stevexusc

[MCP] Firebase MCP server hangs/crashes during tools/list initialization with large datasets

Description

The Firebase MCP server (firebase-tools@latest mcp) hangs, times out, or crashes with out-of-memory errors when Claude Code (or other MCP clients) attempts to list available tools via the tools/list MCP method. This issue occurs specifically when the Firebase project contains a large volume of Crashlytics data, making the MCP integration completely unusable for production applications.

This happens with BOTH configurations:

  • With --only crashlytics flag
  • Without any --only flag (loading all features)

Environment

  • firebase-tools version: latest (tested with automatic updates via npx -y)
  • MCP client: Claude Code v2.0.73
  • Node.js version: v20.18.1
  • OS: macOS (Darwin 25.2.0)
  • Firebase project: Large production Android app with extensive Crashlytics history
  • MCP server configs tested:
    1. npx -y firebase-tools@latest mcp --only crashlytics
    2. npx -y firebase-tools@latest mcp --dir /path/to/project (no --only flag)

Steps to Reproduce

  1. Set up a Firebase project with significant Crashlytics data

    • Production Android app
    • Multiple app variants
    • Months/years of crash data
    • Example: SafetyCulture Android app (1:140348146905:android:0d46d219d040c070)
  2. Configure Firebase MCP server in Claude Code

    Config A (with --only flag):

    {
      "mcpServers": {
        "firebase": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp", "--only", "crashlytics"]
        }
      }
    }

    Config B (without --only flag, per documentation):

    {
      "mcpServers": {
        "firebase": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "firebase-tools@latest", "mcp", "--dir", "/path/to/project"]
        }
      }
    }
  3. Authenticate with Firebase

    firebase login
  4. Start Claude Code session

    claude
  5. MCP server attempts to initialize and list tools

Expected Behavior

The MCP server should:

  • Successfully initialize
  • Return a list of available Crashlytics tools via tools/list
  • Return available prompts via prompts/list (including crashlytics:connect)
  • Load data on-demand when tools are invoked, not during initialization
  • Work efficiently regardless of Crashlytics data volume
  • Expose prompts as slash commands (e.g., /firebase:init, /crashlytics:connect) per the documentation

Actual Behavior

The MCP server:

  • ✅ Connects successfully (shows as "Connected" in claude mcp list)
  • ✅ Responds to initialize MCP method
  • Hangs indefinitely when responding to tools/list method
  • Hangs indefinitely when responding to prompts/list method
  • ❌ Eventually crashes with JavaScript heap out of memory error
  • ❌ Never exposes tools to the MCP client
  • ❌ Never exposes prompts/slash commands to the MCP client
  • ❌ Makes the entire Crashlytics MCP integration unusable

Error Output

<--- Last few GCs --->

[80943:0xa01800000]    56973 ms: Mark-Compact 4041.1 (4139.3) -> 4027.6 (4141.6) MB, 921.42 / 0.00 ms  (average mu = 0.141, current mu = 0.020) allocation failure; scavenge might not succeed
[80943:0xa01800000]    58673 ms: Mark-Compact 4043.8 (4141.8) -> 4030.4 (4144.6) MB, 1682.29 / 0.00 ms  (average mu = 0.061, current mu = 0.010) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Technical Analysis

What's Happening

The Firebase MCP server appears to be eagerly loading all Crashlytics data from the Firebase project when the MCP client requests the list of available tools or prompts, rather than:

  1. Returning tool/prompt metadata immediately
  2. Loading data on-demand when tools are actually invoked

Test Results

MCP Initialization (✅ Works):

$ echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | npx -y firebase-tools@latest mcp

{"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"logging":{},"prompts":{"listChanged":true},"resources":{}},"serverInfo":{"name":"firebase","version":"0.3.0"}},"jsonrpc":"2.0","id":1}

Tools List (❌ Hangs/Crashes):

$ echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | npx -y firebase-tools@latest mcp

# Hangs for 30-60 seconds, then:
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Prompts List (❌ Hangs/Crashes):

$ echo '{"jsonrpc":"2.0","id":3,"method":"prompts/list"}' | npx -y firebase-tools@latest mcp

# Hangs for 30-60 seconds, then crashes or times out

Workarounds Attempted (all failed):

  • ❌ Increased Node memory: NODE_OPTIONS="--max-old-space-size=2048" - still crashes
  • ❌ Used --only crashlytics flag per documentation - still crashes
  • ❌ Removed --only flag and used default config - still crashes
  • ❌ Added --dir parameter per documentation - still crashes
  • ❌ Tried plugin version vs manual config - same issue

Documentation vs Reality

According to the official Firebase MCP documentation, the server should:

  1. Provide crashlytics:connect as a prompt (slash command)
  2. Provide 11 Crashlytics tools for LLM use
  3. Support optional --only parameter to limit features

However, in practice with production data:

  • ❌ Prompts are never exposed (can't run /crashlytics:connect)
  • ❌ Tools are never exposed (can't be called by LLMs)
  • --only flag doesn't prevent data loading issues

Impact

This issue makes the Firebase Crashlytics MCP integration completely unusable for:

  • Production applications with real crash data
  • Any Firebase project with more than minimal Crashlytics history
  • Teams wanting to use AI-powered debugging features advertised in Firebase documentation

The feature only works for:

  • Empty/test projects with minimal data
  • New projects without historical crash data

Expected Fix

The Firebase MCP server should use lazy loading for Crashlytics data:

  1. During tools/list: Return tool metadata only (names, descriptions, parameters) - no data fetching
  2. During prompts/list: Return prompt metadata only - no data fetching
  3. During tool invocation: Fetch actual Crashlytics data from Firebase APIs (with pagination)
  4. Add pagination: Support incremental data loading with limits
  5. Add filtering: Allow clients to specify date ranges, app versions, etc. before loading data

Related Issues

Additional Context

The official Firebase documentation promotes the Crashlytics MCP integration as production-ready:

The documentation specifically mentions:

"The Firebase MCP server works with any tool that can act as an MCP client, including: Antigravity, Gemini CLI and Gemini Code Assist, Firebase Studio, Claude Code and Claude Desktop, Cline, Cursor, VS Code Copilot, Windsurf, and more!"

However, the implementation has fundamental scalability issues that prevent real-world usage with production Crashlytics data.

Reproduction Project

If the Firebase team needs a specific project to reproduce, I can provide:

  • Project ID: project-8638960581077738091
  • App ID: 1:140348146905:android:0d46d219d040c070
  • Or set up a test project with synthetic data to demonstrate the issue

Would you like me to provide any additional information or help test a fix?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions