# ketch-cli [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/1broseidon/ketch  
**GitHub Stars:** 774  
**npm Downloads (last month):** 2558  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ketch-cli

## Description
Fast, stateless CLI for web search, OSS code search, library docs, scraping, and crawling — with an MCP server for agents.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "ketch-cli": {
    "command": "npx",
    "args": ["-y","ketch-cli"],
    "env": {
      "KETCH_SEARCH_ORDER": ""
    }
  }
}
```

**Requires environment variables:** `KETCH_SEARCH_ORDER` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What ketch-cli MCP server does

ketch-cli combines several research and extraction workflows behind a single command-line binary that can also serve AI agents through MCP. Its capabilities cover web search, searches across public open-source code, documentation questions, HTML extraction, web scraping, and crawling. The tool is stateless: each invocation performs its operation without requiring a long-running daemon or API server.

Web search can use a keyless provider chain, configured commercial providers, or a self-hosted SearXNG or Degoog endpoint. Code search queries public repository source through Grep, Sourcegraph, or GitHub Code Search. Documentation queries search the web and read relevant pages, or use an indexed documentation site for offline answers. Scraping and extraction convert HTML pages and text-based PDFs into cleaner Markdown.

## How it works

The `auto` search mode chooses from usable backends in a configured order. Locally configured endpoints and providers with credentials are preferred before keyless hosted providers. A specific backend can be selected for an invocation, while `--multi` queries several backends and combines their rankings with Reciprocal Rank Fusion. `--random` selects one backend and falls back to others if it fails.

Each command supports `--json`, allowing agents to consume predictable structured results. Search results can optionally be scraped to retrieve full page content. Documentation lookup reads the highest-ranked readable result and may read additional pages from the same site; it reports the pages used, skipped content, and sections omitted from the answer.

For extraction, ketch-cli uses page structure such as `main`, `article`, or uniform document sections, removes common navigation and interface elements, and falls back to readability processing. The `extract_mode` setting controls whether additional blocks such as related-post sections and comment threads are removed.

## Setup and configuration

Install the binary through the macOS and Linux install script, Homebrew, npm, Go, or a prebuilt release for Linux, macOS, or Windows on amd64 and arm64. The install script verifies the downloaded build against its checksums and places it in a writable system or user binary directory.

Configure a preferred backend with commands such as `ketch config set backend searxng`. Provider credentials can be stored with `ketch config set`, and `ketch config` exposes which backends are active. `KETCH_SEARCH_ORDER` can override the configured search order for an individual run. Documentation sites can be indexed with `ketch docs index` and then queried offline.

An external PDF-to-Markdown command is supported through configuration. Its command must include one `{input}` placeholder, and its output is limited to 10 MiB.

## Tools and capabilities

- Search the web with keyless or credentialed providers.
- Search public open-source code by query and language.
- Query web or indexed library documentation.
- Scrape pages and convert supported PDFs to Markdown.
- Crawl content and extract HTML supplied through a pipe.
- Return JSON suitable for agent workflows.
- Federate search results and deduplicate them by URL.

## Limitations and notes

Keyless search depends on the available hosted providers, while provider-specific limits and behavior vary by backend. Documentation lookup follows search ranking, so the first readable result may not be the official documentation; the `--library` option helps identify the intended documentation set.

The built-in PDF parser handles text PDFs. Scanned or image-only PDFs require OCR and produce a precondition error unless an external converter is configured. PDF output is always text-based Markdown; raw binary output and element selection are rejected for PDFs. Browser PDF viewing is not used when `--force-browser` is enabled.

The CLI is intended to avoid provider-specific glue in agent workflows, but credentials are only needed for providers that require them; web search and several documentation paths work without an API key.

_Full upstream README: https://allmcps.com/mcp/ketch-cli/readme_

