BaihaWhite/mcp-ds-ocr

Plugin插件 Native原生 ⭐ 2 Vision & Media视觉与多媒体

Project Overview项目介绍

This is an OCR visual recognition plugin for DSH, compatible with OpenAI and Anthropic API protocols. It recognizes text from input images, outputs results with coordinate boxes, and auto re-scans low-confidence regions. You need to configure API info before use, and the API key is only stored locally.

这是DSH平台的OCR视觉识别插件,兼容OpenAI、Anthropic双API协议,可对传入图片做文字识别,输出带百分比/像素坐标框的识别结果,支持对低置信度文字自动区域重读合并。需配置API地址、密钥和模型后使用,API密钥仅本地存储。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:BaihaWhite/mcp-ds-ocr

把 BaihaWhite/mcp-ds-ocr 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-ocr · DSH OCR 视觉识别插件

视觉模型 OCR 插件(OpenAI / Anthropic 双协议):配置 API 格式 / API URL / API Key / Model Name(设置 → 插件 → 插件配置 的可折叠卡片),支持获取模型列表与测试连接按钮;ocr_recognize 工具对传入图片自动识别;结果百分比坐标化并以对角线两点方框描述;低置信度文字自动同图区域重读再识别并合并。

安装

方式一:插件商店(推荐,已收录)

仓库已打 topic:dsh-plugin 并被商店收录,package.json 已声明 dsh.bundle.patch:

  1. 打开 设置 → 插件 → 插件商店,搜索 dsh-ocr(或 BaihaWhite);
  2. 卡片点「安装」:自动 pnpm add github:BaihaWhite/mcp-ds-ocr + 写入 profile bundles;
  3. 重启 DSH 生效;之后可「更新 / 卸载 / 一键更新」。

方式二:手工挂载(本地开发)

ln -s /root/projects/mcp-ds-ocr ~/.dsh/profiles/web/dsh-ocr
ln -s ../dsh-ocr ~/.dsh/profiles/web/node_modules/dsh-ocr
# ~/.dsh/profiles/web/cordis.patch.yml 增加:
# - insert:
#     - id: dsh-ocr
#       name: 'dsh-ocr'
#       config: {}
# 重启 dsh web(watchdog 会自动拉起)

文件

文件 说明
lib/index.js 宿主半(ESM 无构建):ocr_recognize 工具、`/api/dsh-ocr/models
lib/client.js 浏览器半(ModuleLoader lazy-factory):设置 → 插件 的可折叠配置卡片
package.json 包清单:exports(. 宿主 / ./client 浏览器)、dsh.bundle.patch(商店安装)、dsh.client(浏览器自动发现)
cordis.patch.yml bundle patch:声明 dsh-ocr 插件行
plugin/ 早期动态 Cordis 版本源码存档(已由正式包取代)
test-400x300.png 400×300 测试图片

配置项(dsh-settings 持久化,全局生效)

字段 说明
apiFormat openai(POST {apiurl}/chat/completions,Bearer)或 anthropic(POST {apiurl}/v1/messages,x-api-key + anthropic-version,自动补 /v1)
apiurl 服务商 base URL
apikey 认证密钥(明文存于本机设置文件,请勿外传)
model 视觉模型名;「获取模型列表」拉取后可从旁侧下拉选择
threshold 置信度阈值(默认 0.7),低于阈值触发区域重读
coordMode both / percent / pixel
retryEnabled 是否自动区域重读(默认开)
maxRounds 重读最大轮数(1-3,默认 2)

工具

ocr_recognize(image_path, coord_mode?, retry_if_uncertain?, max_rounds?, focus_regions?, prompt_hint?)

  • image_path:绝对路径或工作区相对路径(PNG/JPEG/GIF/WebP,≤10MB;相对路径按 sandboxPolicy 工作区根 → 进程 cwd 解析)。
  • 结果每项:text、box_px(像素框)、box_pct(百分比框)、description(左上(x%, y%) → 右下(x%, y%))、confidence、retried。
  • 低置信度(< threshold)→ 同一图片按不确定区域像素框重读精读 → IoU 匹配按高置信合并,attempts 记录调用次数。
  • focus_regions:手动指定 [x1,y1,x2,y2] 区域精读一次。
  • 图片宽高由插件本地解析图片头(PNG/JPEG/GIF/WebP,无需图像库)。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-project-file-explorer 下一个 Next dsh-plugin-top →