Maskbolt Segment Anything on CPU

io.github.skulitom由 GitHub 帳號 skulitom 發布v0.1.0更新於 Oct 24, 2026

Segment Anything on CPU for agents: cut out objects, find every object, export masks and outlines.

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

在本機 CPU 上執行 Segment Anything,讓助理從圖片中抠出物件、找出全部物件,並匯出遮罩、去背圖與輪廓。

可以做什麼
  • 在指定根目錄內開啟圖片,並取得附編號的預覽圖
  • 用網格或分塊提示找出全部物件,或點擊一個點、框選一個物件
  • 檢視並縮放附編號的預覽,刪除錯誤的遮罩,補點漏掉的物件
  • 檢查未覆蓋區域並補充候選,填補遮罩中的孔洞
  • 匯出疊加預覽 PNG、透明去背圖、含孔洞的 SVG 輪廓(可選公釐單位)、JSON 輪廓與標籤 PNG
適用情境
適合在沒有 GPU 的電腦上,讓助理為照片中的物件產生透明去背圖、遮罩或向量輪廓,例如把照片做成 sprite,或為雷射切割產生 SVG 輪廓。不適用於文字提示、描述圖片內容、影片,也不適合批次去除單一主體背景。
執行需求
需要在本機安裝二進位程式(從發行壓縮檔安裝或以 Rust 1.89 以上版本建置)並加入 PATH,Windows 也可使用 .mcpb 安裝包。啟動時以 mcp 子命令並指定圖片根目錄。首次執行會下載模型(預設 SAM ViT-B 375 MB,或 MobileSAM 41 MB)到快取資料夾,之後可離線使用。不需帳號或 API 金鑰。
安裝前請注意
只在設定的根目錄內讀寫檔案,但匯出會寫入新檔案,設定 overwrite 時可能覆蓋既有檔案。分塊尋找耗時長、佔用記憶體大(數分鐘、數 GB),長時間執行可能超過 MCP 客戶端的工具逾時。遮罩會漏掉細薄部分並留下孔洞,缺口檢查只是顏色啟發式判斷。唯一連網行為是首次下載模型。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Maskbolt Segment Anything on CPU,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Maskbolt

Segment Anything (SAM) on your CPU, for AI agents and scripts. Maskbolt is one Rust binary: an MCP server that lets an agent open an image, find every object or click one, look at numbered previews, fix mistakes, and export cutouts, outlines and masks; and a CLI for the same jobs in one command. No Python, no GPU.

  • Who it's for: people who want an AI agent (Claude Code, Claude Desktop or another MCP client) or a script to get objects out of photos: game and web makers turning photos into sprites and cutouts, makers who need the outline of a part or an offcut as SVG in millimetres for a laser cutter or a nesting tool, and developers whose agents need masks.

  • Use it when you need a transparent cutout, a mask or an outline (SVG with holes, or JSON) of particular objects in an image, or every object found, counted and outlined, on a computer with no GPU, offline after one model download.

  • Don't use it for text prompts ("all the dogs": SAM takes points and boxes, which the agent picks from numbered previews), naming what is in an image, video, real-time work (encoding takes about 6.5 s per image on a 16-core desktop CPU), or plain one-subject background removal in bulk, where a dedicated background remover is quicker.

  • Compared with other MCP servers: a search of GitHub, mcp.so, Glama and the official MCP Registry on 24 October 2026 found no other MCP server built on Segment Anything. The nearest are background-removal servers, which cut out one main subject and have no clicks, object finding or outline export.

  • One click cuts an object out as a transparent PNG; the three nested SAM masks (part, object, group) are one argument away.

  • "Find everything" runs grid prompts over the whole image or over overlapping tiles (each re-encoded at full model resolution, so small objects show up), drops masks cut by a tile edge, background patches, duplicates and masks inside others, and says why.

  • Every reply that changes masks says how many there are, why candidates were dropped, and which patches still look uncovered ("find more like these"), so an agent knows what is left.

  • Exports: overlay PNG (numbered masks, zoomable), cutout PNG, SVG (outer loops and holes, even-odd, optional millimetres), JSON (outlines with holes, area, box, score), labels PNG (one colour per mask).

  • Masks are stored cropped to their boxes, so a dense image with thousands of candidates stays small.

Install

Download the archive for your computer from the latest release: maskbolt-v0.1.0-x86_64-pc-windows-msvc.zip, maskbolt-v0.1.0-x86_64-unknown-linux-gnu.tar.gz (glibc 2.35 or newer), maskbolt-v0.1.0-aarch64-apple-darwin.tar.gz or maskbolt-v0.1.0-x86_64-apple-darwin.tar.gz. Check it against the release's SHA256SUMS, extract it and put maskbolt (maskbolt.exe on Windows) on your PATH; maskbolt version prints maskbolt 0.1.0. Each archive also holds the licence, THIRD_PARTY.txt and THIRD_PARTY_NOTICES.md (the licence texts of the Rust dependencies in that build). Or build it with Rust 1.89 or newer:

cargo install --git https://github.com/skulitom/Maskbolt --tag v0.1.0 --locked

Maskbolt is not on crates.io.

The first run downloads the model into a user cache folder and checks its SHA-256:

ModelFlagDownloadLicence
SAM ViT-B (Meta)default, --model vit-b375 MBApache-2.0
MobileSAM (TinyViT)--model tiny41 MBApache-2.0

Cache folder: %LOCALAPPDATA%\maskbolt\models on Windows, $XDG_CACHE_HOME/maskbolt/models or ~/.cache/maskbolt/models elsewhere; set MASKBOLT_MODEL_DIR to use another. maskbolt fetch downloads now. Maskbolt keeps the checked .pth next to the converted safetensors and records the converted file's SHA-256 in <name>.safetensors.sha256; every load re-checks it and rebuilds the file from the .pth if it does not match. Several Maskbolt processes can share the folder (unique temp names, atomic renames). Disk use per model is the checkpoint plus the converted file (ViT-B about 750 MB, MobileSAM about 81 MB). Minimum Rust: 1.89.

CLI

maskbolt cutout examples/chelsea.png --point 200,150 --out cat.pngmaskbolt cutout examples/coffee.png --point 300,225 --level largest --fill-holes --out cup-set.pngmaskbolt cutout photo.jpg --point 410,220 --exclude 380,300 --box 300,120,520,340 --out thing.pngmaskbolt find examples/corn.png --out kernels.json --overlay kernels.pngmaskbolt find examples/corn.png --tiles 400 --fill-gaps --out kernels.json --overlay kernels.pngmaskbolt find examples/bed.png --grid 12 --min-area 0.01 --max-area 0.3 --drop-hole-views \    --out offcuts.json --svg offcuts.svg --mm-per-px 0.5maskbolt mcp --root C:\work\imagesmaskbolt version

Outputs that already exist are refused unless you pass --force; the input image is never overwritten. One find uses at most 64 tiles and a 48x48 grid; past that it says how many tiles your settings give, about how long they would take, and which tile size fits. A tiled find has no whole-image pass: objects larger than about a third of a tile are dropped, so run a plain find first for big objects. Images are recognised by their content, not their extension, EXIF orientation is applied, and the limit is 100 megapixels.

--level: best (default, highest predicted IoU), smallest (a part), middle (the object), largest (the object with what it holds). find prints a JSON report (counts, drop reasons, timings, what is still uncovered).

MCP

{"mcpServers": {"maskbolt": {"command": "maskbolt", "args": ["mcp", "--root", "C:\\work\\images"]}}}
  • Claude Code: the plugin registers this server, rooted at the folder Claude Code runs in, and a maskbolt skill with the loop below. It needs maskbolt on PATH (see Install):

    claude plugin marketplace add skulitom/Maskboltclaude plugin install maskbolt@maskbolt

    or, inside Claude Code 2.1.275 or later, in one step: /plugin install maskbolt --marketplace skulitom/Maskbolt.

  • Claude Desktop (Windows x64): download maskbolt-windows-x64.mcpb from the release, double-click it (or Settings > Extensions > Advanced settings > Install Extension) and choose your image folder.

  • MCP Registry: listed as io.github.skulitom/maskbolt, with the Windows bundle and its SHA-256.

  • Docker (Linux image): the repository's Dockerfile builds the MCP server; mount your image folder at /data and keep the model in a volume:

    docker build -t maskbolt https://github.com/skulitom/Maskbolt.gitdocker run -i --rm -v "$PWD:/data" -v maskbolt-models:/cache maskbolt

    As an MCP server: {"command": "docker", "args": ["run", "-i", "--rm", "-v", "/path/to/images:/data", "-v", "maskbolt-models:/cache", "maskbolt"]}. The server runs as user 10001, so on Linux the folder must be writable by that user for exports. docker run --rm maskbolt version runs the CLI.

Long tiled finds take minutes: the plugin gives Maskbolt's tools a 10-minute timeout; other clients may stop waiting sooner (see Limits).

Tools: maskbolt_open, maskbolt_find, maskbolt_click, maskbolt_view, maskbolt_remove, maskbolt_gaps (add: true clicks the candidates), maskbolt_fill_holes, maskbolt_export. Find and view replies include a numbered PNG; click replies include a zoom on the new mask. The server reads and writes only inside --root (default: the folder it starts in; it refuses to start when that is a drive or file-system root or your home folder). Paths are checked before any file access: UNC and device paths (\\server\share, \\?\, \\.\, //host), other drives and anything .. takes outside the root are refused with one message. Exports never replace an existing file unless the call passes overwrite: true, and never replace the open image. View replies give image_x = region.x + preview_x / scale; previews are at most 1568 px on the long side. On first use the model downloads in the background; maskbolt_open says its size and asks to be called again if it is not done within 25 s.

The loop that works: open; find (add tile: 400 for small or dense objects) or click; view (zoom with region); remove wrong masks; click missed ones; gaps with add: true when replies list uncovered patches; export.

Speed (Ryzen 9 7950X3D, 16 cores, 64 GB, CPU only, release build, 2026-10-23)

StepSAM ViT-BMobileSAM (--model tiny)
Load model0.2 s0.05-0.2 s
Encode one image (any size; SAM works at 1024 px)6.3-6.8 s4.2-4.3 s
One click (decode + upsample the three masks)0.11-0.12 s0.13-0.14 s
cutout on chelsea.png, whole command6.8 s, 2.0 GB peak5.1 s, 0.5 GB peak
find corn.png 1200x1198, 32x32 grid30.8 s wall (23.5 s after encode), 228 masks, 3.3 GB peak29.4 s wall, 234 masks, 3.0 GB peak
find --tiles 400 (25 tiles, 16x16 each)221 s wall, 247 masks, 7.0 GB peaknot measured
find --tiles 400 --fill-gaps246 s wall, 256 masksnot measured

Tiles encode 4 at a time (MASKBOLT_ENCODE_THREADS, default 4; each holds about 1.2 GB at its peak; 1 gives about 3.3 GB peak and 332 s for the tiled corn run). Prompts decode on up to 16 threads (MASKBOLT_DECODE_THREADS). For comparison, the Node prototype (8-bit ONNX) took 199 s for the 32x32 corn run and 416 s for the tiled one.

Limits

  • CPU only. Encoding is the slow step (about 6.5 s per image or tile with ViT-B); MobileSAM encodes in about 4.2 s here, only 1.5x faster, because candle's CPU convolutions are slow. Memory peaks at 2-3.3 GB for one image and about 7 GB for tiled finds with 4 parallel encodes.
  • Long tiled finds can outlast an MCP client's tool timeout (the 400 px corn run, 25 tiles, takes 3.5 minutes; the cap of 64 tiles is about 4 to 10 minutes). There are no progress notifications yet.
  • SAM's masks miss thin parts and leave holes; use level, extra include/exclude points, and fill_holes.
  • Outlines are simplified with Douglas-Peucker (1.2 px by default; simplify_px in MCP exports); edges move by up to that tolerance. Coordinates are image pixels from the top-left corner (pixel x covers [x, x+1]).
  • The gap check is a colour heuristic: it finds look-alikes of what is already masked, not new kinds of object.

Privacy

Maskbolt runs on your computer; its only network request is the one-time model download. Privacy

Licence

MIT. Model weights: Apache-2.0 (Meta's SAM; MobileSAM). src/sam_decoder.rs is adapted from candle (MIT OR Apache-2.0); candle's licence texts are in THIRD_PARTY.txt. Release archives and the MCPB bundle add THIRD_PARTY_NOTICES.md with the licence texts of every Rust dependency in that build. Releasing: see mcpb/PUBLISHING.md.

來源:README.md,提交 49ccbb9

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

1
  1. v0.1.0最新Oct 24, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分