
Pir Mcp
io.github.Solteris-Dev由 GitHub 帳號 Solteris-Dev 發布v0.1.0更新於 Oct 24, 2026
Motion sensor for AI agents: tells when a screen region changes or goes still. Scores, never pixels.
概覽
讓助理監看指定的螢幕區域,並以數值分數而非影像回報區域是否變動或已靜止。
- 可以做什麼
- 它定義具名的螢幕矩形或視窗並視需要取樣,在粗略的平均顏色網格上回傳兩個變化分數:rmse 代表整個區域是否移動,peak 代表變化最大的單一格子。工具包含由人繪製區域的 pir_pick_region 與 pir_pick_mask、用於腳本化幾何的 pir_define_region 與 pir_define_window、一次性檢查的 pir_sample,以及阻塞等待區域變動或靜止的 pir_wait_for_change 與 pir_wait_for_stillness。它從不回傳像素、影像檔案或任何可還原成圖片的內容。
- 適用情境
- 適合驅動桌面的助理在不看螢幕的情況下判斷某處是否變動或停止變動,例如等待建置輸出更新,或偵測狀態列是否凍結。適用於長時間監看,此時截圖既不必要也過於揭露。
- 執行需求
- 以 npm 套件(npx pir-mcp)在本機執行,需要 Node 20+。需要能將二進位 PPM 寫到標準輸出的截圖工具,透過 PIR_CAPTURE_CMD 設定(wlroots 下預設為 grim)。可選的選取器與視窗命令透過 PIR_SELECT_CMD、PIR_PICK_WINDOW_CMD 與 PIR_WINDOW_GEOMETRY_CMD 設定;留空會停用對應工具。僅限桌面。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pir Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
pir-mcp
A motion sensor for AI agents.
"Gives your LLM agents enough info to be a helpful "watcher" without being a privacy nightmare like Windows Recall" -Solteris-Dev
[pir-mcp MCP server – quality and maintenance score on Glama]
A PIR sensor tells you that something moved, never what. This is the same idea for a screen: an MCP server that watches named rectangles and answers "did this change?" and "has this gone still?" with a number, a size and a timestamp. No tool in it returns pixels, image files, or anything that could be turned back into a picture.
It exists because an agent driving a desktop keeps needing the same two things: wake me when the build output moves and tell me if this status bar has stopped ticking. Both are motion questions. Neither needs a screenshot.
What it does
pir_pick_regionask the person at the screen to draw the rectangle, the way a regional screenshot works (slurp, slop). The human chooses what is sensed; the agent gets the geometry. Use this whenever someone is there.pir_pick_maskthe same gesture for a patch inside a region to ignore (a clock, a spinner, a caret).pir_define_regionthe scriptable path: name a rectangle by global layout coordinates, with optional masks.pir_pick_window/pir_define_windowwatch a window instead of a fixed rectangle. Its geometry is looked up again before every capture, so the region follows the window when it moves; a resize counts as maximal change. The pick offers your visible windows as boxes to click.pir_samplecapture once, score against the previous sample of that region. Cheap; also the way to check the capture command works.pir_wait_for_changeblock until the region departs from how it looked when the call began, or time out. A doorbell.pir_wait_for_stillnessblock until nothing has changed forstill_for_ms, or time out. A short window means "the animation settled, safe to act". A long window on something that should keep changing means it is frozen, andstill=trueis the alarm.pir_list_regions,pir_remove_regionhousekeeping.
Every comparison reports two numbers over a coarse grid of averaged colour cells (at most 64 across, each at least 4 px), both 0 for identical and 1 for black against white:
rmseover the whole grid: did the region as a whole move? A cursor edge or an antialiased caret scores about 0.02; a dialog opening 0.1 or more. This is the default metric, threshold 0.05.peakthe single most-changed cell: did anything in it move? A clock digit flipping inside a 1920-wide status bar scores rmse 0.018 (invisible to the default) but peak 0.145. Usemetric=peakfor a small thing that should tick inside a larger region.
Averaging is what makes this a sensor rather than a camera: 64 cells cannot be read.
What it deliberately does not do
- It never returns image data. There is no snapshot tool and none is planned. If an agent needs to see, use the screenshot tool your environment already has, so that choice stays explicit and yours.
- It never writes frames to disk. A capture lives in memory for the milliseconds it takes to reduce it to a grid, and only the grid of the last sample is kept per region.
- It does not capture on its own. Every sample is a tool call the agent made,
visible in the transcript, and
pir_pick_regioncarries apurposeline the agent has to write down before you draw.
What it does reveal, so you can decide whether that is acceptable: that a given rectangle changed, at a given time, by a given magnitude. On a region covering a chat window that is presence information. Choose regions accordingly; the server has no opinion.
The capture itself is delegated to a command you configure, run with your
privileges. The default is grim, so nothing here has screen access that you
did not already give to grim.
Install
It is on npm as pir-mcp and in
the official MCP Registry
as io.github.Solteris-Dev/pir-mcp, so most clients can run it with
npx -y pir-mcp and no clone:
From source:
Requires Node 20+ and a screenshot tool that can write binary PPM to stdout.
Capture command
PIR_CAPTURE_CMD is a template; {x} {y} {w} {h} are substituted and the
result runs under sh -c. It must print a binary PPM (P6) to stdout.
Coordinates are whatever the capture tool uses. On a wlroots layout that is the global layout, so an output placed left of the primary has negative x.
Selector command
PIR_SELECT_CMD runs when an agent calls pir_pick_region or
pir_pick_mask and must print x,y wxh. Set it to an empty string to remove
those tools entirely.
Window commands
PIR_WINDOW_GEOMETRY_CMD gets {id} substituted and must print x,y wxh
for that window; PIR_PICK_WINDOW_CMD must print the id of the window the
person chose. Both default to Hyprland (via jq and slurp -r). Set either
to an empty string to remove the corresponding tools. Window ids are limited
to [A-Za-z0-9_.:-] before they reach a shell.
Only the Hyprland pair has been run; the others are written from the tools' documentation.
Claude Code
Blocking calls default to 55 s and are capped by PIR_MAX_WAIT_MS (540 s).
Keep the cap under your host's MCP tool timeout; an agent that needs to watch
for longer just calls again.
Other settings
A regions file looks like:
Example
The case that produced this: a status bar that occasionally froze for hours while its process looked healthy. The clock in it should change every minute, so a bar that is still for three minutes is a frozen bar.
still=true comes back only if the bar stopped; otherwise the call returns
still=false at the timeout and the agent calls again. Nothing on the screen
was ever seen, and the person drew the rectangle themselves.
Contributing starting points
contrib/macos/ holds an AppKit rectangle selector and capture recipe,
written blind and untested. If you run it on a real Mac, fix what breaks and
send it back.
Tests
License
MIT.
來源:README.md,提交 833ded4
工具
0版本歷史
1- v0.1.0最新Sep 17, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分