Skip to content

CLI metadata flags require FIRECRAWL_API_KEY instead of printing help/version #256

Description

@None-Feeling

Summary

The published firecrawl-mcp@3.20.2 CLI validates Firecrawl configuration before handling top-level metadata flags. With FIRECRAWL_API_KEY and FIRECRAWL_API_URL unset, firecrawl-mcp --help, firecrawl-mcp --version, and an unknown flag all fail with the same runtime configuration error.

This makes it impossible to inspect usage or the installed package version without already having Firecrawl credentials configured.

Reproduction

On Windows PowerShell:

mkdir firecrawl-mcp-cli-flag-repro
cd firecrawl-mcp-cli-flag-repro
npm init -y
npm install --ignore-scripts --no-audit --no-fund firecrawl-mcp@3.20.2

cmd /c ".\node_modules\.bin\firecrawl-mcp.cmd --help"
cmd /c ".\node_modules\.bin\firecrawl-mcp.cmd --version"
cmd /c ".\node_modules\.bin\firecrawl-mcp.cmd --definitely-not-a-real-flag"

Actual behavior

Each command exits with status 1 and prints:

Either FIRECRAWL_API_KEY or FIRECRAWL_API_URL must be provided

Observed locally:

--help                         exit 1
--version                      exit 1
--definitely-not-a-real-flag   exit 1

Expected behavior

  • firecrawl-mcp --help and -h should exit 0 and print usage without requiring Firecrawl credentials.
  • firecrawl-mcp --version and -v should exit 0 and print the installed package version without requiring Firecrawl credentials.
  • Unknown top-level flags should fail with a concise CLI usage/unknown-option error before server startup validation.
  • firecrawl-mcp with no metadata flag should keep the existing credential validation behavior.

Likely source area

The package exposes this bin:

"bin": {
  "firecrawl-mcp": "dist/index.js"
}

In the published package, dist/index.js constructs the FastMCP server and runs await server.start(args) directly. The credential validation happens in the authenticate callback before any top-level CLI metadata handling, notably around the FIRECRAWL_API_KEY / FIRECRAWL_API_URL check.

A small fix would be to handle process.argv metadata flags before server startup/authentication, or add a thin CLI parser at the entrypoint that exits for help/version/unknown options before starting the MCP server.

Environment

  • OS: Microsoft Windows 11 Home Chinese edition
  • Node.js: v24.13.0
  • npm: 11.6.2
  • Package: firecrawl-mcp@3.20.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions