dsh-vision
Provides local OCR on macOS using the built-in Vision framework to extract text from images without uploading them.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dsh-visionRead the text in /path/to/screenshot.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dsh-vision
A tool that provides visual capabilities for DeepSeek Harness (dsh) plugins and Claude Code (MCP): local OCR (macOS / Windows) + cloud VLM (multi-vendor) image understanding.
DeepSeek's model API currently does not support image input, so read_image is unavailable. This plugin provides two tools to work around this limitation:
Tool | Capability | Cost |
| Recognizes text in images (macOS Vision / Windows built-in OCR, free and offline, Chinese and English) | Free |
| Understands the visual content of images (cloud VLM, multi-vendor, OpenAI-compatible endpoints) | Pay-as-you-go |
Features
🔒 Local OCR: macOS is based on Vision.framework, Windows on the built-in OCR engine; images never leave your machine, keeping your privacy safe
☁️ Cloud VLM: Defaults to Alibaba Cloud Bailian
qwen3-vl-flash(fast and cheap), OpenAI-compatible API, can be swapped for any provider🖼️ Auto compression: Uses
sipsto compress large images to 2048px / JPEG 85% before VLM calls, saving money and bandwidth🔑 Flexible key retrieval: Environment variable or
~/.dsh/.credentials.yaml🧪 Zero-dependency unit tests: Core logic covered with Node's built-in
node:test(13 test cases)🌏 Multi-vendor VLM: Built-in Bailian / SiliconFlow / Zhipu / Volcano Ark, OpenAI-compatible so any vendor can be added
🔌 Dual form: Works as both a dsh plugin and an MCP server (usable directly by MCP clients such as Claude Code)
🪟 Windows support: Includes a PowerShell OCR backend (Windows.Media.Ocr); the VLM channel is cross-platform
Related MCP server: DeepSeek Vision Bridge
Installation
Method A: Install from npm (recommended)
dsh plugin --profile web add @floatingsk/dsh-visionMethod B: Copy from source
# 把本仓库拷贝到你的 dsh profile 插件目录
cp -R dsh-vision ~/.dsh/profiles/node_modules/dsh-visionMethod C: Download precompiled binaries from GitHub Release (no compilation needed, recommended)
When maintainers push a v* tag, GitHub Actions automatically compiles on both macOS architectures and attaches the binaries to the Release:
Open the Releases page of this repository and select the latest version
Download according to your Mac's architecture:
Apple Silicon (M series):
vision-ocr-arm64Intel Mac:
vision-ocr-x86_64
Place it in the plugin directory and add execute permission:
cp vision-ocr-arm64 ~/.dsh/profiles/node_modules/dsh-vision/bin/vision-ocr
chmod +x ~/.dsh/profiles/node_modules/dsh-vision/bin/vision-ocrCompile the OCR binary (macOS requires Xcode Command Line Tools)
cd ~/.dsh/profiles/node_modules/dsh-vision
# 显式指定 clang 模块缓存目录(沙箱/受限环境下必需)
swiftc -Xcc -fmodules-cache-path="$PWD/.cache" -O bin/vision-ocr.swift -o bin/vision-ocrEnable the plugin in a profile patch
Edit ~/.dsh/profiles/web/cordis.patch.yml (the file corresponding to your profile) and append:
- insert:
- id: dsh-vision
name: 'dsh-vision'Configure the VLM API Key (required for describe_image)
Choose one of the following:
# 方式 A:环境变量
export DASHSCOPE_API_KEY=sk-xxx
# 方式 B:写入 dsh 凭据文件
echo 'DASHSCOPE_API_KEY: sk-xxx' >> ~/.dsh/.credentials.yamlGet the key from your VLM provider's console (default is Alibaba Cloud Bailian: bailian.console.aliyun.com).
Restart dsh
The tools become available after restarting. Note: you need to start a new conversation; the tool list is injected when the session begins.
Usage
Save the image to disk during the conversation and tell the agent its path:
看下 /path/to/image.png 里有什么
读取 /path/to/截图.png 中的文字The agent will automatically pick the appropriate tool (text reading goes through OCR, image understanding goes through VLM). To specify a VLM vendor, ask the agent to pass the provider parameter (e.g. bailian / siliconflow / zhipu / volcengine).
Configuration
Override default values through the config of the dsh-vision node in cordis.patch.yml.
Multi-vendor VLM
Four domestic vendors are built in. describe_image accepts a provider parameter to select one (leave blank to use defaultProvider):
- insert:
- id: dsh-vision
name: 'dsh-vision'
config:
defaultProvider: 'bailian' # 默认供应商
providers:
bailian: # 阿里云百炼
baseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1'
model: 'qwen3-vl-flash' # 或 qwen3-vl-plus / qwen-vl-ocr
apiKeyEnv: 'DASHSCOPE_API_KEY'
siliconflow: # 硅基流动
baseUrl: 'https://api.siliconflow.cn/v1'
model: 'Qwen/Qwen2.5-VL-7B-Instruct'
apiKeyEnv: 'SILICONFLOW_API_KEY'
zhipu: # 智谱
baseUrl: 'https://open.bigmodel.cn/api/paas/v4'
model: 'glm-4v-flash'
apiKeyEnv: 'ZHIPU_API_KEY'
volcengine: # 火山方舟(豆包)
baseUrl: 'https://ark.cn-beijing.volces.com/api/v3'
model: 'doubao-seed-1.6-vision'
apiKeyEnv: 'ARK_API_KEY'
# 自定义 OCR 二进制路径(默认插件 bin/vision-ocr)
ocrBin: ''
# 上传前压缩最长边(像素)
vlmMaxImageDim: 2048To switch vendors: change defaultProvider, or specify the provider parameter when calling. To add a new vendor: add any key name under providers (any OpenAI-compatible endpoint works).
Recommended vision models (Alibaba Cloud Bailian)
Model | Features |
| Fast and cheap, fine for everyday use |
| Higher quality, slightly slower and pricier |
| Dedicated to pure text recognition, stronger than local OCR (requires internet) |
Claude Code / MCP usage
This repository includes a zero-dependency MCP server (mcp/server.js) that lets Claude Code (and any MCP-compatible client) use these two tools—even if your Claude Code is connected to a model that does not support vision (such as DeepSeek).
Connect to Claude Code
# 全局接入(所有项目可用)
claude mcp add dsh-vision -- node /path/to/dsh-vision/mcp/server.js
# 或者只给当前项目(在项目根目录建 .mcp.json):
# {
# "mcpServers": {
# "dsh-vision": {
# "command": "node",
# "args": ["/path/to/dsh-vision/mcp/server.js"],
# "env": { "DASHSCOPE_API_KEY": "sk-xxx" }
# }
# }
# }describe_image's API key read priority: environment variable > ~/.dsh/.credentials.yaml. When using .mcp.json, you can configure it directly in env.
Verification
claude mcp list # 应看到 dsh-vision
claude mcp test dsh-vision # 或直接问 Claude:看下 /path/to/xxx.png 里是什么The MCP server is a pure Node implementation (stdio JSON-RPC), has no third-party dependencies, and only requires Node >= 18.
Development
# 运行单元测试
node --test test/
# 重新编译 OCR 二进制
swiftc -Xcc -fmodules-cache-path="$PWD/.cache" -O bin/vision-ocr.swift -o bin/vision-ocrPlatform support
Capability | macOS (Apple Silicon) | macOS (Intel) | Windows |
Local OCR | ✅ Precompiled | ✅ Self-compile or use Release binary | ✅ PowerShell backend (Windows.Media.Ocr, not tested) |
Cloud VLM | ✅ | ✅ | ✅ (pure Node) |
macOS OCR: Depends on Vision.framework. The repository does not include compiled artifacts (see
.gitignore):Apple Silicon: self-compile with
npm run build:ocr, or downloadvision-ocr-arm64from GitHub ReleaseIntel: self-compile with
npm run build:ocr, or downloadvision-ocr-x86_64from the ReleaseWhen pushing a
v*tag to GitHub, Actions automatically compiles on both architectures and attaches the binaries to the Release
Windows OCR:
bin/vision-ocr.ps1(Windows 10/11 built-in OCR engine; requires the Chinese OCR language pack). Just point the plugin'socrBinto it:powershell -ExecutionPolicy Bypass -File bin/vision-ocr.ps1 <image> -JsonNote: This script was developed on macOS and has not been tested on Windows; issues/PRs are welcome.
VLM channel: Node >= 18 (built-in
fetch), available on all platforms.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Image processing over MCP: compress and split images, generate images and QR codes.
Edit images over MCP with object removal, background removal, and guided generative edits.
Generate images with any major model — one API key, one prepaid balance, one MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI clients like Claude to understand, analyze, and describe local images via VL models through the MCP protocol.-
- FlicenseNot gradedqualityAmaintenanceBridges text-only AI models to Google Gemini for image analysis, providing structured visual descriptions, object detection, and answers to image-based questions via MCP.-
- AlicenseAqualityBmaintenanceEnables any MCP client to perform image understanding and OCR via any OpenAI-compatible vision-language model. Supports local, private inference without images leaving the machine.213 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides vision capabilities to text-only LLMs via MCP, enabling image understanding, Q&A, OCR, and image processing through cloud multimodal APIs.MIT