-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
[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 crashlyticsflag - Without any
--onlyflag (loading all features)
Environment
- firebase-tools version:
latest(tested with automatic updates vianpx -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:
npx -y firebase-tools@latest mcp --only crashlyticsnpx -y firebase-tools@latest mcp --dir /path/to/project(no --only flag)
Steps to Reproduce
-
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)
-
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"] } } } -
Authenticate with Firebase
firebase login
-
Start Claude Code session
claude
-
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(includingcrashlytics: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
initializeMCP method - ❌ Hangs indefinitely when responding to
tools/listmethod - ❌ Hangs indefinitely when responding to
prompts/listmethod - ❌ Eventually crashes with
JavaScript heap out of memoryerror - ❌ 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:
- Returning tool/prompt metadata immediately
- 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 memoryPrompts 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 outWorkarounds Attempted (all failed):
- ❌ Increased Node memory:
NODE_OPTIONS="--max-old-space-size=2048"- still crashes - ❌ Used
--only crashlyticsflag per documentation - still crashes - ❌ Removed
--onlyflag and used default config - still crashes - ❌ Added
--dirparameter 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:
- Provide
crashlytics:connectas a prompt (slash command) - Provide 11 Crashlytics tools for LLM use
- Support optional
--onlyparameter 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)
- ❌
--onlyflag 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:
- During
tools/list: Return tool metadata only (names, descriptions, parameters) - no data fetching - During
prompts/list: Return prompt metadata only - no data fetching - During tool invocation: Fetch actual Crashlytics data from Firebase APIs (with pagination)
- Add pagination: Support incremental data loading with limits
- Add filtering: Allow clients to specify date ranges, app versions, etc. before loading data
Related Issues
- #9495 - MCP: Fewer tools for iOS projects - mentions 300s timeout
- #8940 - crashlytics_list_top_issues does not work
- #8696 - Top Crashes returns non-fatal errors
Additional Context
The official Firebase documentation promotes the Crashlytics MCP integration as production-ready:
- https://firebase.google.com/docs/crashlytics/ai-assistance-mcp
- https://firebase.google.com/docs/mcp
- https://firebase.blog/posts/2025/11/crashlytics-mcp-with-gemini-cli
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?