OCR与音频转录MCP服务

面向开发者的MCP服务与命令行工具,用于对PDF、图片、Office文档和音频文件进行OCR识别与内容转录,可集成到Claude Desktop等AI助手或用于本地批量处理。

  • by EngDawood
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 EngDawood/mcp-mistral-ocr

使用说明

mcp-mistral-ocr

MCP (Model Context Protocol) server and CLI for OCR and audio transcription using the Mistral AI API.

Supports PDF, DOCX, DOC, PPTX, XLSX, XLS, images (JPEG, PNG, AVIF, TIFF), and audio files. Runs locally via stdio transport, installable with npx.

Quick Start

npx mcp-mistral-ocr

Requires MISTRAL_API_KEY in your environment.

Claude Desktop / Claude Code Setup

Add to your MCP config (claude_desktop_config.json or .mcp.json):

{
  "mcpServers": {
    "mistral_ocr": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-mistral-ocr"],
      "env": {
        "MISTRAL_API_KEY": "your-api-key-here"
      }
    }
  }
}

Get your API key at: https://console.mistral.ai/api-keys

MCP Tools (6)

Tool Description
mistral_ocr_process_pdf Process local document (PDF, DOCX, DOC, PPTX, XLSX, XLS)
mistral_ocr_process_url Download and process a document from a URL
mistral_ocr_process_image OCR an image file (JPEG, PNG, AVIF, TIFF)
mistral_ocr_extract_structured Extract structured data using a JSON schema
mistral_ocr_extract_tables Extract tables in HTML or Markdown format
mistral_ocr_clean_markdown Remove repetitive headers/footers from OCR output

All tools return JSON with success, content, page_count, and optional tables, images, hyperlinks fields.

CLI (ocr)

The package also ships an ocr CLI for local batch processing:

# Single file
ocr document.pdf
ocr report.docx --md
ocr scan.png --txt
ocr recording.mp3

# Directory (processes all supported files)
ocr ./docs/

# URL
ocr --url https://example.com/paper.pdf

# Share links work as-is — Drive, Docs/Sheets/Slides, Dropbox and GitHub blobs
# are rewritten to their direct-download form automatically
ocr --url "https://drive.google.com/file/d/FILE_ID/view?usp=sharing"
ocr --url "https://docs.google.com/document/d/DOC_ID/edit"   # exported as PDF

# Page selection
ocr large.pdf --pages 1,5-10

# Config (persistent per-type defaults)
ocr config set outputFormat md
ocr config pdf set clean true
ocr config show

Outputs .md (default) or .txt (--txt flag). Skips files that already have an output.

Share links must be publicly readable — a Drive file needs "Anyone with the link". Private files aren't supported; there's no Google sign-in.

Local Development

git clone https://github.com/EngDawood/mcp-mistral-ocr.git
cd mcp-mistral-ocr
npm install
cp .env.example .env          # add MISTRAL_API_KEY
npm run build
node dist/index.js            # run MCP server

Test with MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

License

MIT