Skip to content

CLI reference for assessors ​

This is the operator reference for the current mcp-fuzzer command. It focuses on flags that affect scope, inputs, authentication, safety, evidence, and reproduction. For a task-based walkthrough, start with Run a first assessment.

Syntax ​

bash
mcp-fuzzer [OPTIONS] --mode MODE --protocol TRANSPORT --endpoint TARGET

--endpoint is required for a real run. It is a URL for HTTP/SSE/Streamable HTTP and a command string for stdio.

Assessment selection ​

OptionDefaultMeaning
--mode {tools,protocol,resources,prompts,all}allSelect the MCP surface to exercise.
--tool NAMEnoneFocus tool mode on one advertised tool.
--phase {realistic,aggressive,both}aggressiveTool-input phase: valid-shaped, attack/edge-oriented, or both.
--protocol-phase {realistic,aggressive}realisticProtocol/resource/prompt input phase.
--runs N10Tool runs per tool.
--runs-per-type N5Runs per protocol/resource/prompt type.
--protocol-type TYPEnoneFocus protocol mode on one message type; omission exercises the supported set.
--stateful / --no-statefuloffEnable learned stateful protocol sequences.
--stateful-runs N5Number of learned stateful sequences.
--seed NrandomSeed payload generation for reproduction.
--corpus / --no-corpusonEnable per-target corpus persistence.
--havoc / --no-havocoffEnable stacked corpus mutations.

Use audit recipes to separate baseline, aggressive, protocol, auth, and runtime evidence.

Transport and protocol ​

OptionDefaultMeaning
--protocol {http,https,sse,stdio,streamablehttp}httpTransport driver.
--endpoint TARGETnoneURL or stdio command.
--spec-schema-version VERSIONnegotiated/defaultMCP schema version for schema-driven behavior, for example 2025-11-25 or 2026-07-28.
--timeout SECONDS30.0General request timeout.
--tool-timeout SECONDSunsetPer-tool timeout overriding --timeout.
--transport-retries N1Total transport attempts; 1 disables retrying.

The retry delay curve (transport_retry_delay, transport_retry_backoff, transport_retry_max_delay, transport_retry_jitter) is set in a config file rather than on the command line; see configuration.

Generic http/https resolution depends on the selected MCP schema path. Use streamablehttp when the target explicitly exposes that transport and record the negotiated version in the assessment.

Spec and deterministic checks ​

OptionDefaultMeaning
--spec-guard / --no-spec-guardonRun deterministic checks before protocol/resource/prompt fuzzing.
--spec-resource-uri URInoneResource URI for resource checks.
--spec-prompt-name NAMEnonePrompt name for prompt checks.
--spec-prompt-args JSONnoneJSON object of prompt arguments.

Supported protocol type names are listed in configuration and sourced from the runtime registry. Result schemas are validated by spec guard but are not --protocol-type values.

Security and authentication audits ​

OptionDefaultMeaning
--security-auditoffInspect tool/schema metadata and correlate selected security oracles with fuzz evidence.
--security-audit-intrusiveoffAdd the foreign-Origin DNS-rebinding probe; requires --security-audit and explicit authorization.
--auth-auditoffRun read-only OAuth metadata, authorization behavior, and unauthenticated-tool checks where supported.
--auth-audit-intrusiveoffAdd dynamic-registration and redirect probes; only use with explicit authorization.
--fail-if-no-toolsoff, auto in CI/DockerExit non-zero when no usable tools are discovered.
--allow-empty-toolsoffOpt out of automatic no-tool failure for an explicitly expected zero-tool fixture.

--security-audit can produce signals for tool/schema poisoning, hidden or encoded instructions, ANSI/control content, trigger-conditioned metadata, duplicate or drifting definitions, dangerous local-read/network-egress combinations, cleartext remote transport, and evidence-backed command/path/SQL or output-injection behavior. It also flags names that closely imitate common tool names.

--security-audit-intrusive adds a foreign-Origin HTTP/SSE request. Legacy SSE revisions are probed with GET; 2026-07-28 removed the GET stream endpoint, so stateless revisions are probed with a server/discover POST. Configured transport authentication is replayed so a server that authenticates before it evaluates Origin still reaches the check.

Only a successful (2xx) response is reported as missing_origin_validation. Same-host redirects are followed first, because /mcp → /mcp/ and HTTP → HTTPS canonicalization can precede the Origin check; a redirect is never itself treated as acceptance. HTTP 403 is the spec-mandated rejection, HTTP 401 is reported as origin_validation_inconclusive, and unrelated protocol or routing errors produce no finding. Every revision requires Origin validation, but only 2025-11-25 and later mandate HTTP 403, so the finding text is scoped to the negotiated revision. Use this only against a target and network boundary covered by the engagement.

--auth-audit is read-only by default. The intrusive variant may create OAuth registration state and exercise redirect handling; keep it separate from a baseline and never use it against production without written authorization.

Authentication options ​

OptionDefaultMeaning
--auth-config FILEnoneJSON provider file.
--auth-envoffResolve supported auth environment variables.
--oauthoffRun the MCP OAuth flow against the target.
--oauth-grant {authorization_code,client_credentials}authorization_codeUser-delegated PKCE or machine-to-machine grant.
--oauth-client-id IDenv/nonePre-registered client ID.
--oauth-client-secret SECRETenv/noneConfidential-client secret; prefer secret injection over shell history.
--oauth-scope SCOPEenv/noneSpace-separated requested scopes.
--oauth-client-id-metadata-url HTTPS_URLnoneClient ID Metadata Document URL.
--oauth-open-browseroffOpen the authorization-code URL automatically.
--oauth-no-token-cacheoffAvoid the local OAuth token cache.

Authentication provider examples and secret-handling guidance live in configuration.

Safety and host boundaries ​

OptionDefaultMeaning
--enable-safety-systemoffEnable system-level command-blocking shims for the child process.
--fs-root PATH~/.mcp_fuzzerRoot used to constrain fuzzer-generated filesystem paths.
--no-safetyoffDisable argument-level safety filtering; not recommended on an unisolated target.
--no-networkoffDisallow non-local fuzzer network access.
--allow-host HOSTnoneAdd an approved host while --no-network is active; repeatable.
--safety-reportoffPrint the blocked-operation summary and write safety_report_<session>.json.
--retry-with-safety-on-interruptoffRetry once with safety enabled after Ctrl-C.

These are controls for the assessment client, not a complete OS sandbox. Use a container or VM for untrusted local code. See contain the target.

Runtime observation for stdio ​

OptionDefaultMeaning
--runtime-probe / --no-runtime-probeenv fallbackEnable optional mcpfz-probe.
--runtime-probe-backend {ebpf,fake,auto}env/ebpfBackend selection.
--runtime-probe-bin PATHenv/mcpfz-probeSidecar path.
--runtime-probe-workspace PATHenv/current directoryAllowed workspace root.
--runtime-probe-tmpdir PATHenv//tmpAllowed temporary root.
--runtime-probe-allow-exec PATHnoneRepeatable executable allowlist.
--runtime-probe-allow-host HOSTnoneRepeatable host/host:port allowlist.

The probe is opt-in, applies to local stdio process behavior, and fails open if it cannot observe an event. It does not monitor remote transports.

Output and diagnostics ​

OptionDefaultMeaning
--output-dir DIRECTORYreportsDirectory for reports and exports.
--output-types TYPE [TYPE ...]all applicableSpace-separated standardized output types.
--export-csv FILEnoneAdditional CSV export.
--export-xml FILEnoneAdditional XML export.
--export-html FILEnoneAdditional HTML export.
--export-markdown FILEnoneAdditional Markdown export.
--log-level LEVELWARNINGCRITICAL, ERROR, WARNING, INFO, or DEBUG.
--enable-aiomonitoroffEnable async debugging on the configured monitor port.
--validate-config FILEnoneRead and shape-check YAML, then exit.
--check-envoffValidate known environment variables, then exit.

Read Interpret evidence and findings before processing artifact contents. Reports can contain target data and secrets.

Process controls ​

OptionDefaultMeaning
--watchdog-check-interval SECONDS1.0Watchdog polling interval.
--watchdog-process-timeout SECONDS30.0Stale-process threshold.
--watchdog-extra-buffer SECONDS5.0Grace period before termination.
--watchdog-max-hang-time SECONDS60.0Force-kill ceiling.
--max-concurrency N5Concurrent client operations.

Tune these only after a baseline. High concurrency and retries can change the target's behavior and make evidence harder to interpret.

Common command patterns ​

bash
# Validate a target profile without connecting
mcp-fuzzer --validate-config assessment.yaml

# Baseline with reproducible payload generation
mcp-fuzzer --config assessment.yaml --phase realistic --seed 42 \
  --output-dir reports/baseline

# Focus one tool with aggressive inputs
mcp-fuzzer --mode tools --tool NAME --phase aggressive \
  --protocol streamablehttp --endpoint https://target.example/mcp \
  --security-audit --runs 20 --seed 42 --output-dir reports/tool-NAME

# CI target usability check
mcp-fuzzer --mode all --protocol streamablehttp \
  --endpoint http://127.0.0.1:8000/mcp --security-audit \
  --fail-if-no-tools --output-dir reports/ci

For config precedence, environment variables, protocol type values, and authentication provider JSON, use configuration.

Released under the MIT License.