IO

ihugang/ocrtool-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

39 stars 6 forks 质量 63 趋势 12NOASSERTION

使用 macOS Vision 框架的 MCP OCR 模块

概览

是一款开源的macOS原生OCR MCP服务器,采用Swift和Vision框架构建。它设计用于本地标准集成,支持Claude Desktop、Cursor、Continue、Windsurf、Cline、Cherry Studio或使用JSON-RPC而非stdin的自定义代理工具。 - ✅ 由macOS Vision Framework驱动的精准OCR - ✅ 识别中英文文本 - ✅ 标准MCP生命周期,包含初始化、工具/列表和工具/调用 - ✅ 为偏好技能而非原始MCP的代理平台捆绑OCR工作流程技能 - ✅ 返回带有边界框(像素单位)的逐行OCR结果 - ✅ 支持多种图像输入法(本地路径、URL、Base64) - ✅ 灵活输出格式(纯文本、Markdown表格、JSON、代码注释) - ✅ 轻量级、快速且完全离线 - ✅ 开源免费软件 - 当你的代理平台支持技能,且你希望拥有更有指导性、自然语言的工作流程时,使用。- 当你的代理平台支持 MCP 服务器,并且希望将 ocrtool-mcp 暴露为标准工具时。

概述(AI 翻译)

🇨🇳 中文文档

ocrtool-mcp 是一个开源的 macOS 原生 OCR MCP 服务器,使用 Swift 和 Vision 框架构建。它设计用于本地 stdio 集成,集成于 Claude Desktop、Cursor、Continue、Windsurf、Cline、Cherry Studio 或使用 JSON-RPC over stdin 的自定义代理。


✨ 特色

  • ✅ 由macOS Vision Framework驱动的精准OCR
  • ✅ 识别中英文文本
  • ✅ 标准MCP生命周期,包含initialize、tools/list和tools/call
  • ✅ 为偏好技能而非原始MCP的代理平台捆绑ocr-workflow技能
  • ✅ 返回带有边界框的逐行OCR结果(像素单位)
  • ✅ 多重图像输入方式(本地路径、URL、Base64)
  • ✅ 灵活的输出格式(纯文本、Markdown 表格、JSON、代码注释)
  • ✅ 轻量级、快速且完全离线
  • ✅ 开源自由软件

📦 安装

你应该用哪一个?

对大多数用户来说,选择很简单:

  • 当你的经纪人平台支持技能且你希望拥有更有指导性、自然语言的工作流程时,使用捆绑技能。
  • 当你的代理平台支持 MCP 服务器并且希望 ocrtool-mcp 作为标准工具暴露时,使用 MCP。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

ocrtool-mcp

🇨🇳 中文文档

ocrtool-mcp is an open-source macOS-native OCR MCP server built with Swift and the Vision framework. It is designed for local stdio integrations in tools like Claude Desktop, Cursor, Continue, Windsurf, Cline, Cherry Studio, or custom agents using JSON-RPC over stdin.


✨ Features

  • ✅ Accurate OCR powered by macOS Vision Framework
  • ✅ Recognizes both Chinese and English text
  • ✅ Standard MCP lifecycle with initialize, tools/list, and tools/call
  • ✅ Bundled ocr-workflow skill for agent platforms that prefer skills over raw MCP
  • ✅ Returns line-wise OCR results with bounding boxes (in pixels)
  • ✅ Multiple image input methods (local path, URL, Base64)
  • ✅ Flexible output formats (plain text, Markdown table, JSON, code comments)
  • ✅ Lightweight, fast, and fully offline
  • ✅ Open source free software

📦 Installation

Which One Should You Use?

For most users, the choice is simple:

  • Use the bundled skill when your agent platform supports skills and you want a more guided, natural-language workflow.
  • Use MCP when your agent platform supports MCP servers and you want ocrtool-mcp exposed as a standard tool.

In practical terms:

  • Codex / Claude with skills support: install the skill first
  • Claude Desktop / Cursor / Continue / Windsurf / Cline / Cherry Studio: connect the MCP server
  • Not sure: start with the skill if your platform has a skills directory; otherwise use MCP

Method 1: Using Homebrew (Easiest)

Homebrew availability follows the release pipeline: install or upgrade with Homebrew after the GitHub Actions release workflow finishes and syncs Formula/ocrtool-mcp.rb.

brew tap ihugang/ocrtool
brew install ocrtool-mcp

Ready to use after installation:

ocrtool-mcp --help

Method 2: Download Pre-built Binary

Download the pre-compiled Universal Binary that supports all Macs (Intel and Apple Silicon):

VERSION=""
curl -L -O "https://github.com/ihugang/ocrtool-mcp/releases/download/v${VERSION}/ocrtool-mcp-v${VERSION}-universal-macos.tar.gz"

# Extract
tar -xzf "ocrtool-mcp-v${VERSION}-universal-macos.tar.gz"

# Make executable
chmod +x "ocrtool-mcp-v${VERSION}-universal"

# Move to system path (recommended)
sudo mv "ocrtool-mcp-v${VERSION}-universal" /usr/local/bin/ocrtool-mcp

# Verify installation
ocrtool-mcp --help

Alternatively, you can download directly from the GitHub Releases page.

Method 3: Build from Source

If you prefer to build from source or contribute to development:

git clone https://github.com/ihugang/ocrtool-mcp.git
cd ocrtool-mcp
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "ocrtool": { "command": "/path/to/ocrtool-mcp/.build/release/ocrtool-mcp" } } }