Skip to main content
Glama
README.md
# Webdig

Webdig is a local research CLI and Model Context Protocol (MCP) server. It searches public sources, reads pages and PDFs, and saves evidence with source links and passage locations. Research runs record which providers answered, which pages could be read, and where coverage fell short. The basic tools work without a model or a search API key.

## Install and try it

Use Python 3.11 or later. CI runs on Linux. On Windows, use WSL. From the source directory, create a virtual environment and install Webdig.

```sh
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
webdig open https://www.sqlite.org/wal.html
webdig search "SQLite WAL checkpointing" --engines mwmbl -n 5
```

To install directly from GitHub after publication, use `python -m pip install 'git+https://github.com/OWNER/REPOSITORY.git'` inside your virtual environment and substitute the repository path.

`open` returns a document ID, passages and locations. Use `webdig read DOCUMENT_ID` to read more. Search results are leads. Open a source before relying on its claims.

For broader research, start a quick run and use its run ID to retrieve the saved report.

```sh
webdig dig "Compare approaches to SQLite backup" --mode quick --no-phone --no-judge
webdig brief RUN_ID
```

For browser rendering and PDF tables, install the optional dependencies and the Playwright browser. For scanned PDFs, install Tesseract on your system. Webdig includes English OCR data.

```sh
python -m pip install '.[browser,tables]'
python -m playwright install chromium
webdig doctor
```

## Connect an MCP client

Configure a local stdio server. Point `command` to the `webdig` executable in your virtual environment. This example uses the eight-tool `core` profile. Run `webdig mcp` without profile arguments to expose the full catalog.

```json
{
  "mcpServers": {
    "webdig": {
      "command": "/absolute/path/to/.venv/bin/webdig",
      "args": ["mcp", "--profile", "core"]
    }
  }
}
```

Search, reading and evidence collection run on the machine that starts Webdig. You can install the CLI or connect it to an MCP client on each machine you use. Research data stays in that Webdig instance's data directory.

## Configure Webdig

`local.toml` is a portable example. Set `WEBDIG_CONFIG` to a TOML file to use it. By default, Webdig looks for `config.toml` in `~/.webdig`. Set `WEBDIG_HOME` to keep runs and cached documents in a different directory.

Standalone model features such as `drive` are optional. Set `[model].kind = "openai_compat"`, `[model].base_url` to your local server's loopback endpoint, and `[model].model` to the model name it serves. Alternatively, use `[model].kind = "command"` and set `[model].command` to a local program. Check the configuration with `webdig doctor`.

## Experimental providers

- **Public X posts.** `webdig x-search "SQLite WAL"` discovers indexed links and reads available text from public embeds. Coverage depends on search indexes and the embed service. Long posts can be partial. Set `[x].read_posts = false` to turn off embed retrieval.
- **USB Android.** Phone search requires ADB and `[android].enabled = true`. Google app searches can appear in the phone account's history. `webdig x-open "SQLite WAL"` opens one native X search for the user to browse. App updates and verification prompts can interrupt these routes.

Queries and page requests go to the providers used for a run. Fetched text can contain untrusted instructions. Treat it as source material and review the links before citing them.

## Development

```sh
python -m pip install '.[browser,tables,dev]'
python -m playwright install chromium
python -m pytest -q
```

## License

Webdig source is released under the [MIT License](LICENSE). Bundled OCR data is covered by the [third-party notices](THIRD_PARTY_NOTICES.md).