Skip to content

CLI

Fetch live pages from your terminal or your agent's shell: one command, the same API, no code.

Install

Run it without installing
npx @fetchmcp-net/cli login                               # paste your API key (not echoed)
npx @fetchmcp-net/cli fetch https://example.com -o text   # the page as Markdown
Install it
npm install -g @fetchmcp-net/cli
fetchmcp --help

Node.js 18 or later, no other dependencies. Open source (MIT): https://github.com/fetchmcp-net/cli on GitHub, @fetchmcp-net/cli on npm.

Fetch pages

fetch
fetchmcp fetch https://example.com/a https://example.com/b      # up to 10 URLs; JSON with results[] and statuses[]
fetchmcp fetch https://example.com -o text                      # just the content (Markdown, else text, else HTML)
fetchmcp fetch https://example.com -o html --html               # the page HTML
fetchmcp fetch https://example.com --country-code de --render   # from Germany, rendered in a real browser
fetchmcp fetch --data @request.json                             # the whole request body from a file (- for stdin)
fetchmcp account                                                # plan, credits and rate limit
fetchmcp fetch --help                                           # every option, with the API's own descriptions

A fetch is the same request as POST https://fetchmcp.net/api/v1/contents (API reference), charged the same way. One that is still running after about 100 seconds is collected automatically with the same Idempotency-Key, so it is charged once.

API key

fetchmcp login saves the key in ~/.config/fetchmcp/config.json (mode 0600). In CI or an agent's environment, set FETCHMCP_API_KEY or pass --api-key instead. The key is only ever sent to the API base URL (https://fetchmcp.net/api, or --base-url).

Always current

The commands and options come from the API's OpenAPI document, which the CLI downloads again after an hour. When the API gains a field or an endpoint, the option is there on your next run, without updating the CLI. Offline, it uses the last copy it downloaded, then the copy bundled with the package (fetchmcp spec shows which). New versions are published to npm automatically whenever the API changes.

Output and exit codes

OptionPrints
-o json (default)The API's JSON response
-o textThe content of each page: Markdown, else text, else HTML
-o <field>One field of each result, e.g. -o title
Exit codeMeaning
0OK
1The API answered with an error (JSON on stderr, with its requestId), or every URL failed with -o text
2Usage: unknown command or option, or a value the API does not accept
3Network: no answer. The error carries the Idempotency-Key to collect the result without a new charge