Skip to Content
screw bugs docs

MCP and CLI

A reference card of the MCP tools, the CLI commands and their exit codes.

Coding agents use the MCP server (screw-bugs mcp, over stdio); people and CI use the CLI. Both run the same operations.

MCP tools

Five tools, four of which work today (screw-bugs src/cli/mcp.ts). Replies are 1–2 sentences plus file paths or URLs.

ToolNeedsOptionalWhat it does
doctornonenoneCheck this machine can run screw-bugs: Node, a browser, disk, updates
start_runurl, summarycases, title, instructions, device, account, waitSeconds (0–600)Start a job in a headless browser; returns a job ID right away
run_statusjobIdwaitSeconds (0–60)State and case results; an ended run gives its evidence, report and walkthrough
submit_findingsjobId, findingsnoneSubmit the agent's write-up of an ended run; the report is re-rendered
answer_questionjobId, questionId, answernoneAnswer a waiting run's question. Not implemented
  • Without cases, a job runs one "page loads" case. The case format: Cases and steps.
  • run_status waits at most 60 seconds per call: call it again until the run ends.
  • Signing in a test account takes two start_run calls: see Test accounts.

Run states

run_status and status report one of: queued, running, waiting_for_answer, finished, errored. Each case is passed, failed, blocked (a step couldn't run) or not_verified (the run ended first).

CLI commands

Run with npx -y screw-bugs@latest <command>. Commands that print a result accept --json.

CommandWhat it does
setup [--agent <name>] [--url <url>] [--no-downloads]Set up this project: MCP config, screw-bugs.json, browser and ffmpeg downloads
doctorCheck Node, browser, video, disk, Tailscale and updates
init [--url <url>] [--force]Write screw-bugs.json
run [--spec job.json] [--url <url>]Run cases and wait; exit 1 unless all passed. Also --title, --instructions, --summary, --device
status <job-id>State and case results of a run
findings <job-id> <file|->Submit an agent's write-up of an ended run
report <job-id> [--format markdown]Write the report, or print a PR summary
report <job-id> --serve [--port N]Serve the report at a local or tailnet URL
walkthrough <job-id> [--serve]Write (or serve) the run's video walkthrough
runs [--limit N]List recent runs
accountsList test accounts
accounts sign-in <label> --url <url> [--about <text>]Sign in to a test account in a live view
accounts remove <label>Remove a test account and its saved session
schema <job|findings>Print the JSON Schema of a job or write-up
mcpServe the MCP server over stdio
analyticsShow whether analytics are on (off by default). analytics on|off Not implemented
answer <job-id> <question-id> <answer>Answer a question a waiting run asked. Not implemented
share <job-id>Share a report through Cloud. Not implemented

Sharing

There is no agent or CLI path to share. A person shares with the Share button in a report opened over the report server; see Share a report.

Exit codes

Stable, so CI scripts may branch on them (screw-bugs src/cli/exit-codes.ts).

CodeMeaning
0OK
1A case did not pass
2Bad arguments
3screw-bugs.json missing or invalid
4doctor found something missing (or no ffmpeg to record a run)
5Not implemented yet
6Findings do not fit the run
7Upload files missing or unusable
8setup left an agent's config alone
9A test account needs a sign-in first
70Internal error (please report it)
130Stopped by Ctrl+C or SIGTERM

Environment variables

VariableEffect
SCREW_BUGS_SERVE=0No report server; replies give paths
SCREW_BUGS_REPORT_HOSTWhere the report server listens: 127.0.0.1, tailnet, a MagicDNS name or a Tailscale IP
SCREW_BUGS_SIGN_IN_HOSTThe same, for the sign-in live view only
SCREW_BUGS_CLOUD_URLWhere Cloud is (default https://screwbugs.dev)
SCREW_BUGS_UPDATE_CHECK=0No daily update check
SCREW_BUGS_ANALYTICS=1Opt in to analytics (nothing is collected yet)

Full reference: the "CLI" section of the screw-bugs README.

NextReport sharing

On this page