dsh-screenshot-feedback-hook-mcp

visioninstall failsnpmMIT

Adds a take screenshot tool plus two optional automatic capture points, putting the screen into the conversation as an image block; requires an image-capable model.

下载量 / Downloads
956
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-screenshot-feedback-hook-mcp

Sandbox test results

StageResult
1 install✗
2 list—
3 mount—
4 boot—
First error
dsh: initialized profile web at /home/node/.dsh/profiles/web

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

dsh-screenshot-feedback-hook-mcp

[English](README.md) | 中文

一个 DeepSeek Harness 插件:让 agent 看到自己刚产出的真实画面 —— 前端页面、EasyEDA/CAD 工程图、任意桌面应用 —— 并据此自我纠正。

它是 screenshot-feedback-hook-mcp 的 dsh 那一半;截图与压缩仍然全部由 Python 包负责(mss + Pillow,Windows/Linux/macOS 通用),本插件只负责 dsh 这一侧的接线。

为什么要做原生插件,而不是直接桥接 Claude Code hook

Claude Code 的 hook 只能回传文本,能做到的极限就是把文件路径丢回去、指望 agent 自己去读。dsh 有持久图片附件服务,所以原生插件可以把截图提交进附件库、再作为真正的图片块送进对话 —— agent 什么都不用做。

路径 · 图片怎么到达模型

take_screenshot 工具 · 工具结果里直接带图片块

工具执行后(默认关) · 截图作为附加上下文随工具结果一起进上下文

轮次结束时(默认关) · 截图被 steer / inject 进下一步

前置条件

  • dsh v0.1.0-rc.8 或更高 —— 本插件用到的每个 API 都是对着这个 tag 核对过的。
  • PATH 上有 pnpm —— dsh plugin 是转发给它执行的。
  • 一个能跑 capture --json 的 screenshot-feedback-hook-mcp >= 0.3.0 —— 截图与压缩都由它做,装法见下面[三条路](#怎么把截图-cli-装上)。更早的版本没有这个子命令,插件会识别出来并点名让你升级。
  • macOS 上的屏幕录制授权 —— 而且未授权不一定会被检测出来,信任截图之前先读[平台注意事项](#平台注意事项)。
  • 一个支持图片输入的模型 —— 见[支持图片的模型](#支持图片的模型)。没有的话插件会拒绝截图,并说明怎么换。

怎么把截图 CLI 装上

插件对这个 CLI 的唯一接触点是配置里的 command / args 两个字段(见[配置](#配置)),它拿 command 去 PATH 上查一次可执行文件,仅此而已。所以下面三条随便挑一条,uv 不是硬性依赖,只是默认那条路。

A. 装 uv —— 默认配置直接可用,推荐

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

装完什么都不用改:默认就是 command: uvx + args: ['screenshot-feedback-hook-mcp'],uvx 会按需从 PyPI 拉包(首次需要联网)。

uv 自己不需要 Python —— 它是独立二进制,会按需下载解释器。所以对「机器上还没有可用 Python」的人,这条反而门槛最低;B 那条要求你先有 Python。

B. 已经有 Python,想常驻安装

pipx install screenshot-feedback-hook-mcp
# 或 uv tool install screenshot-feedback-hook-mcp

然后改配置。后应用的层会替换整个 config,所以要重述你想要的所有键:

# ~/.dsh/profiles/<name>/cordis.patch.yml
- id: screenshot-feedback
  name: dsh-screenshot-feedback-hook-mcp
  config:
    command: screenshot-feedback-hook-mcp
    args: []
    monitor: 0

C. 装在 venv 里,或者根本不想动 PATH

command 直接填绝对路径,其余同 B:

    command: C:\Users\you\proj\.venv\Scripts\screenshot-feedback-hook-mcp.exe
    args: []
command / args / cwd 不在设置卡片上 —— 它们决定去哪里找可执行文件,属于部署事实而不是用户偏好。所以走 B / C 必须编辑上面那个 YAML 文件,在设置页里点不出来。
好在装错了给的信息是可执行的:命令找不到时插件会直接告诉你「装 uv,或者 pipx 装完把 command 改成什么、args 清空」;装了旧版 Python 包时会点名让你升级,而不是丢一段 argparse usage 让你自己猜。

安装

本插件已经上架 awesome-dsh-plugin(vision 分类),可以直接从 dsh 的插件市场里装。市场卡片目前给的是下面那条 GitHub 写法 —— npm 写法要等对方的探针把 npm 链接补上,跟本仓库无关;手动敲下面这条 npm 命令是一直可用的。

dsh plugin --profile web add dsh-screenshot-feedback-hook-mcp
dsh web

然后让 agent「截个图,告诉我屏幕上是什么」。用别的 profile 就把 --profile 换掉。

从 GitHub 安装,以及为什么不能直接指向源码目录

插件市场给的是 git 写法,这条能用:pnpm 会克隆仓库、跑本包的 prepare 脚本把 lib/ 构建出来,再按打包结果安装。

dsh plugin --profile web add github:lkh081231/screenshot-feedback-hook-mcp#path:/dsh-plugin
pnpm 10 起对构建脚本设了闸门。 首次安装(构建产物还没进 pnpm 的内容寻址 store)可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED。在 ~/.dsh/profiles/<name>/pnpm-workspace.yaml 的 onlyBuiltDependencies 里放行即可 —— 照着报错里打印的那一行原样抄,然后重跑上面的命令。构建产物进了缓存之后就不再过这个闸门。

不要让 dsh plugin add 指向源码工作区。 dsh plugin --profile web add ./screenshot-feedback-hook-mcp/dsh-plugin 会把这个目录装成 pnpm 的 link:,它会以两种方式失败:

  • lib/ 是构建产物,不在 git 里。 pnpm 不会为 link 依赖跑 prepare,于是 main: "lib/index.js" 指向一个不存在的文件,dsh 启动即崩:
  dsh: plugin tree failed to load: ... Cannot find module
  '~/.dsh/profiles/web/node_modules/dsh-screenshot-feedback-hook-mcp/lib/index.js'
  • 就地构建能解决上一条,但会引出更糟的问题。 Node 按真实路径解析 link 过来的包,所以 npm install 之后落在 dsh-plugin/node_modules/ 里的那几份 @deepseek-ai/dsh-* 会盖住宿主的 —— 正是[从 0.1.0 升级](#从-010-升级必看)那节讲的双实例故障,它会让该 profile 里所有工具调用挂掉,不止截图。

要从 checkout 安装,先打包,让只有 files 白名单里的东西进 profile:

git clone https://github.com/lkh081231/screenshot-feedback-hook-mcp.git
cd screenshot-feedback-hook-mcp/dsh-plugin
npm install && npm run build && npm pack
dsh plugin --profile web add ./dsh-screenshot-feedback-hook-mcp-0.2.1.tgz

不管走哪条路,装完都确认 ~/.dsh/profiles/<name>/node_modules/@deepseek-ai/ 下**没有任何 dsh-* 包** —— 那里只该有 schemastery 和 cosmokit。

每个版本改了什么行为,见 [变更记录](CHANGELOG.zh.md)。

从 0.1.0 升级(必看)

0.1.0 会把 dsh 的运行时包当成普通依赖装进 profile,在 profile 里造出第二份 @deepseek-ai/dsh-tools,盖掉 dsh 自己那份。结果不只是截图不能用 —— 该 profile 里任何工具调用都会崩:

Cannot read properties of undefined (reading 'prepare')

0.1.1 起改成 peer 依赖,不会再往 profile 里装任何 dsh 包。已经装过 0.1.0 的,把被污染的 node_modules 一并清掉再装:

dsh plugin --profile web remove dsh-screenshot-feedback-hook-mcp
rm -rf ~/.dsh/profiles/web/node_modules
dsh plugin --profile web add dsh-screenshot-feedback-hook-mcp

装完确认一下 ~/.dsh/profiles/<name>/node_modules/@deepseek-ai/ 里**没有任何 dsh-***(只该有 schemastery 和 cosmokit)。

它是怎么注册进 dsh 的

本包是一个 dsh 组合包(bundle) —— 一个附带配置层的 npm 包,不需要你手写任何 patch。它靠 package.json 里的 dsh.bundle manifest 声明自己贡献什么:

{
  "name": "dsh-screenshot-feedback-hook-mcp",
  "main": "lib/index.js",
  "files": ["lib", "cordis.patch.yml"],
  "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
}

cordis.patch.yml 就是那一层,按包名引用插件模块(不是相对路径,否则 Node 解析不到已安装的代码):

- insert:
    - id: screenshot-feedback
      name: dsh-screenshot-feedback-hook-mcp
      config:
        command: uvx
        args: ['screenshot-feedback-hook-mcp']
        monitor: 0

dsh plugin --profile <name> add ... 会在 profile 目录里转发给 pnpm 装包,认出 dsh.bundle 后把包名追加进该 profile 的 dsh.profile.bundles:

{
  "name": "dsh-profile-web",
  "dependencies": { "dsh-screenshot-feedback-hook-mcp": "..." },
  "dsh": { "profile": { "bundles": [
    "@deepseek-ai/dsh-base

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::4,最后更新 2026-08-28

Links

GitHub · Homepage · npm

Same category