Skip to content
Back to search

dsh-visual-mcp

把 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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/accoutmissing--dsh-visual-mcp/badge.svg)](/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
  1. # dsh-visual-mcp
  2. **简体中文** · [English](README.en.md)
  3. 把 **PhotoCraft**(位图)和 **VectorCraft**(矢量)的 MCP 服务器接进 DeepSeek Harness。
  4. 装好之后可以直接建文档、改图、导出,不用手动开软件。
  5. 这个包本身**没有 main 代码**:`cordis.patch.yml` 里只 insert 两次官方的
  6. `@deepseek-ai/dsh-mcp-client`,各自指向一个本机的 stdio 服务器。所以它叫「配置型 bundle」——
  7. 它的全部内容就是那几个启动参数,而启动参数就是路径。所以这个仓库真正解决的问题是:
  8. **路径不要写死在 YAML 里**。
  9. ## 它做了什么
  10. | 工具名前缀 | 后端 | 版本(装的时候) | 工具数 |
  11. | --- | --- | --- | --- |
  12. | `mcp__photocraft__*` | `photocraft-cli.exe mcp` | 0.18.0 | 26 |
  13. | `mcp__vectorcraft__*` | `vectorcraft-cli.exe mcp --headless` | 0.19.0 | 33 |
  14. Server 名就是调用时看到的前缀(`serverName` 键)。
  15. ## 配置:改 JSON,不改 YAML
  16. ```
  17. visual-mcp.config.json ──npm run configure──▶ cordis.patch.yml
  18. ↑ 人改这里 ↑ 机器生成,别手改
  19. ```
  20. `cordis.patch.yml` 首行写着「本文件由脚本生成」。手改它也能跑,但下一次 `npm run configure`
  21. 会被覆盖——与其靠记性,不如让生成器每次把 YAML 整份重写。
  22. 为什么非得加这一层:**Cordis 的 patch 文件不做环境变量插值**(`patch.ts` 里只有 insert / config
  23. 的合并,没有 `${...}` 展开),所以「可配置」在 patch 这一层无处落脚,只能落在一个生成器上。
  24. ```bash
  25. npm run configure # 按配置重写 cordis.patch.yml
  26. npm run check # 只比对不写:磁盘上的 YAML 不是这份配置的产物就退出 1(CI / 测试用)
  27. npm test # 生成器 + 两个 CLI 真启动
  28. ```
  29. ### 字段
  30. | 键 | 含义 |
  31. | --- | --- |
  32. | `photocraft.command` | CLI 绝对路径 |
  33. | `photocraft.args` | 固定前缀参数(默认 `["mcp"]`) |
  34. | `photocraft.roots[]` | `{ path, mode }`,`mode` 取 `read` / `read-write`(缺省 `read-write`) |
  35. | `vectorcraft.*` | 同上 |
  36. `roots` 里只出现一次路径,生成器负责展开成 `--automation-read-root`(所有根)和
  37. `--automation-write-root`(`read-write` 的根)。**不要把这两个 flag 写进 `args`**,否则路径会出现两遍。
  38. 任何键删掉、留空、写空白串 = 回落到脚本里的默认值,也就是作者本机现值。所以「不写配置」
  39. 和「写今天这份配置」生成的是同一份 patch(`test/configure.test.mjs` 第 2 条断言就在钉这个)。
  40. ### 环境变量(可选,覆盖配置里的同名项)
  41. | 变量 | 作用 |
  42. | --- | --- |
  43. | `DSH_VISUAL_MCP_WORKSPACE` | 把所有**等于默认工作区**的根换成这个路径;其它根不动 |
  44. | `DSH_VISUAL_MCP_PHOTOCRAFT_CLI` | PhotoCraft CLI 路径 |
  45. | `DSH_VISUAL_MCP_VECTORCRAFT_CLI` | VectorCraft CLI 路径 |
  46. 空串 / 纯空白一律视为「没设」,与 `dsh-feishu-board` 的语义保持一致。
  47. 换机器的最小动作:设一个 `DSH_VISUAL_MCP_WORKSPACE`,跑 `npm run configure`,重装 bundle。
  48. ## 文件权限:两个 CLI 的规则不一样
  49. 两个 CLI 都**默认不给任何文件权限**,必须在启动参数里授予目录。差别是实测踩出来的:
  50. - **VectorCraft 可以重复给**:`--automation-read-root` / `--automation-write-root` 每个都能出现多次,
  51. 落在任一目录内都算允许。
  52. - **PhotoCraft 只能各给一次**:第二次传同一参数直接退出,报
  53. `error: the argument '--automation-read-root <DIR>' cannot be used multiple times`。
  54. 这条报错在宿主里会变成 `initial connection or tool synchronization failed`,
  55. 看着像连接问题,其实是参数问题。
  56. 所以默认配置是:
  57. - PhotoCraft:读 = 写 = 工作区(一个目录,两头都给它)。要处理别处的图,先复制进来、改完再复制出去。
  58. - VectorCraft:读 = 工作区 + `F:\工作` + `C:\ProgramData\shifeng` + Downloads;
  59. 写 = 工作区 + `F:\工作` + Downloads(知识库只读)。
  60. 路径必须是绝对路径;相对路径会按宿主 spawn 时的 cwd 解析,结果不可预期。
  61. ## 越界是带原因的报错,不是静默失败
  62. 实测:
  63. ```
  64. doc_new 400x300 #F0E9DB → {"document":0} 建文档成功
  65. doc_save .tmp-mcp/mcp-smoke-test.png → 写入成功 写权限有效
  66. doc_open C:\Windows\win.ini → Error: automation path rejected:
  67. absolute paths must be inside the automation root
  68. ```
  69. ## 装 / 卸
  70. ```text
  71. plugin_manager { action: "install_bundle", target: "D:/path/to/dsh-visual-mcp" }
  72. ```
  73. 返回 `application: "applied"` 即生效。装过之后**改 patch 必须重装**才会重新 spawn 服务器
  74. (已安装时 `install_bundle` 会报 already-installed):
  75. ```text
  76. plugin_manager { action: "remove_bundle", target: "@local/dsh-visual-mcp" }
  77. plugin_manager { action: "install_bundle", target: "D:/path/to/dsh-visual-mcp" }
  78. ```
  79. ## 边界
  80. - 只接两个 CLI;CLI 没装、路径写错,宿主报的是「连接失败」,先看 `npm run check` 生成的参数对不对。
  81. - `--headless` 是 VectorCraft 的;PhotoCraft 不走 GUI,不需要这个参数。
  82. - 工具数量随 CLI 版本变,本仓库不锁 CLI 版本。
  83. ## 许可
  84. MIT。见 [LICENSE](LICENSE)。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.