@tmhs/screencast-mcp 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +67 -60
  2. package/package.json +12 -4
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **An MCP server that lets an agent record the screen, _watch_ the footage, and make minimal ffmpeg edits — over stdio, on Windows.**
6
6
 
7
- Capture the desktop, a monitor, a window, or a region; sample a recording into frames the agent can actually look at; trim, crop, scale, redact, annotate, zoom, and export. No cloud, no streaming — ffmpeg and ffprobe wrapped behind forty-one typed tools.
7
+ Capture the desktop, a monitor, a window, or a region; sample a recording into frames the agent can actually look at; trim, crop, redact, annotate, zoom toward clicks, and export for GitHub or social. No cloud, no streaming: ffmpeg and ffprobe behind 41 typed tools.
8
8
 
9
9
  <br />
10
10
 
@@ -12,17 +12,17 @@ Capture the desktop, a monitor, a window, or a region; sample a recording into f
12
12
 
13
13
  <br />
14
14
 
15
+ [![npm](https://img.shields.io/npm/v/@tmhs/screencast-mcp?color=CB3837&logo=npm)](https://www.npmjs.com/package/@tmhs/screencast-mcp)
16
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-6E56CF)](https://registry.modelcontextprotocol.io/v0/servers?search=screencast-mcp)
15
17
  [![CI](https://github.com/TMHSDigital/screencast-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/TMHSDigital/screencast-mcp/actions/workflows/ci.yml)
16
18
  [![License: CC BY-NC-ND 4.0](https://img.shields.io/badge/license-CC--BY--NC--ND--4.0-green)](LICENSE)
17
19
  ![Last commit](https://img.shields.io/github/last-commit/TMHSDigital/screencast-mcp)
18
- ![Repo size](https://img.shields.io/github/repo-size/TMHSDigital/screencast-mcp)
19
- ![Top language](https://img.shields.io/github/languages/top/TMHSDigital/screencast-mcp)
20
20
 
21
21
  ![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)
22
22
  ![Node.js](https://img.shields.io/badge/Node.js_%E2%89%A522-339933?logo=node.js&logoColor=white)
23
23
  ![Model Context Protocol](https://img.shields.io/badge/MCP-stdio-6E56CF)
24
24
  ![ffmpeg](https://img.shields.io/badge/ffmpeg-required-007808?logo=ffmpeg&logoColor=white)
25
- ![Capture](https://img.shields.io/badge/capture-Windows_gdigrab-0078D6?logo=windows&logoColor=white)
25
+ ![Capture](https://img.shields.io/badge/capture-Windows_10%2F11-0078D6?logo=windows&logoColor=white)
26
26
 
27
27
  <br />
28
28
 
@@ -32,8 +32,31 @@ Capture the desktop, a monitor, a window, or a region; sample a recording into f
32
32
 
33
33
  </div>
34
34
 
35
- > [!NOTE]
36
- > Screen capture is Windows-only (`gdigrab`, plus Windows Graphics Capture for single windows); the watch, edit, and produce tools work anywhere ffmpeg runs. See [ROADMAP.md](ROADMAP.md) for what's next.
35
+ ## Quick start
36
+
37
+ **You need** Windows 10 or 11, [Node.js](https://nodejs.org) 22+, and ffmpeg on `PATH` (`winget install Gyan.FFmpeg`). Capture is Windows-only; the watch, edit, and produce tools work anywhere ffmpeg runs.
38
+
39
+ **Add it to your client:**
40
+
41
+ | Client | How |
42
+ | --- | --- |
43
+ | Claude Code | `claude mcp add screencast -- cmd /c npx -y @tmhs/screencast-mcp` |
44
+ | Claude Desktop | Download the `.mcpb` from the [latest release](https://github.com/TMHSDigital/screencast-mcp/releases/latest) and open it (one click) |
45
+ | Cursor, VS Code, others | The JSON config below, or step-by-step on [Connect your client](https://tmhsdigital.github.io/screencast-mcp/connect.html) |
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "screencast": { "command": "npx", "args": ["-y", "@tmhs/screencast-mcp"] }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Then ask your agent:**
56
+
57
+ > Record my VS Code window for five seconds while I reproduce the bug, then show me the frames where something changed.
58
+
59
+ More in the [workflows](https://tmhsdigital.github.io/screencast-mcp/workflows/): a bug-repro GIF for a PR, a README demo, a UI verification loop, a social clip, a cheap review of a long recording, zoom toward clicks, and the whole edit in one call.
37
60
 
38
61
  ## Overview
39
62
 
@@ -47,9 +70,17 @@ The design choices are deliberate rather than incidental:
47
70
  - **Safe by default.** Output lands under `SCREENCAST_HOME`, never inside a project checkout, and the public repo's `.gitignore` blocks captured media from being committed.
48
71
  - **Recordings end.** When the client disconnects (or the server gets SIGINT/SIGTERM), every active recording is finalized and the server exits. Every recording also has a `maxDurationSec` cap (default one hour). A recording interrupted by a hard crash is reconciled on the next start (orphan reaping).
49
72
 
73
+ What it can do beyond record-and-look:
74
+
75
+ - **Zoom toward clicks.** Record with `events: true` and `zoom` glides in on each click and rings it, Screen Studio style.
76
+ - **Review before sharing.** In clients with MCP Apps, `stop_recording` opens an inline player where a person trims and draws redaction boxes.
77
+ - **Find and cover secrets.** `find_text` reads the screen with Windows OCR and returns rectangles for `redact_region`.
78
+ - **One call, one encode.** `pipeline` runs trim, crop, redact, callouts, and an export as a single ffmpeg pass.
79
+ - **Record a covered window.** `backend: "wgc"` records a window's own surface through Windows Graphics Capture.
80
+
50
81
  ## Tools
51
82
 
52
- Thirty-seven tools across four concerns. The manifest in [`mcp-tools.json`](mcp-tools.json) is the canonical surface and is kept in sync with `src/tools/`.
83
+ 41 tools in six groups. The manifest in [`mcp-tools.json`](mcp-tools.json) is the canonical surface; tests keep it, this README, and the docs site in sync with `src/tools/`.
53
84
 
54
85
  ### Capture
55
86
 
@@ -138,64 +169,31 @@ Every capture tool takes a single `target` string, so an agent never has to jugg
138
169
  | `full` | The whole virtual desktop |
139
170
  | `monitor:<index>` | One display; `0` is always primary |
140
171
  | `window:<title>` | The on-screen rectangle a window occupies (case-insensitive exact title, else substring; topmost wins) |
172
+ | `window:exe=<app.exe>` | That app's topmost window, without relying on its title |
173
+ | `window:hwnd=<handle>` | One exact window by handle (hex `0x1A2B` or decimal) |
141
174
  | `region:<x>,<y>,<w>,<h>` | An absolute pixel rectangle |
142
175
 
143
- For `window:` targets, `screenshot` and `start_recording` both report `matchedWindow`, `matchCount`, `matchKind` (`exact` or `substring`), and the captured `region`. When the title matched only as a substring, or several windows matched, the result carries a `windowWarning` listing the candidate titles, so a generic title like `window:Code` cannot quietly record a different window. Pass `exactTitle: true` to refuse the substring fallback entirely.
144
-
145
- Set `SCREENCAST_MAX_RECORDING_SEC` to change the default recording cap (`0` disables it).
176
+ For `window:` targets, `screenshot` and `start_recording` both report `matchedWindow`, `matchCount`, `matchKind` (`exact`, `substring`, `exe`, or `hwnd`), and the captured `region`. When the title matched only as a substring, or several windows matched, the result carries a `windowWarning` listing the candidate titles, so a generic title like `window:Code` cannot quietly record a different window. Pass `exactTitle: true` to refuse the substring fallback entirely.
146
177
 
147
178
  Output is written under `SCREENCAST_HOME` (default `<homedir>/.screencast-mcp`) into `recordings/`, `frames/`, `screenshots/`, and `edits/`. Any tool also accepts an explicit output path.
148
179
 
149
180
  Edit and produce tools write to a `<name>.partial.<ext>` file next to the output and rename it into place only when ffmpeg succeeds, so a failed, timed-out, or cancelled job never leaves a truncated file at `output`. The job timeout scales with the media's length (at least 10 minutes, or 4x the duration); set `SCREENCAST_JOB_TIMEOUT_MS` to override it. Clients that send a progress token get `notifications/progress` updates while a job runs, and cancelling the request stops ffmpeg.
150
181
 
151
- ## Prerequisites
182
+ ## Configuration
152
183
 
153
- `ffmpeg` and `ffprobe` are external dependencies and must be on `PATH` (or pointed at via the `FFMPEG_PATH` / `FFPROBE_PATH` environment variables). The server detects them per call and returns a clear error with an install hint if either is missing.
184
+ `ffmpeg` and `ffprobe` must be on `PATH`, or pointed at with `FFMPEG_PATH` / `FFPROBE_PATH`; the server checks per call and returns an install hint if either is missing (macOS: `brew install ffmpeg`; Linux: `apt install ffmpeg`, for the non-capture tools).
154
185
 
155
- | Platform | Install |
156
- | --- | --- |
157
- | Windows | `winget install Gyan.FFmpeg` or `choco install ffmpeg` |
158
- | macOS | `brew install ffmpeg` |
159
- | Linux | `apt install ffmpeg` |
160
-
161
- ## Installation
162
-
163
- **Claude Desktop (one click):** download `screencast-mcp-<version>.mcpb` from the [latest release](https://github.com/TMHSDigital/screencast-mcp/releases/latest) and open it, or drag it into Settings > Extensions. Claude Desktop installs it with its own Node runtime. You can optionally pick an output folder, and point at `ffmpeg.exe` / `ffprobe.exe` if they are not on `PATH`.
164
-
165
- **Any MCP client (npm):**
166
-
167
- ```bash
168
- npm install -g @tmhs/screencast-mcp
169
- ```
170
-
171
- Or run it from a clone:
172
-
173
- ```bash
174
- git clone https://github.com/TMHSDigital/screencast-mcp.git
175
- cd screencast-mcp
176
- npm install
177
- npm run build # produces dist/index.js, the server entry point
178
- ```
179
-
180
- ### MCP client configuration
181
-
182
- ```json
183
- {
184
- "mcpServers": {
185
- "screencast": {
186
- "command": "npx",
187
- "args": ["-y", "@tmhs/screencast-mcp"]
188
- }
189
- }
190
- }
191
- ```
192
-
193
- > [!TIP]
194
- > Running from a clone instead of the published package? Point the client straight at the build: `"command": "node"`, `"args": ["C:/path/to/screencast-mcp/dist/index.js"]`.
186
+ | Variable | Default | Purpose |
187
+ | --- | --- | --- |
188
+ | `SCREENCAST_HOME` | `<homedir>/.screencast-mcp` | Where recordings, frames, screenshots, and edits are written |
189
+ | `SCREENCAST_MAX_RECORDING_SEC` | `3600` | Default recording cap (`0` disables it) |
190
+ | `SCREENCAST_JOB_TIMEOUT_MS` | scales with length | Override the edit job timeout |
191
+ | `SCREENCAST_WHISPER_MODEL` | none | whisper.cpp model for `transcribe` |
192
+ | `FFMPEG_PATH` / `FFPROBE_PATH` | `PATH` lookup | Explicit ffmpeg / ffprobe binaries |
195
193
 
196
194
  ## Usage
197
195
 
198
- **Workflows:** copy-paste recipes with the tool calls and real outputs are on the docs site: [bug-repro clip for a PR](https://tmhsdigital.github.io/screencast-mcp/workflows/bug-repro.html), [README demo GIF](https://tmhsdigital.github.io/screencast-mcp/workflows/demo-gif.html), [agent UI verification loop](https://tmhsdigital.github.io/screencast-mcp/workflows/verify-ui.html), [social clip](https://tmhsdigital.github.io/screencast-mcp/workflows/social-clip.html), and [reviewing a long recording](https://tmhsdigital.github.io/screencast-mcp/workflows/review-recording.html). Setup for Claude Code, Claude Desktop, Cursor, and VS Code: [Connect your client](https://tmhsdigital.github.io/screencast-mcp/connect.html).
196
+ **Workflows:** copy-paste recipes with the tool calls and real outputs are on the docs site: [bug-repro clip for a PR](https://tmhsdigital.github.io/screencast-mcp/workflows/bug-repro.html), [README demo GIF](https://tmhsdigital.github.io/screencast-mcp/workflows/demo-gif.html), [agent UI verification loop](https://tmhsdigital.github.io/screencast-mcp/workflows/verify-ui.html), [social clip](https://tmhsdigital.github.io/screencast-mcp/workflows/social-clip.html), [reviewing a long recording](https://tmhsdigital.github.io/screencast-mcp/workflows/review-recording.html), [zoom toward every click](https://tmhsdigital.github.io/screencast-mcp/workflows/zoom-clicks.html), and [the whole edit in one call](https://tmhsdigital.github.io/screencast-mcp/workflows/pipeline.html).
199
197
 
200
198
  A typical watch loop — record, sample, look:
201
199
 
@@ -238,7 +236,8 @@ It also offers **resources**, so a client can list and attach recordings without
238
236
  ## Windows notes
239
237
 
240
238
  - **Multi-monitor offsets.** `gdigrab` has no "capture monitor N" selector, so a monitor target captures the whole virtual desktop and crops to that display's pixel bounds (from `System.Windows.Forms.Screen.AllScreens`). `monitor:1` grabs the second display at its real offset; `monitor:0` is always primary.
241
- - **Window capture** resolves the window to the on-screen **rectangle** it occupies and captures that, rather than the window's own surface — `gdigrab`'s native `title=` grab returns a blank frame for GPU- or DirectComposition-composited windows (Chrome, Electron, UWP). Target it by title, or without relying on the title by `window:exe=Code.exe` (that app's topmost window) or `window:hwnd=0x1A2B` (one exact window); results report the matched title. The window must be **visible, on top, and not minimized** (a minimized window is rejected with a clear error), the capture includes anything drawn over that rectangle, and for `start_recording` the rectangle is fixed **once at start**. For stills, `backend: "wgc"` on `screenshot` and `find_text` captures the window's **own surface** through Windows Graphics Capture (FFmpeg 8+ `gfxcapture`, by window handle), even when other windows cover it. It takes 1-2 s instead of ~0.2 s, so it is opt-in. `start_recording` takes `backend: "wgc"` too: it records the window's own surface (its client area) while it is covered, moved, or in the background. `gfxcapture` only emits a frame when the window presents, so a small recorder process repaints one pixel of the window every 200 ms and repeats the latest frame at the requested fps; it stops on `q` like ffmpeg, so `stop_recording` and `maxDurationSec` work the same. The first frame takes a second or two, and `start_recording` returns once it is captured. No audio with `wgc` yet.
239
+ - **Window capture** resolves the window to the on-screen **rectangle** it occupies and captures that, rather than the window's own surface — `gdigrab`'s native `title=` grab returns a blank frame for GPU- or DirectComposition-composited windows (Chrome, Electron, UWP). Target it by title, or without relying on the title by `window:exe=Code.exe` (that app's topmost window) or `window:hwnd=0x1A2B` (one exact window); results report the matched title. The window must be **visible, on top, and not minimized** (a minimized window is rejected with a clear error), the capture includes anything drawn over that rectangle, and for `start_recording` the rectangle is fixed **once at start**. Use `backend: "wgc"` (below) to capture the window itself instead.
240
+ - **Windows Graphics Capture (`backend: "wgc"`, FFmpeg 8+).** Captures a window's **own surface** by handle, even when other windows cover it. On `screenshot` and `find_text` it takes 1-2 s instead of ~0.2 s, so it is opt-in. On `start_recording` it records the window's client area while it is covered, moved, or in the background. `gfxcapture` only emits a frame when the window presents, so a small recorder process repaints one pixel of the window every 200 ms and repeats the latest frame at the requested fps; it stops on `q` like ffmpeg, so `stop_recording` and `maxDurationSec` work the same. The first frame takes a second or two, and `start_recording` returns once it is captured. No audio with `wgc` yet.
242
241
  - **Fullscreen-exclusive apps** often produce black frames under `gdigrab`; run the source in borderless-windowed mode for reliable capture.
243
242
  - **System audio needs a loopback device.** `gdigrab` is video-only, so `start_recording` with `audio.source` = `system` captures from a separate dshow input. Windows has no native loopback, so this needs a virtual-audio device (enable Stereo Mix, or install a driver such as screen-capture-recorder's `virtual-audio-capturer` or VB-CABLE). Run `list_audio_devices` to find it. Microphone capture is intentionally not supported.
244
243
 
@@ -261,11 +260,15 @@ It also offers **resources**, so a client can list and attach recordings without
261
260
  .
262
261
  ├── src/
263
262
  │ ├── index.ts # MCP server entry (stdio); registers every tool, reaps orphans
264
- │ ├── context.ts # shared session-store singleton
265
- │ ├── tools/ # one file per tool (capture, watch, edit)
266
- │ ├── utils/ # ffmpeg, monitors, windows, sessions, paths, targets
267
- │ └── __tests__/ # vitest unit tests + guarded local-capture harness
268
- ├── docs/ # GitHub Pages documentation site
263
+ │ ├── prompts.ts # MCP prompts (workflows as slash commands)
264
+ │ ├── resources.ts # MCP resources (sessions, posters)
265
+ │ ├── wgcRecorder.ts # recorder process for backend: "wgc"
266
+ │ ├── tools/ # one file per tool
267
+ │ ├── utils/ # pure builders and helpers (ffmpeg args, targets, sessions, ...)
268
+ │ └── __tests__/ # vitest: unit, ffmpeg integration, guarded local-capture harness
269
+ ├── assets/ # bundled fonts and the review player (assets/ui)
270
+ ├── docs/ # GitHub Pages site (scripts/build-docs-pages.mjs writes the recipe pages)
271
+ ├── scripts/ # Claude Desktop bundle (.mcpb) and docs page builders
269
272
  ├── mcp-tools.json # canonical tool manifest (kept in sync with src/tools)
270
273
  ├── server.json # MCP Registry listing (name matches package.json mcpName)
271
274
  ├── .github/workflows/ # CI, release, npm publish, Pages, ecosystem drift check
@@ -276,12 +279,16 @@ It also offers **resources**, so a client can list and attach recordings without
276
279
  ## Development
277
280
 
278
281
  ```bash
282
+ git clone https://github.com/TMHSDigital/screencast-mcp.git
283
+ cd screencast-mcp
279
284
  npm install
280
285
  npm run build # tsc -> dist/
281
286
  npm test # vitest: unit tests, plus the ffmpeg integration suite when ffmpeg is on PATH
282
287
  npm run dev # tsx watch
283
288
  ```
284
289
 
290
+ To run your build from a client, point it at `dist/index.js`: `"command": "node"`, `"args": ["C:/path/to/screencast-mcp/dist/index.js"]`.
291
+
285
292
  The integration suite (`src/__tests__/integration`) runs the real edit and produce builders through ffmpeg against lavfi-generated fixtures and checks the probed result (durations, dimensions, streams, loudness). It skips when ffmpeg is missing; set `REQUIRE_FFMPEG=1` to make a missing ffmpeg fail instead, as CI's Linux job does.
286
293
 
287
294
  The capture path can't be exercised on CI's headless Linux runners, so an end-to-end harness lives behind a flag and is skipped by default:
@@ -296,7 +303,7 @@ Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md)
296
303
 
297
304
  ## License
298
305
 
299
- Released under the [CC-BY-NC-ND-4.0](LICENSE) license.
306
+ Released under the [CC-BY-NC-ND-4.0](LICENSE) license: free to use and share for non-commercial purposes, with attribution and without modification. For other uses, [open an issue](https://github.com/TMHSDigital/screencast-mcp/issues).
300
307
 
301
308
  <div align="center">
302
309
  <br />
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmhs/screencast-mcp",
3
- "version": "0.33.0",
4
- "description": "MCP server for Windows screen recording, frame sampling, and minimal ffmpeg edits",
3
+ "version": "0.33.1",
4
+ "description": "Let AI agents record the Windows screen, watch it as frames, and edit it with ffmpeg",
5
5
  "mcpName": "io.github.TMHSDigital/screencast-mcp",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -33,17 +33,25 @@
33
33
  "type": "git",
34
34
  "url": "git+https://github.com/TMHSDigital/screencast-mcp.git"
35
35
  },
36
- "homepage": "https://github.com/TMHSDigital/screencast-mcp#readme",
36
+ "homepage": "https://tmhsdigital.github.io/screencast-mcp/",
37
37
  "bugs": {
38
38
  "url": "https://github.com/TMHSDigital/screencast-mcp/issues"
39
39
  },
40
40
  "keywords": [
41
41
  "mcp",
42
+ "mcp-server",
42
43
  "model-context-protocol",
44
+ "ai-agents",
45
+ "claude",
43
46
  "screen-recording",
47
+ "screen-capture",
48
+ "screencast",
44
49
  "screenshot",
45
50
  "ffmpeg",
46
- "gdigrab",
51
+ "gif",
52
+ "video-editing",
53
+ "ocr",
54
+ "redaction",
47
55
  "windows",
48
56
  "developer-tools"
49
57
  ],