OCR MCP Server

OCR MCP Server

A Tesseract.js-based server that enables image-to-text recognition within MCP-compatible environments like Cursor. It supports multiple languages and common image formats, allowing users to extract text from local files using natural language commands.

Category
Visit Server

README

OCR MCP Server

一个基于 Tesseract.js 的 MCP(Model Context Protocol)服务器,让 Cursor 具备 OCR 图片文字识别能力。

功能特性

  • 支持识别图片中的中文(简体/繁体)、英文等多种语言
  • 支持常见图片格式:PNG、JPG、JPEG、BMP、GIF、WebP
  • 纯 JavaScript 实现,无需额外安装 OCR 软件
  • 返回识别置信度,帮助判断识别质量

安装

cd /Users/taowenxin/Desktop/mcpTest
npm install

在 Cursor 中配置

  1. 打开 Cursor 设置:File > Preferences > Cursor Settings
  2. 找到 Features > MCP
  3. 点击 Edit in settings.json 或手动添加配置

~/.cursor/mcp.json 或 Cursor 设置中添加:

{
  "mcpServers": {
    "ocr-tool": {
      "command": "node",
      "args": ["/Users/taowenxin/Desktop/mcpTest/index.js"]
    }
  }
}

配置完成后,重启 Cursor 或刷新 MCP 连接。

使用方法

在 Cursor 的 Chat 面板(Agent 模式)中使用:

识别图片文字

请识别这张图片中的文字:/Users/taowenxin/Desktop/screenshot.png

或者指定语言:

请用英文识别这张图片:/path/to/image.jpg

查看支持的语言

请列出 OCR 支持的语言

支持的语言

语言代码 语言名称
chi_sim 简体中文
chi_tra 繁体中文
eng 英文
jpn 日文
kor 韩文
fra 法文
deu 德文
spa 西班牙文
rus 俄文
ara 阿拉伯文

提供的工具

recognize_text

识别图片中的文字内容。

参数:

  • image_path (必填): 图片文件的本地绝对路径
  • languages (可选): 识别语言代码数组,默认 ["chi_sim", "eng"]

list_ocr_languages

列出所有支持的 OCR 语言及其代码。

注意事项

  1. 首次运行:Tesseract.js 会自动下载语言包(约 10-20MB),需要网络连接
  2. 识别质量:识别准确率取决于图片清晰度、字体大小和图片质量
  3. 使用模式:建议在 Cursor 的 Agent 模式下使用,以便自动触发工具调用
  4. 路径格式:请使用绝对路径,确保路径正确且文件存在

本地测试

# 直接运行服务器(用于调试)
node index.js

技术栈

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured