---
name: chab
description: Use Chab for web search, SEO and business data, scraping, screenshots, conversion, translation, LLM calls and research through the hosted MCP server or the Chab CLI, including guest access, signup and credits.
---

# Chab

Use this skill when a task needs Chab: web search, SEO and business data,
scraping, screenshots, file conversion, translation, LLM calls or research.
Chab works through its hosted MCP server or the `chab` command line tool.

## Connect

Prefer the hosted MCP server at `https://www.chab.ai/mcp` when the agent host
supports remote MCP. It needs no install and no key. Ask the person before
adding it; they then approve Chab's consent screen in the browser.

- Claude Code: `claude mcp add --transport http --scope user chab https://www.chab.ai/mcp`, then sign in with `/mcp`.
- Codex: `codex mcp add chab --url https://www.chab.ai/mcp`, then `codex mcp login chab`.
- Pi: `pi mcp add chab --url https://www.chab.ai/mcp`, then `pi mcp login chab` (or `/mcp`, then Sign in).

Use the CLI for shells, scripts and CI, or when the host has no remote MCP.
It also runs a local MCP server (see Local MCP below).

## Accounts and credits

The person can start without an account:

- Hosted MCP: approve the guest option on the consent screen.
- CLI: create a guest key on https://www.chab.ai, then run `chab setup` in
  their own terminal and paste the key there, never into chat.

Free credits are limited. When they run out, or an error says signup is
required:

1. Ask the person which email address to use. Never guess it or take it from
   elsewhere.
2. Start signup with that address: the hosted MCP tool `chab_sign_up`, or
   `POST https://www.chab.ai/v1/signup` with JSON `{"email": "..."}` and the
   guest key as bearer token. From the CLI,
   `chab api post /signup --field email=<address>` sends this with the stored
   guest key, so the key never appears in chat.
3. Ask the person to open the link Chab emails them and finish signing up.
4. Reconnect: for the CLI, sign in as described under Sign in below, with
   `--yes` to replace the stored guest key; for hosted MCP, reconnect and
   sign in again.

When an account runs out of credits, errors include `upgrade_url`. Give that
link to the person so they can buy credits or a plan. Do not retry around
credit, pause, expiry or signup errors.

## Install the CLI

Ask the person before installing software or changing their environment.

- macOS and Linux: `curl -fsSL https://www.chab.ai/install.sh | sh`
- Windows (PowerShell): `irm https://www.chab.ai/install.ps1 | iex`

The installers check the download against its SHA-256 checksum. On macOS and
Linux `chab` goes to `~/.local/bin`; on Windows to
`%LOCALAPPDATA%\Programs\chab`. Add that folder to PATH if the installer says
so. For a manual download, the file list with checksums for every platform is
at https://www.chab.ai/downloads/cli/manifest.json.

This `SKILL.md` is the whole skill; the latest copy is at
https://www.chab.ai/skills/chab/SKILL.md. Ask before copying it into another
agent host's skill folder.

## Sign in

Agents usually run commands in a non-terminal shell, where plain `chab login`
falls back to pasting a key. Run `chab login --web --no-prompt` instead, in a
way that lets you read its output while it keeps running (for example in the
background). It prints a Verification URL and a User code, then waits until
the person approves or the code expires. Give the person the link and the
code, ask them to approve in the browser, and wait for the command to finish.
If a key is already stored, such as a guest key after signup, add `--yes` to
replace it. A person in their own terminal can simply run `chab login`.

## Work safely with the CLI

Start with read-only checks:

- `chab version` and `chab --help`
- `chab auth env`: the resolved profile, app and API URLs. Local only; never
  prints a key or contacts the network.
- `chab whoami`: the active account or guest, scopes and project access.
- `chab doctor`: combined local and API readiness.
- `chab credits balance`: for a guest, read `free_credits.available`;
  `spendable_balance` is the paid balance and is zero for guests.

A fresh profile uses `https://www.chab.ai` (`/v1` for the API); saved custom
destinations stay unchanged.

Prefer `--json` for automation, `--jq` for small projections, `--template` for
stable text and `--plain` for copy-safe tables, on commands that support them.

Before paid work, check `chab credits balance`, use
`chab operations estimate <operation-key> --input @request.json` where
estimates exist, and prefer `--dry-run` first. Pass `--yes` only when the
person already made a destructive or billable intent clear.

Tool commands wait for the result and print it, so one command gives the
answer (with `--json`, the result is under `result`). For example:

```sh
chab search web --query "best espresso machines 2026" --engine google --location '{"country":"US"}' --language en-US --yes --json
```

They wait up to 90 seconds. Longer work, such as a research report, keeps
running: the output then shows `"state": "running"`, and you get the result
later with `chab operations wait <operation-id>` and then
`chab operations result <operation-id>`. Pass `--wait` to wait up to 10
minutes, or `--wait=false` to return right away.

Tools without their own command, such as `search.news`, `seo.domains.competitors`
or `business.reviews`, run with `chab operations start <operation-key> --input
'{...}' --yes --json`. `chab operations schema <operation-key>` shows a tool's
input fields.

Operation starts and uploads keep a private local action record with one
idempotency key. If a submit is interrupted, inspect
`chab operations actions list` and `chab operations actions show <action-id>`,
then recover with `chab operations resume <action-id> --input @request.json`
or the matching file resume command. Do not start a second action while a
recoverable one exists. A `prepared` receipt with no stored response cannot be
resumed: explain the uncertainty and ask before starting fresh.

Downloads need an explicit output path (`--output` or its short flag) and never
overwrite files. Use `chab api get` for read-only access to other public API
paths; use unsafe raw API methods only for the specific operation the person
asked for.

`chab login` requests the scopes for Chab's tools by default: credits,
projects read, search, SEO, business data, scraping, screenshots, conversion,
files, contacts, translation, LLMs and research. `--scope` replaces that list;
mail, Drive, project changes, usage and billing need it. Spending and project
access start at `none`; the person approves only what the task needs.
`api:billing:write`, `api:tokens:write` and `api:webhooks:write` need a
separately created API key.

## Local MCP

Configure hosts with the command, never with credentials:

```sh
codex mcp add chab -- chab mcp serve
claude mcp add --transport stdio chab -- chab mcp serve
```

For a non-default profile, put CLI flags first: `chab --profile staging mcp serve`.

The local server uses stdio and resolves auth, config and profile at each tool
call. Startup, `tools/list`, `chab_auth_env`, `chab_health` and `chab_errors`
need no credential. Operation tools need a stored login from `chab login` or
`chab setup`, or `CHAB_API_KEY` inherited by the server process. Login, logout,
config and profile changes apply to later calls. Changing `CHAB_API_KEY` in the host environment requires restarting or relaunching the MCP server process.

Tools are named from public operation IDs, such as `chab_credits_get`,
`chab_search_web`, `chab_files_create` and `chab_files_download`. Inputs are
grouped as `path`, `query`, `body` and `local`. Set `local.confirmation=true`
only when the schema requires it and the person confirmed the billable,
destructive, upload or send effect. Use `local.input_path` for uploads and
`local.output_path` for downloads. Recover submissions with
`chab_action_list`, `chab_action_show` and `chab_action_resume`. Protected
token changes take approval proof from `local.approval_proof_path`; never paste
proof text into chat. Guest credentials only see the free tools the server
offers; do not try management, connected-account or billing tools as a guest.

On a hosted connection, `chab_operation_artifact` returns small results inline
(`content: "inline"`) or a short-lived download link (`content: "link"`); do
not post or log that link. For the person's own document,
`chab_file_upload_link` opens a one-time browser upload; pass the resulting
`file_id` to `convert.file`. Chat attachments are not uploaded to Chab
automatically. Do not upload unrelated or confidential files without approval.

## Safety

Never ask the person to paste, print or save API keys, guest keys, device
codes, tokens, auth files or secret values in chat, docs, logs or skill files.
They run `chab login` or `chab setup`, or set `CHAB_API_KEY`, in their own
shell or secret store.

Ask the person before changing host MCP configuration, and never put keys or
tokens into it.
