mcptrust run

Command reference for verified artifact execution.


Synopsis

mcptrust run --lock <lockfile> [flags] [-- <command>]

Description

Executes an MCP server from a verified artifact. Ensures the executed artifact matches the lockfile pin, preventing registry substitution attacks.

Workflow

  1. Read lockfile artifact section.
  2. Download tarball from registry.
  3. Verify SHA-256 matches tarball_sha256.
  4. Verify provenance (SLSA attestation) if --require-provenance.
  5. Install package from verified local tarball (not from registry).
  6. Execute binary directly.

Flags

FlagDefaultDescription
--lock(required)Path to lockfile
--timeout0Execution timeout (0 = none)
--dry-runfalseVerify but don't execute
--require-provenancetrueRequire SLSA attestation
--expected-source-Regex for source repo
--bin-Binary name (multi-bin packages)
--allow-missing-installed-integrityfalseProceed with warning if integrity can't be verified
--unsafe-allow-private-tarball-hostsfalseAllow private IP registries

Examples

# Use command from lockfile
mcptrust run --lock mcp-lock.json
 
# Override command
mcptrust run --lock mcp-lock.json -- "npx -y @scope/server /custom/path"
 
# Dry run
mcptrust run --dry-run --lock mcp-lock.json
 
# Multi-bin package
mcptrust run --lock mcp-lock.json --bin server