CLI reference
22 commands, grouped by what you are trying to do. Flags and usage are printed from the version you have installed.
Start here
scanstatusApprove and protect
baselineapproveapprovalsdecideguardwrapwrongLook closer
verifypanelrunschangesdemoWhen something goes wrong
checkupreportSet up and account
install-nodemcploginlogoutskillspushExit codes
The same vocabulary across every command, so a script can branch on it.
| Code | Means | Read it as |
|---|---|---|
0 | clean | nothing to act on |
1 | findings | something was found and is reported |
2 | usage | the command was called wrongly |
3 | cannot run | not installed, or the capability is not on this tier |
4 | incomplete | it ran but could not finish, so it is NOT clean |
Could not check is not clean. scan exits 1 when it could not
reach a server, and names it. In a terminal it first asks whether to try again, skip it, or
show why it failed. It never asks when there is no terminal, with --json,
--fleet-json or --yes, or inside an agent session.
Exit 4 is for a verify run that timed out, a write mcpgawk refused (an approval
from an agent session, for example), and a store it could not read.
"Could not check" and "checked and clean" must never be the same signal to a script.
Two exceptions, since 0.1.88. verify exits 2 when every call to a
server answered with an error (incomplete, not a usage error), and a scan that measured nothing
when there was something to measure (for example local servers found with no terminal and no
--yes)
exits 1. scan --json and --fleet-json also exit 1 when a server has
appeared since you approved your fleet.
Start here
Find out what your agents can already reach.
mcpgawk scan
Measure MCP servers on this machine: every tool they expose, what each one costs your context window, and what it can reach. With no argument it reads every agent config it can find. Give it a config path to scan only that client. Local servers are launched only after you say yes, because scanning one means running its code.
usage: mcpgawk scan [-h] [--stdio STDIO] [--http HTTP] [--sse SSE] [--header HEADER]
[--login] [--oauth-client-id OAUTH_CLIENT_ID]
[--oauth-client-secret-env VAR]
[--oauth-redirect-uri OAUTH_REDIRECT_URI] [--sign-in] [--only ONLY]
[--yes] [--no-signals] [--no-track] [--json] [--fleet-json]
[--with-spec] [--verbose] [--full] [--detail] [--supply-chain]
[--oauth-scopes]
[config]
positional arguments:
config path to an mcp.json config
options:
-h, --help show this help message and exit
--stdio STDIO one stdio server, e.g. "npx -y @modelcontextprotocol/server-
filesystem /tmp"
--http HTTP one streamable-HTTP server URL
--sse SSE one SSE server URL
--header HEADER HTTP header, e.g. "Authorization: Bearer XYZ" (repeatable)
--login for a remote --http/--sse server that needs OAuth: open the browser,
sign in once, and scan (token stored locally in ~/.gawk/oauth)
--oauth-client-id OAUTH_CLIENT_ID
with --login, for a server that REFUSES automatic client
registration (figma, Slack — enterprise posture): use this pre-
registered OAuth client id. Register the pinned redirect URI mcpgawk
prints with the provider first
--oauth-client-secret-env VAR
environment variable holding the pre-registered client's secret
(never passed on the command line; omit for a public client + PKCE)
--oauth-redirect-uri OAUTH_REDIRECT_URI
override the pinned redirect URI (must match the provider's
registration EXACTLY)
--sign-in for a server that signs in through its OWN login tool (kite): hold
one session open, wait while you sign in, then measure THROUGH that
session
--only ONLY comma-separated server names to scan from the config
--yes, -y launch discovered/configured local (stdio) servers WITHOUT the
consent prompt (scanning a stdio server runs its code) — for CI /
non-interactive use
--no-signals skip BOUNDED heuristic signals (facts only)
--no-track do NOT record this scan locally (drift/rug-pull detection is on by
default; history stays on this machine, at ~/.mcpgawk/history.json)
--json emit JSON labels instead of a table
--fleet-json emit the FLEET STATUS as JSON (one row per server, grouped by the
tool it lives in) — what the IDE extension renders, so state is
computed once here
--with-spec with --fleet-json, include each server's launch spec
(command/args/env or url) so a local front-end can verify it by
click — MAY carry secrets from your config; kept off by default and
never printed without this flag
--verbose show the full per-tool table, not just flagged tools
--full print the full per-server surface even when a baseline makes what-
changed the default view
--detail print the full narrative report for EVERY server instead of the
fleet status list (the list is the default when more than one server
is scanned)
--supply-chain opt-in: looks up the package name (and pinned version) of every
stdio server on npm/PyPI before anything launches — including
servers you then decline — so a made-up or brand-new name is caught,
and one the registry does not have is never launched; nothing else
is sent
--oauth-scopes opt-in: locally decode a supplied Bearer JWT's scope claim (no
network; reads a credential you already provided)mcpgawk status
One answer to 'am I protected'. Read-only — opens nothing, starts nothing. Coverage is reported PER AGENT, never in aggregate: only some agents have a hook point, so a single cheerful tick would tell the user of an agent without one that they are covered when they are not.
usage: mcpgawk status [-h] [--json]
options:
-h, --help show this help message and exit
--json the same facts as JSON (schema gawk.status/1), plus one row per server with
approval provenance, last sighting, tier and verify facts — for a supervising
agent or a client with no hookApprove and protect
Decide what a server is allowed to be, then hold it to that.
mcpgawk baseline
The shared baseline every pillar compares against. `verify` and `monitor` read this so that approving a server once is approving it everywhere, instead of each keeping its own memory and contradicting the others.
usage: mcpgawk baseline [-h] [--json] [--server NAME] options: -h, --help show this help message and exit --json machine-readable (the cross-runtime shape) --server NAME one server (name or alias) instead of all
mcpgawk approve
Accept a server's current tools as the baseline you trust. Until you do, a tool that appeared after the last baseline is treated as drift, and its calls are held where the guard hook is installed. Run it with no server name to see what is waiting.
usage: mcpgawk approve [-h] [--all] [--list] [--fleet] [--reason TEXT] [--name-only]
[server]
positional arguments:
server the server name as it appears in your config, or its asserted identity
options:
-h, --help show this help message and exit
--all approve every server with pending drift
--list show which servers have changes you have not approved, and change nothing
--fleet accept every server now in your agent configs as your fleet; a server that
appears later is named instead of trusted
--reason TEXT why you are accepting this change; kept on the approval record
--name-only locked machines: allow a server mcpgawk has never seen (one built into your
agent) by its name alone; its tools are not checkedmcpgawk approvals
Lock approving on this machine behind an approval passphrase. Once locked, every approval is signed with a key only your passphrase unlocks, and the public key that checks those signatures is placed where only an admin can change it (one sudo step). An agent running as you cannot type a passphrase it was never told. `status` says whether this machine is locked.
usage: mcpgawk approvals [-h] {lock,status}
positional arguments:
{lock,status} lock: set the passphrase and place the public key; status: show it
options:
-h, --help show this help message and exitmcpgawk decide
The one screen a human is required for. Opens a LOCAL page showing each server that changed since you trusted it, what changed, and lets you approve or keep it waiting (its calls held where the guard hook is installed). Read-only over your state until you click; approval needs the token printed here, and mcpgawk refuses an approval when it can see an agent running it.
usage: mcpgawk decide [-h] [--port PORT] [--no-open] options: -h, --help show this help message and exit --port PORT local port (default: 7717) --no-open print the URL, do not open a browser
mcpgawk guard
Puts the approved baseline in Claude Code's loop. A single PreToolUse hook, installed once, checks each MCP tool call before it runs — no per-server rewiring and no proxy. The decision is made on your machine, and there is nothing to sign in to. For all six agents with a hook point, run `mcpgawk` with no arguments.
usage: mcpgawk guard [-h] [--settings PATH] [--strict] [--no-strict]
[{status,install,uninstall}]
positional arguments:
{status,install,uninstall}
default: status
options:
-h, --help show this help message and exit
--settings PATH settings file to edit (default: ~/.claude/settings.json)
--strict with install: refuse calls to any server with no baseline on this
machine
--no-strict with install: switch strict mode off (run it in your own terminal)mcpgawk wrap
Put mcpgawk in the pipe the client already opens, instead of asking for access of its own. The client's config launches `mcpgawk wrap -- <the server's own command>`, so the real server starts in the client's environment with the client's credentials, and every message passes through: the tool surface it declares becomes its baseline with no scan and no sign- in, and every tools/call is checked against that baseline as it happens. Client-agnostic by construction — it is a config edit, so Claude Code, Codex, Cursor, Claude Desktop and the rest are covered by the same mechanism. This slice OBSERVES: a call that would be blocked is said on stderr and recorded, never dropped.
usage: mcpgawk wrap [-h] [--name NAME] [--install SERVER] [--uninstall SERVER]
[--client CLIENT] [--dry-run]
...
positional arguments:
command -- followed by the server's own launch command
options:
-h, --help show this help message and exit
--name NAME the config name of this server, so records carry the name you know it
by (default: whatever the server calls itself)
--install SERVER edit every config file that names SERVER so its client launches it
through mcpgawk (the original command is kept inside the new args, and
a backup beside each file)
--uninstall SERVER undo --install: the original command is read back out of the wrapper's
own arguments, so nothing depends on a backup being current
--client CLIENT with --install/--uninstall: only this client's config files (e.g.
claude-code), leaving every other client untouched
--dry-run with --install/--uninstall: say what would change, write nothingmcpgawk wrong
The false-positive affordance. `mcpgawk wrong <server> <tool>/<kind>` records that YOU judged that finding wrong. It keeps appearing, labelled 'muted by you', because a mistake you silenced must stay reviewable — absence of a finding is never safety, including absence you asked for.
usage: mcpgawk wrong [-h] [--undo] server finding-id
positional arguments:
server the server name as it appears in your config
finding-id the finding as the report prints it: <tool>/<kind>, e.g.
read_note/injection:reader-directed
options:
-h, --help show this help message and exit
--undo withdraw the muteLook closer
Run a server and watch it, or read what happened.
mcpgawk verify
usage: mcpgawk verify <config.json> [--unsafe] [--isolate] [--json] [--html <file>] [--csv <file>]
[--sarif <file>] [--junit <file>] [--behaviour-profile <file>] [--suppress <file>]
[--baseline <file>] [--webhook <url>] [--audit-log <file>] [--out <file>]
[--audit-source] [--source-dir <path>] [--server-timeout <seconds>]
mcpgawk verify serve [--port <n>] [--host <addr>] # local web UI
mcpgawk verify suppress <findingId> --file <file> --reason "<why>" [--approved-by "<who>"] [--hosts <a,b>]
config.json:
{
"mcpServers": {
"local": { "command": "node", "args": ["server.js"], "allowedHosts": ["api.myservice.com"] },
"remote": { "url": "https://mcp.example.com/mcp", "transport": "http", "headers": { "Authorization": "Bearer ${MCP_TOKEN}" } }
}
}
Local (stdio) servers: the checks run in a sandbox whose egress checks observe HTTP(S) only
(raw-socket / DNS / UDP exfiltration is not detected; --isolate blocks it). Each local server
is first started once outside the sandbox, with its normal environment and network, to list
its tools.
Remote (http/sse) servers can't be sandboxed — only output-based checks (tool-poisoning) apply.
${VAR_NAME} in "headers"/"env" values is substituted from the environment at load time — so a
config.json committed to a repo never needs to contain a literal secret (export MCP_TOKEN=... and
mcpgawk verify resolves it; a config that references an unset variable fails loudly at startup).
--isolate: run local servers in an OS-level container sandbox whose ONLY route out is the
verifying egress proxy (ADR-0014). Blocks raw-socket/DNS/UDP exfil outright AND
still observes every HTTP(S) destination — allowlisted hosts stay reachable, so
SSRF-canary / undeclared-egress checks keep their signal. Covers node/python
scripts and install-on-launch commands (npx/uvx); the package install runs
contained too, observed against an explicit registry allowlist. Requires Docker;
degrades to the default proxy sandbox with a warning otherwise. Slower per probe
(a container network per call) — the default remains the everyday path.
--server-timeout <seconds>: wall-clock budget PER SERVER. Once spent, no further check on that
server is started: the rest are recorded as not attempted, the server is reported
INCOMPLETE (never clean), the run moves on. Nothing is cancelled mid-flight — a
check in progress finishes on its own probe timeout. A server whose process never
starts is abandoned after two such tools regardless (see errors[]).
--baseline <file>: first run records a fingerprint of each server's tools; later runs flag DRIFT
(added / removed / changed tools) — i.e. a rug-pull.
--behaviour-profile <file>: write a gawk.behaviour/1 profile (per-tool observed source/sink) — feed
it to `mcpgawk enforce --behaviour-profile`, a mcpgawk Platform command, so
toxic-flow blocks by BEHAVIOUR, not name.
--sarif <file>: write a SARIF 2.1.0 report — GitHub code scanning / most CI security dashboards
ingest this natively. A suppressed finding is encoded as a SARIF suppression
(shows as "dismissed" on GitHub), not silently dropped from the file.
--junit <file>: write a JUnit XML report — renders as a pass/fail test tree in most CI UIs.
A suppressed finding becomes a <skipped/> testcase, not a <failure> or nothing.
--suppress <file>: exclude REVIEWED findings (by deterministic findingId) from status/exit-code —
a legitimate, accepted finding no longer fails CI forever. Never auto-created;
use `mcpgawk verify suppress` to add an entry after actually reviewing a finding.
Suppressed findings still APPEAR in every output format, marked, never hidden.
--webhook <url>: POST the JSON report to <url> when there are findings or drift (alert sink).
--audit-log <file>: append ONE JSONL line per reproduction attempt (every attempt, not just ones
that produce a finding) — server/tool/check/attempt, whether it completed, the
raw response text (truncated to 2000 chars) and egress observed, or the infra
failure detail. A "clean" report on its own is a verdict to trust; this is the
evidence to check that verdict against. Off by default (raw tool output may
contain the target's own data — opt in deliberately).
--out <file>: write the JSON report incrementally as each server finishes, not only once
at the very end (atomic tmp-file-then-rename, same pattern as never leaving a
half-written file). A killed/timed-out run (a slow OAuth-fronted remote, a
hung server) leaves the last-known-good snapshot on disk instead of losing
every server that already finished cleanly. --json still controls whether the
full report also prints to stdout at the end; --out is independent of it.
--audit-source: ALSO statically audit each server's SOURCE CODE (AST + semgrep, handled by the
Python side before this CLI runs — you won't see these flags again in errors from
here). Local script paths are audited in place; npm/pypi launch specs (npx/uvx)
are fetched from the public registry — a network call, fetch-only, nothing
executed. Remote (url) servers have no local source: reported not-applicable.
--source-dir <path>: with --audit-source, skip resolution and audit exactly this directory
(single-server configs only).
serve: open a local web UI (default http://127.0.0.1:7878) to paste a config and verify in the browser.
suppress: record that a specific findingId (from a prior run's output) has been reviewed
and accepted — appends to --file, creating it if it doesn't exist yet.mcpgawk panel
One window over the whole machine: which agents are covered, every MCP server and its state, what the runtime guard has actually seen, and anything waiting on you. A control surface, not a viewer: re-scan, verify, sign-in, approve and protect all live here — but only on the tokened URL this command prints. A bare 127.0.0.1:7718 (bookmark, restored tab) renders read-only with no buttons, by design. Approve, mute, pin and protect also ask for an approval code that this command prints in this terminal only — it is on no page and in no file — and a correct code unlocks them for 15 minutes. Drift decisions also live in `mcpgawk decide`.
usage: mcpgawk panel [-h] [--port PORT] [--no-open] options: -h, --help show this help message and exit --port PORT local port (default: 7718) --no-open print the URL, do not open a browser
mcpgawk runs
Your local run history — scans and verify runs, and (with mcpgawk Platform) enforce and monitor runs, newest first. Read from ~/.mcpgawk/runs.db, on your machine. A run that never closed shows as RUNNING, and as INCOMPLETE once its process is gone — it is never reported as success.
usage: mcpgawk runs [-h] [--kind {scan,verify,enforce,monitor,guard}] [--limit LIMIT]
[--json] [--prune]
options:
-h, --help show this help message and exit
--kind {scan,verify,enforce,monitor,guard}
only this kind of run
--limit LIMIT how many to show (default 20)
--json machine-readable output
--prune drop finished runs older than 90 days, then report what is leftmcpgawk changes
Every change to a server's tool surface between consecutive recorded snapshots: tools added and removed, input schemas widened, descriptions and annotations rewritten. Read from the local history, so it works for servers you have already approved — `decide` shows only what you have not yet said yes to. Same comparison as the scan's DRIFT block.
usage: mcpgawk changes [-h] [--since WHEN] [--json] [NAME] positional arguments: NAME one server (name or alias); omit for every server options: -h, --help show this help message and exit --since WHEN window start: 30d, 7d, 2026-08-01, or a full timestamp (default 30d) --json one entry per change
mcpgawk demo
A self-contained walkthrough: mcpgawk plants a deliberately-bad MCP server in a temporary sandbox, measures it, you approve it, the server turns hostile, and the guard blocks the tool that appeared afterwards. Nothing touches your real fleet, agents, or state. Offline; a few seconds.
usage: mcpgawk demo [-h] [--sandbox DIR] [--clean] options: -h, --help show this help message and exit --sandbox DIR use this directory for the sandbox instead of a fresh temp one --clean delete the sandbox on exit (default: keep it so you can inspect it)
When something goes wrong
Capture what happened, redacted, in one file you can send.
mcpgawk checkup
Exercises every surface in turn — version, status, scan, verify, the run history and every panel tab — then writes one file with what each step did. A step that fails is kept, not hidden: that is the point. Steps that would launch your local servers ask once and can be declined without stopping the rest. Nothing is uploaded. Stop it at any time with Ctrl-C and the bundle is still written.
usage: mcpgawk checkup [-h] [--output PATH] [--note TEXT] [--yes] [--strict] options: -h, --help show this help message and exit --output PATH write here instead of ./mcpgawk-checkup-<timestamp>.zip --note TEXT what you were trying to do — travels in the bundle --yes, -y do not ask before launching local servers (for a non-interactive run) --strict remove hostnames, package names and command arguments as well
mcpgawk report
Collects everything about this machine into a single redacted zip: version and how mcpgawk was installed, per-agent hook state, the entire run history, the entire call log, every verify run, open drift alerts, and an inventory of both state directories. Nothing is uploaded — the command prints a path and stops. Server responses are removed by field name, home directories become ~, and every URL keeps its parameter names and loses their values. A store that could not be read is listed as 'unavailable', which means nobody looked — never 'nothing there'.
usage: mcpgawk report [-h] [--output PATH] [--strict] [--note TEXT]
options:
-h, --help show this help message and exit
--output PATH write here instead of ./mcpgawk-report-<timestamp>.zip
--strict also remove hostnames, package names and command arguments — for a machine
whose owner will not let internal infrastructure leave it (credentials,
server responses and env values are always removed)
--note TEXT what you were doing when it went wrong — travels in the bundleSet up and account
Installation, licensing and the bits you touch once.
mcpgawk install-node
Download the Node runtime that `verify` uses to run a server in a sandbox. About 26 MB, into mcpgawk's own directory: no admin rights, and nothing on the system is changed.
usage: mcpgawk install-node [-h] [--yes]
options:
-h, --help show this help message and exit
--yes, -y skip the confirmation — required in a non-interactive session, because this
downloads and then RUNS third-party codemcpgawk mcp
Run mcpgawk as an MCP server over stdio — the same server the `mcpgawk-mcp` console script starts. Two tools (scan_mcp_fleet, scan_mcp_server); they can launch local servers when asked to, so they are not declared read-only. No flags. Example client entry: `uvx mcpgawk mcp`.
usage: mcpgawk mcp [-h] options: -h, --help show this help message and exit
mcpgawk login
Printed by a machine that has the Platform installed. Before mcpgawk login, a free install says the Platform is not installed here and how to add it.
usage: mcpgawk login (asks for the key, input hidden)
mcpgawk login --stdin (reads the key from standard input)
mcpgawk login '<license-key>'
The first two keep the key out of your shell history and off the command line, where other
users on this machine can see it. If you pass it as an argument, keep it in single quotes so
your shell passes it through whole.
Validates your key against Lemon Squeezy and saves it to ~/.gawk/config.json (mode 0600) so you don't need to export GAWK_LICENSE_KEY yourself. Re-run any time to switch keys.mcpgawk logout
Printed by a machine that has the Platform installed. Before mcpgawk login, a free install says the Platform is not installed here and how to add it.
usage: mcpgawk logout Removes the licence key saved in ~/.gawk/config.json. A key exported as GAWK_LICENSE_KEY is not touched. Takes no arguments.
mcpgawk skills
Discovers agent skills across every supported host (Claude Code, Codex, Cursor, Copilot, Windsurf, Antigravity, Kiro, Gemini, opencode, Amp) and scans their content locally — nothing is uploaded anywhere. Give paths to scan a specific skill dir, a skills root, or a project instead of the whole machine.
usage: mcpgawk skills [-h] [--json] [--fail-on-findings] [paths ...]
positional arguments:
paths skill dir / skills root / project root (default: discover all hosts)
options:
-h, --help show this help message and exit
--json machine-readable output
--fail-on-findings exit 1 if any finding fires (CI gate) — default reports and exits 0,
because a signal is a signal, not a verdictmcpgawk push
Printed by a machine that has the Platform installed. Before mcpgawk login, a free install says the Platform is not installed here and how to add it.
usage: mcpgawk push (--stdio "<cmd>" | --http <url> | --sse <url> | --file <report.json>) [--source cli|ci] Push a scan receipt (Report v0) to your Finix dashboard fleet. The server appears in the dashboard even though you never scanned it from the portal -- that is the point. mcpgawk push --http https://your-server/mcp scan a live server and push the receipt mcpgawk push --stdio "npx -y @scope/server /tmp" scan a local stdio server and push mcpgawk push --file report.json push a Report v0 your CI already produced Needs a license key: `mcpgawk login <key>` once, or export GAWK_LICENSE_KEY (CI). Endpoint overridable via GAWK_INGEST_URL.