Back to search
dsh-visual-mcp
MCP serverGitHub
把 PhotoCraft 与 VectorCraft 作为 MCP 服务器接进 DeepSeek Harness;CLI 路径与目录授权由一份 JSON 配置生成,默认值即作者本机现值|PhotoCraft and VectorCraft as DSH MCP servers, configured by JSON
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Checked today
Badge for your README
Markdown
[](/listings/accoutmissing--dsh-visual-mcp)HTML
<a href="/listings/accoutmissing--dsh-visual-mcp"><img src="/api/listings/accoutmissing--dsh-visual-mcp/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 120 lines
- # dsh-visual-mcp
- **简体中文** · [English](README.en.md)
- 把 **PhotoCraft**(位图)和 **VectorCraft**(矢量)的 MCP 服务器接进 DeepSeek Harness。
- 装好之后可以直接建文档、改图、导出,不用手动开软件。
- 这个包本身**没有 main 代码**:`cordis.patch.yml` 里只 insert 两次官方的
- `@deepseek-ai/dsh-mcp-client`,各自指向一个本机的 stdio 服务器。所以它叫「配置型 bundle」——
- 它的全部内容就是那几个启动参数,而启动参数就是路径。所以这个仓库真正解决的问题是:
- **路径不要写死在 YAML 里**。
- ## 它做了什么
- | 工具名前缀 | 后端 | 版本(装的时候) | 工具数 |
- | --- | --- | --- | --- |
- | `mcp__photocraft__*` | `photocraft-cli.exe mcp` | 0.18.0 | 26 |
- | `mcp__vectorcraft__*` | `vectorcraft-cli.exe mcp --headless` | 0.19.0 | 33 |
- Server 名就是调用时看到的前缀(`serverName` 键)。
- ## 配置:改 JSON,不改 YAML
- ```
- visual-mcp.config.json ──npm run configure──▶ cordis.patch.yml
- ↑ 人改这里 ↑ 机器生成,别手改
- ```
- `cordis.patch.yml` 首行写着「本文件由脚本生成」。手改它也能跑,但下一次 `npm run configure`
- 会被覆盖——与其靠记性,不如让生成器每次把 YAML 整份重写。
- 为什么非得加这一层:**Cordis 的 patch 文件不做环境变量插值**(`patch.ts` 里只有 insert / config
- 的合并,没有 `${...}` 展开),所以「可配置」在 patch 这一层无处落脚,只能落在一个生成器上。
- ```bash
- npm run configure # 按配置重写 cordis.patch.yml
- npm run check # 只比对不写:磁盘上的 YAML 不是这份配置的产物就退出 1(CI / 测试用)
- npm test # 生成器 + 两个 CLI 真启动
- ```
- ### 字段
- | 键 | 含义 |
- | --- | --- |
- | `photocraft.command` | CLI 绝对路径 |
- | `photocraft.args` | 固定前缀参数(默认 `["mcp"]`) |
- | `photocraft.roots[]` | `{ path, mode }`,`mode` 取 `read` / `read-write`(缺省 `read-write`) |
- | `vectorcraft.*` | 同上 |
- `roots` 里只出现一次路径,生成器负责展开成 `--automation-read-root`(所有根)和
- `--automation-write-root`(`read-write` 的根)。**不要把这两个 flag 写进 `args`**,否则路径会出现两遍。
- 任何键删掉、留空、写空白串 = 回落到脚本里的默认值,也就是作者本机现值。所以「不写配置」
- 和「写今天这份配置」生成的是同一份 patch(`test/configure.test.mjs` 第 2 条断言就在钉这个)。
- ### 环境变量(可选,覆盖配置里的同名项)
- | 变量 | 作用 |
- | --- | --- |
- | `DSH_VISUAL_MCP_WORKSPACE` | 把所有**等于默认工作区**的根换成这个路径;其它根不动 |
- | `DSH_VISUAL_MCP_PHOTOCRAFT_CLI` | PhotoCraft CLI 路径 |
- | `DSH_VISUAL_MCP_VECTORCRAFT_CLI` | VectorCraft CLI 路径 |
- 空串 / 纯空白一律视为「没设」,与 `dsh-feishu-board` 的语义保持一致。
- 换机器的最小动作:设一个 `DSH_VISUAL_MCP_WORKSPACE`,跑 `npm run configure`,重装 bundle。
- ## 文件权限:两个 CLI 的规则不一样
- 两个 CLI 都**默认不给任何文件权限**,必须在启动参数里授予目录。差别是实测踩出来的:
- - **VectorCraft 可以重复给**:`--automation-read-root` / `--automation-write-root` 每个都能出现多次,
- 落在任一目录内都算允许。
- - **PhotoCraft 只能各给一次**:第二次传同一参数直接退出,报
- `error: the argument '--automation-read-root <DIR>' cannot be used multiple times`。
- 这条报错在宿主里会变成 `initial connection or tool synchronization failed`,
- 看着像连接问题,其实是参数问题。
- 所以默认配置是:
- - PhotoCraft:读 = 写 = 工作区(一个目录,两头都给它)。要处理别处的图,先复制进来、改完再复制出去。
- - VectorCraft:读 = 工作区 + `F:\工作` + `C:\ProgramData\shifeng` + Downloads;
- 写 = 工作区 + `F:\工作` + Downloads(知识库只读)。
- 路径必须是绝对路径;相对路径会按宿主 spawn 时的 cwd 解析,结果不可预期。
- ## 越界是带原因的报错,不是静默失败
- 实测:
- ```
- doc_new 400x300 #F0E9DB → {"document":0} 建文档成功
- doc_save .tmp-mcp/mcp-smoke-test.png → 写入成功 写权限有效
- doc_open C:\Windows\win.ini → Error: automation path rejected:
- absolute paths must be inside the automation root
- ```
- ## 装 / 卸
- ```text
- plugin_manager { action: "install_bundle", target: "D:/path/to/dsh-visual-mcp" }
- ```
- 返回 `application: "applied"` 即生效。装过之后**改 patch 必须重装**才会重新 spawn 服务器
- (已安装时 `install_bundle` 会报 already-installed):
- ```text
- plugin_manager { action: "remove_bundle", target: "@local/dsh-visual-mcp" }
- plugin_manager { action: "install_bundle", target: "D:/path/to/dsh-visual-mcp" }
- ```
- ## 边界
- - 只接两个 CLI;CLI 没装、路径写错,宿主报的是「连接失败」,先看 `npm run check` 生成的参数对不对。
- - `--headless` 是 VectorCraft 的;PhotoCraft 不走 GUI,不需要这个参数。
- - 工具数量随 CLI 版本变,本仓库不锁 CLI 版本。
- ## 许可
- MIT。见 [LICENSE](LICENSE)。
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.