Skip to content

[MCP] Startup billing check uses default project and fails init when credentials target another project #9983

@Ortes

Description

@Ortes

[REQUIRED] Environment info

firebase-tools:

15.1.0

Platform:

macOS

[REQUIRED] Test case

Run Firebase MCP with credentials that belong to Project B, while the local default Firebase CLI context points to Project A.

GOOGLE_APPLICATION_CREDENTIALS=/path/to/project-b-service-account.json \
firebase mcp --dir /path/to/repo --only auth,firestore

In my case, MCP initialization checks billing during startup and uses the default/local project context instead of the project associated with provided credentials.

[REQUIRED] Steps to reproduce

  1. Have a local Firebase CLI context/default project set to Project A.
  2. Use a service account in GOOGLE_APPLICATION_CREDENTIALS for Project B.
  3. Start MCP:
    GOOGLE_APPLICATION_CREDENTIALS=/path/to/project-b-service-account.json \
    firebase mcp --dir /path/to/repo --only auth,firestore
  4. Connect from MCP client (which triggers MCP init / tools listing).
  5. Observe that startup performs billing validation against Project A (default context), not Project B from credentials, and initialization fails.

[REQUIRED] Expected behavior

  • MCP startup should resolve project context from explicitly provided credentials, or
  • MCP should support an explicit project override flag for startup checks (for example --project behavior guaranteed for init/billing checks), or
  • MCP should defer billing checks until a project-scoped tool call is executed.

[REQUIRED] Actual behavior

MCP initialization fails because billing is checked at init time against the default/local project context rather than the project tied to the provided credentials.

Additional context

There is a related issue about credential precedence (#9870), but this report is specifically about MCP startup-time billing checks using the wrong project context and preventing the MCP server from initializing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: mcpFirebase MCP Server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions