REC 00:00:00;00
screencast-mcp Tools Workflows Connect GitHub ↗

SCREENCAST-MCP / CI

Record test runs in CI

Browser tests get a video of every failure for free. Desktop apps on Windows (Electron, WPF, WinUI, WinForms, games) don't. screencast-mcp record runs your test command while it records the runner's desktop, then turns a failure into a GIF and a contact sheet you can open from the run.

00:00THE COMMAND LINE

The same tools the MCP server exposes, without an MCP client. The command's exit code passes straight through.

npx -y @tmhs/screencast-mcp record --target full -- npm run test:e2e

Everything lands in screencast-evidence/ with an evidence.json summary. Any single tool works the same way: npx -y @tmhs/screencast-mcp call doctor, or call pipeline @recipe.json.

00:10THE ACTION

A composite action wraps it for windows-latest: it checks Node, installs ffmpeg if it is missing, records the command, uploads the evidence folder as an artifact, writes a job summary, and then fails the step with the command's exit code.

jobs:
  ui-tests:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
        with:
          node-version: 22
      - run: npm ci
      - uses: TMHSDigital/screencast-mcp@v0 # newest 0.x release; pin vX.Y.Z or a SHA to freeze it
        with:
          command: npm run test:e2e
          target: full          # or window:exe=MyApp.exe
          artifacts: failure    # GIF and contact sheet only when it fails

Outputs: exit-code, end-reason, gif, contact-sheet, recording, evidence-dir, artifact-name, and artifact-url. The inputs, from action.yml:

InputDefaultWhat it does
commandrequiredThe test command to run while recording, as one line for cmd.exe (so npm test && npm run e2e and -g "a & b" work as written).
targetfullWhat to record: full | monitor:<i> | window:<title> | window:exe=<app.exe> | region:x,y,w,h.
fps15Capture frame rate (1-120).
artifactsfailureWhen to make the GIF and contact sheet: failure, always, or never.
last-seconds30The GIF covers the last this-many seconds of the run (0 = all of it).
max-durationStop recording after this many seconds, an integer up to 604800 (0 = no cap). Empty uses SCREENCAST_MAX_RECORDING_SEC, else 3600. A run longer than the cap gets a warning, since the GIF then shows the end of the recording, not of the run.
discard-on-successtrueDelete the recording when the command passes, so green runs upload nothing but evidence.json.
output-dirscreencast-evidenceFolder for recording.mp4, evidence.gif, contact-sheet.png, and evidence.json.
uploadtrueUpload the output folder as a workflow artifact.
artifact-nameName of the uploaded artifact. Empty means screencast-evidence-<job>, plus the matrix index in a matrix and the attempt on a rerun, so matrix legs never collide.
retention-days14Days to keep the artifact.
packageThe npm package (and version) to run with npx. Empty means the version of this action (from its package.json), so pinning the action pins the CLI; @latest only if that version is not on npm.
cli-pathRun a local build instead of the npm package, e.g. dist/index.js in a checkout of screencast-mcp.
install-ffmpegtrueInstall ffmpeg with Chocolatey when it is not on PATH.
ocr-errorsOn failure, OCR the GIF's window for error lines (Windows OCR) into evidence.json: true, false, or empty to follow comment.
redact-secretsfalseOCR the recording and blur on-screen secrets (API keys, tokens, password: values) in evidence.gif and contact-sheet.png before upload (Windows OCR). If the scan fails they are skipped, not uploaded unblurred.
secret-patternWith redact-secrets, the regex to blur instead of the default.
eventsfalseAlso log clicks, scrolls and typing bursts to recording.events.jsonl, on the recording's clock.
perffalseAlso sample CPU and memory to recording.perf.jsonl, to line a slow step up with the video.
logsApp log files to follow into recording.logs.jsonl, one path per line (at most 5).
bug-reportfalseWhen the command fails, write a bug_report package (secret-scanned clip and GIF, steps from the event log, OCR'd errors, report.md) to bug-report/ in the output folder. Needs Windows OCR; pairs well with events, logs and perf.
commentfalseOn pull_request events, keep one sticky PR comment per job with the exit code, how the recording ended, OCR'd errors, and a link to the evidence artifact. Created when the command fails, updated on later runs. Needs permissions: pull-requests: write.
github-token${{ github.token }}Token for the PR comment.

@v0 is a floating tag that each release moves to the newest 0.x version, so a broken main never reaches your CI; use a full version tag such as @v0.47.0 or a commit SHA to pin exactly. Pinning the action pins the CLI too: by default it runs the npm version the action was released with. Each job and matrix leg uploads its own artifact (screencast-evidence-<job>[-<index>]), so matrices do not collide. The Action is being published to GitHub Marketplace.

comment: true keeps one PR comment per job, created when the command fails and updated on later runs, with the exit code, how the recording ended, OCR'd errors, and a link to the evidence artifact. It needs permissions: pull-requests: write; fork PRs get a read-only token, so the step only warns. GitHub cannot show images stored in artifacts, so the GIF stays in the artifact.

00:20WHAT TO KNOW