firecrawl / firecrawl/firecrawl-mcp-server

CLI metadata flags require FIRECRAWL_API_KEY instead of printing help/version

Open Beginner friendly
#256 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.5k
Forks
884
Avg merge
1d 11h
Merged PRs (30d)
14

Description

## 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:

```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:

```text
Either FIRECRAWL_API_KEY or FIRECRAWL_API_URL must be provided
```

Observed locally:

```text
--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:

```json
"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`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the package bin entrypoint, dist/index.js, and inspect how process.argv reaches server.start(args) before the authenticate callback checks FIRECRAWL_API_KEY and FIRECRAWL_API_URL. Run the listed npm installation and Windows commands without credentials. Done means help and version exit 0, unknown top-level flags report a concise CLI error before startup, and no-flag invocation retains credential validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.