shutter-cull-mcp

shutter-cull-mcp

Enables AI agents to cull photo shoots by evaluating sharpness, eye-openness, and aesthetics, and writing reversible XMP sidecars for Lightroom, with strict safety gates to prevent unauthorized writes.

Category
访问服务器

README

shutter-cull-mcp

CI MIT License Python 3.11+

English | Espanol

An MCP server that lets an AI agent cull your photo shoot, and cannot run away with it.

It wraps shutter-cull, which scores frames for sharpness, eye-openness and aesthetics and writes picks as XMP sidecars Lightroom reads natively. The engine was already safe to run. Handing it to an agent is a different problem, and this repo is the answer to that problem, not a thin RPC wrapper around a CLI.

The problem this solves

shutter-mcp is read-only, and its entire security story is that sentence. Adding writes to it would have cost the guarantee. So writes live here instead, behind their own envelope.

An agent that can write to a photo library is a different risk class from one that can read it. It can be prompt-injected by a filename. It can hallucinate a folder. It can call a tool it was told about but never showed anyone. And a confirm: true argument is no defense at all, because a model that will call the tool will also pass true.

So in this server, writing is not a tool an agent calls. It is a plan an agent must produce, show, and then quote back.

Five gates

  propose_picks ......... read-only. Returns a plan and a plan_id.
        |
        |  the agent shows the plan to the human
        v
  apply_picks(plan_id, confirm) .... refuses unless ALL of:
        |
        |   1  plan_id was issued by THIS running process
        |   2  the plan has not expired
        |   3  nothing under it changed since it was proposed
        |   4  confirm is the exact phrase "apply N changes"
        |   5  every frame still resolves inside an allowlisted root
        v
  sidecars written .... and journaled, so undo_last_apply reverses them

1. The plan_id cannot be forged. It is a sha256 over the root and over every frame's path, decision, size and mtime. An agent cannot construct one, guess one, or carry one over from another session. A restarted server honors none.

2. Plans expire. Thirty minutes, in memory only, never written to disk.

3. Staleness is re-checked at write time. Between a human approving a plan and the write landing, the library can move. If any frame was edited, replaced or deleted in that window, the apply is refused and names the files. Nothing partial is written.

4. The confirmation is not a boolean. It must be the literal string the plan printed, apply 12 changes, with the count matching. Quoting the blast radius back is cheap evidence that the plan was actually read. Reflexive confirmation is a real agent failure mode and a boolean invites it.

5. The root allowlist is fixed at startup. The server is launched with --root and refuses to start without one. No tool widens it. Paths are resolved through symlinks before the containment check, so a link that sits inside the allowlist and points outside is rejected on where it lands. Containment is checked again immediately before writing, because a symlink can be swapped in between.

And apply_picks takes no folder argument. A plan can only ever be applied to the folder it was proposed against, because there is nowhere to put a different one.

Everything is reversible

Every sidecar is snapshotted before it is touched. undo_last_apply restores each one exactly, and deletes the ones that did not exist before. A sidecar that something else edited after the write is left alone and reported by name rather than silently overwritten.

Two honest limits: undo is one step deep, and it does not survive a server restart. Persisting the journal would mean this server writing files it was never asked to write, which is a worse trade than losing undo across restarts.

What it never does

  • Never opens an original image file for writing. Only .xmp sidecars, beside the originals, which is the same non-destructive posture Lightroom itself uses for RAW metadata.
  • Never touches a path outside the allowlist.
  • Never writes without a plan that a human was shown.
  • Never makes a network call, except shutter-cull's own opt-in, checksum-verified model download.

Install

pip install git+https://github.com/keivanmalhani/shutter-cull-mcp.git

The engine is a separate install, because the safety envelope is useful to read and audit on its own:

pip install git+https://github.com/keivanmalhani/shutter-cull.git
brew install exiftool

server_status reports honestly when the engine is missing rather than failing mysteriously later.

Run

shutter-cull-mcp --root ~/Pictures/2026-shoots

Repeat --root for more folders. In an MCP client config:

{
  "mcpServers": {
    "shutter-cull": {
      "command": "shutter-cull-mcp",
      "args": ["--root", "/Users/you/Pictures/2026-shoots"]
    }
  }
}

Tools

Tool Writes What it does
propose_picks no Runs the full pipeline read-only and returns a plan plus a plan_id.
apply_picks yes Writes the sidecars for an already-proposed plan, behind all five gates.
undo_last_apply yes Reverses the last apply exactly.
explain_pick no Why one frame got its decision. A frame the engine left alone has no entry, and that absence is the answer.
list_plans no Live plans, newest first. If a plan is not listed it cannot be applied.
server_status no The allowlisted roots, which are the hard boundary on everything here.

A session

propose_picks(root="~/Pictures/canyon-2026")

  Cull plan for /Users/keivan/Pictures/canyon-2026
  412 frames analyzed.
  38 picks, 61 rejects, 313 left alone.
  ...
  plan_id: 8e2806e0ed2bfa8930c05349089e586a
  To apply, call apply_picks with that plan_id and confirm="apply 99 changes".

apply_picks(plan_id="8e28...", confirm="true")
  Refused: Confirmation did not match. To apply this plan the confirm
  argument must be exactly "apply 99 changes". This is deliberately not a
  boolean: quoting the change count back is evidence the plan was read.

apply_picks(plan_id="8e28...", confirm="apply 99 changes")
  Applied. 99 sidecars written: 38 picks, 61 rejects.
  Only .xmp sidecars were written. No original image file was opened for
  writing. Call undo_last_apply to reverse this.

Development

pip install -e ".[dev]"
pytest

51 tests, no engine required: the suite runs against a fake engine on purpose. What this server is made of is the safety envelope, and the envelope should be testable, fast, and auditable without the CV stack present. The tests are written as attacks: forging a token, replaying one, confirming reflexively, racing the human's approval, escaping the allowlist by symlink. The adapter is separately verified against the real engine end to end, including a full apply and undo through exiftool.

Family

shutter-cull is the engine. shutter-mcp is its read-only sibling, kept read-only on purpose. shutter-select does the same job for video.

License

MIT, see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选