Repository avatar
AI Tools
v0.4.3
active

botglass

io.github.rudibrdev/botglass

See a page as AI crawlers do: per-bot status, words actually received, robots rules and the fix.

Documentation

botglass

See your site exactly as AI crawlers see it.

AI crawlers fetch your HTML and never run JavaScript. A React, Next.js or Vue page can look finished to you and near-empty to GPTBot, ClaudeBot and PerplexityBot. botglass fetches the same URL as a normal browser and as eight crawlers, compares the text each one actually receives, checks robots.txt per bot, and prints one verdict per crawler.

No account, no API key, no dashboard, no telemetry. One command, plain HTTP.

It also reads Content-Usage training preferences in robots.txt, separately from crawl permission. HTTP response-header preferences are not measured; see the scope below.

Install

The package is not on npm yet, so npx botglass and npm install -g botglass fail today. Until it is published, run the reviewed v0.4.3 tag from GitHub — Git and Node 20+ required; npm fetches the source, installs build dependencies and compiles TypeScript:

npx -y github:yardworkdev/botglass#v0.4.3 https://example.com

The examples below use that same command, so they work as written.

MCP clients that support MCP Bundles: the same server also ships as botglass-0.4.3.mcpb (release asset) and is listed in the official MCP registry as io.github.rudibrdev/botglass (search). It bundles the compiled server, so there is no npm or TypeScript step — only Node 20+ at runtime.

Hand it to your agent

Two ways. As a shell command your agent runs:

Check whether AI crawlers can read our site. Run:

  npx -y github:yardworkdev/botglass#v0.4.3 <URL> --render --compact

Summarise the verdicts in two sentences and list the fixes it gives.
After we deploy a fix, run the same command again with --baseline .botglass.json
and tell me exactly what changed since the previous run.

Or as an MCP server, so the agent calls it as a tool. Add this to your MCP config (Claude Code: claude mcp add botglass -- npx -y github:yardworkdev/botglass#v0.4.3 mcp; Cursor and others: the same command in .cursor/mcp.json / mcp.json):

{
  "mcpServers": {
    "botglass": {
      "command": "npx",
      "args": ["-y", "github:yardworkdev/botglass#v0.4.3", "mcp"]
    }
  }
}

It exposes two tools: audit_url (one page) and audit_sitemap (up to 50 pages), both returning the compact verdicts and fixes. Stdio only; nothing listens on a port.

--compact keeps the answer small enough to read in context; --baseline turns the second run into proof that the fix worked.

Quick start

npx -y github:yardworkdev/botglass#v0.4.3 https://example.com

Requires Node 20 or newer, plus Git for this install form. For a reusable command without the npx wrapper, keep a clone:

git clone https://github.com/yardworkdev/botglass
cd botglass
npm install
npm test          # builds, then runs the whole suite
node dist/src/cli.js https://example.com

Wherever the rest of this page says botglass, read npx -y github:yardworkdev/botglass#v0.4.3 (or node dist/src/cli.js in a clone) until the npm package exists.

What it prints

Real output, from botglass https://excalidraw.com https://nextjs.org --render (the nextjs.org rows are trimmed):

botglass 0.3.0  2 page(s), 8 bots, render on

https://excalidraw.com/
  HTTP 200, 3 words in raw HTML, 80 words rendered
  bot                status  words  verdict         note
  GPTBot             200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  OAI-SearchBot      200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  ChatGPT-User       200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  ClaudeBot          200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  PerplexityBot      200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  CCBot              200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  Googlebot          200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)
  meta-externalagent 200     3      js-dependent    raw HTML carries 3 of the 80 words a browser renders (96% missing)

https://nextjs.org/
  HTTP 200, 653 words in raw HTML, 619 words rendered
  GPTBot             200     653    ok              server-rendered content, bot allowed
  ClaudeBot          200     653    ok              server-rendered content, bot allowed
  ...

The exit code stays 0 until you ask for a gate with --fail-on or --max-js-only.

Verdicts

verdictmeaninghow it is decided
okthe crawler gets the page2xx, robots allows it, text matches a browser
js-dependentcontent arrives only after JavaScriptmeasured with --render (raw text under half of the rendered text, rendered page at least 50 words), otherwise a labelled heuristic (near-empty body plus an app mount node)
cloakedthe crawler gets different text than a browser5-word-shingle Jaccard similarity below 0.5, both versions at least 30 words, crawler sees less text
robots-blockedrobots.txt forbids this crawler hereRFC 9309 matching: longest path wins, Allow wins ties, * groups respected
ua-blockedthe server refuses the crawler401/403/406/429/451 for the bot while a browser gets 2xx
errornothing useful to say about the contentfetch failure or the URL fails for a browser too

Every verdict carries the numbers that produced it, and the JSON and HTML reports keep confidence: "measured" or "heuristic" so a heuristic is never mistaken for a fact.

AI usage preferences (Content-Usage)

robots.txt used to answer one question: may this crawler fetch this page? The Content-Usage signal in the IETF aipref draft answers a second one: may this content be used for training? Anthropic, OpenAI, Google and Microsoft committed to it in November 2026.

User-agent: *
Allow: /
Content-Usage: train-ai=n, search=y

Crawl permission and usage preferences answer different questions. Allowing retrieval while declining training is valid; botglass does not recommend blocking search or other retrieval just because train-ai=n is declared.

botglass reads robots.txt only. It does not inspect HTTP Content-Usage response headers, which are another attachment mechanism defined by the draft. A missing robots.txt preference therefore does not establish that the page has no preference.

The audit and index resolve usage for the generic baseline crawler, not separately for every bot. Bot-specific Content-Usage groups may therefore differ from the displayed value. The resolver follows the attachment draft's worked path examples and separates crawl permission from usage. Explicit preference tokens in the current vocabulary are y and n; other values mean unknown, not “contact the owner”. --compact carries the resolved robots.txt training preference as trainAi. This is a draft-specific implementation, not a claim of complete Structured Fields conformance or provider compliance.

Crawlers it imitates

GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, PerplexityBot, CCBot, Googlebot, meta-externalagent — plus a plain Chrome baseline. --list-bots prints the set. User-Agent strings come from each vendor's public documentation and the docs URL is in src/bots.ts.

Options

botglass <url> [options]
botglass <url> <url> [options]   # several URLs in one run

--sitemap <url|file>   Audit every URL in a sitemap (index files are followed)
--urls <file>          Audit a newline-separated URL list (# comments allowed)
--max-pages <n>        Cap the number of pages audited (default 10)
--bots <a,b>           Only these crawlers (default: all)
--render               Also render with JavaScript (needs Playwright)
--samples              Print the first missing sentences for js-dependent pages
--json <file>          Write the full report as JSON
--html <file>          Write a standalone HTML report
--compact              Agent-sized output: verdicts and fixes, no page text
--baseline <file>      Compare against a saved baseline and list what changed
--update-baseline      Overwrite the baseline file with this run
--fail-on <verdicts>   Comma-separated verdicts that should exit 1
--max-js-only <0..1>   Fail when more than this share of rendered text is JS-only
--timeout <ms>         Per-request timeout (default 15000)
--delay <ms>           Delay between requests to the same host (default 400)
--concurrency <n>      Pages audited in parallel (default 1)
--no-robots            Skip robots.txt
--no-color             Plain output even on a TTY
--quiet                Write no terminal report
--list-bots            Print the crawler identities and exit

Batch mode

botglass --sitemap https://example.com/sitemap.xml --max-pages 50 --html report.html
botglass --urls pages.txt --bots GPTBot,ClaudeBot --json report.json

Requests go out one page at a time by default with a 400 ms gap, so a run does not look like an attack. Raise --concurrency only when you own the site.

Rendering once, measuring properly

--render uses Playwright to load the page in Chromium and compare the rendered text with the raw HTML. It is not installed by default:

npm install --save-dev playwright
npx playwright install chromium
botglass https://example.com --render --samples

Without Playwright the tool still runs; js-dependent then comes from the shell heuristic and says confidence: "heuristic".

CI

- name: Crawler visibility gate
  run: npx -y github:yardworkdev/botglass#v0.4.3 https://example.com --fail-on ua-blocked,error,cloaked

Exit codes: 0 pass, 1 gate failed, 2 usage or runtime error. --json writes a report you can archive; --html writes one a human can read without the tool.

Proving a fix

The first run tells you what is wrong. The second run proves it changed.

botglass https://example.com --render --baseline .botglass.json   # writes it
# ...deploy the fix...
botglass https://example.com --render --baseline .botglass.json   # compares, then updates
Changes since yesterday: 2
  https://example.com/
     ClaudeBot: ok → js-dependent
     ClaudeBot: 80 → 3 words

The baseline file holds verdicts and word counts only — never page text — so it is safe to commit or keep in CI. --update-baseline overwrites it; plain --baseline also refreshes it after comparing, so the next run measures against the newest state.

Limits (read these)

  • User-Agent is a claim, not a proof. A site that blocks real GPTBot by IP range will still answer a request that merely says User-Agent: GPTBot. botglass tells you what the server does with that identity, which is what a crawler-visible content problem usually depends on.
  • robots.txt is parsed, not obeyed. The tool fetches anyway, because seeing whether the server enforces its own rules is useful. A compliant crawler would stop at the block.
  • cloaked and shell-based js-dependent are heuristics. They name the numbers behind them; if the numbers look wrong, the verdict is wrong. --render moves js-dependent from heuristic to measured.
  • One fetch is a snapshot. CDNs, A/B tests and bot management change answers. The report prints the fetch time for that reason.
  • JavaScript-rendered text is not "visible to crawlers". Googlebot renders JS; GPTBot, ClaudeBot and PerplexityBot do not. A green Googlebot row does not help the others.

Development

npm install
npm test              # 140 tests: unit, fixture-server integration, real CLI subprocess
npm run build         # tsc -> dist/

The test suite starts a local fixture server with a server-rendered page, a client-only shell, a page that cloaks per User-Agent, a bot-only 403, a robots-blocked path, a redirect and a 404, then asserts every verdict and the CLI exit codes against it. No network access is needed to run the tests.

Layout: src/audit.ts (verdict rules, pure), src/robots.ts, src/html.ts, src/diff.ts (shingles and missing sentences), src/report/ (text, HTML, gate), src/cli.ts (arguments and exit codes).

Sample report

docs/index.html — two live pages, eight bots, rendering on.

AI Access Index

The November 2026 edition measures the 300 most-visited domains on the web: who blocks which AI crawler, who declares a Content-Usage preference, and how many homepages have no server-rendered text at all. Raw data sits next to it as JSON.

Reproduce or extend it:

node scripts/ai-access-index.mjs --domains tranco.csv --limit 300 --out docs/ai-access-index

tranco.csv is any rank,domain file — the Tranco list works. The run makes two requests per domain, sends botglass as its User-Agent, and takes about a minute at the default concurrency.

License

MIT. See LICENSE.

MCPB
https://github.com/yardworkdev/botglass/releases/download/v0.4.3/botglass-0.4.3.mcpb
Install Command
# mcpb: https://github.com/yardworkdev/botglass/releases/download/v0.4.3/botglass-0.4.3.mcpb