Skip to main content

MCP server for reading and analyzing images with OCR and AI vision capabilities

Project description

MCP Image Reader Server

PyPI version Python Support License: MIT GitHub

MCP server cung cấp các công cụ để đọc và phân tích nội dung từ ảnh sử dụng OCR và AI vision.

🚀 Cài đặt nhanh với uvx

# Cài đặt và chạy trực tiếp
uvx mcp-image-reader

# Hoặc cài đặt global
pip install mcp-image-reader

✨ Tính năng

  • 🔤 Đọc text từ ảnh: Sử dụng Tesseract OCR để trích xuất text từ các định dạng ảnh phổ biến
  • 📊 Phân tích bảng: Phát hiện và trích xuất dữ liệu từ bảng trong ảnh
  • 🖼️ Mô tả ảnh: Phân tích và mô tả nội dung tổng quát của ảnh
  • 🎯 Phát hiện đối tượng: Nhận diện các đối tượng và thành phần trong ảnh
  • ⚡ Xử lý ảnh: Cải thiện chất lượng ảnh trước khi phân tích
  • 🌍 Đa ngôn ngữ: Hỗ trợ tiếng Việt, tiếng Anh và nhiều ngôn ngữ khác

📋 Yêu cầu hệ thống

Tesseract OCR

macOS:

brew install tesseract tesseract-lang

Ubuntu/Debian:

sudo apt-get install tesseract-ocr tesseract-ocr-vie

Windows: Tải từ: https://github.com/UB-Mannheim/tesseract/wiki

🔧 Cấu hình MCP Client

Claude Desktop

Thêm vào ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "image-reader": {
      "command": "uvx",
      "args": ["mcp-image-reader"]
    }
  }
}

Cline (VS Code)

{
  "cline.mcpServers": {
    "image-reader": {
      "command": "uvx", 
      "args": ["mcp-image-reader"]
    }
  }
}

🛠️ Các công cụ có sẵn

Tool Mô tả Input Output
read_image_text Đọc text từ ảnh image_path, language, preprocess Text + confidence scores
analyze_image_table Phân tích bảng image_path, output_format Structured table data
detect_objects Phát hiện đối tượng image_path, min_area Object list with properties
preprocess_image Xử lý ảnh image_path, output_path, options Processed image
get_image_info Thông tin ảnh image_path File info + dimensions
convert_to_svg Convert sang SVG image_path, output_path, method SVG file + conversion info

💡 Ví dụ sử dụng

Đọc text từ ảnh

Hãy đọc text từ ảnh này: /path/to/document.jpg

Phân tích bảng

Trích xuất dữ liệu từ bảng trong ảnh: /path/to/table.png

Phát hiện đối tượng

Phát hiện các đối tượng trong ảnh: /path/to/image.jpg

Convert sang SVG với fs_read

Convert ảnh này sang SVG với fs_read: /path/to/image.png
Convert với method=hybrid và use_fs_read=true

🎨 Định dạng ảnh được hỗ trợ

  • PNG
  • JPG/JPEG
  • BMP
  • TIFF
  • GIF
  • WebP

🌍 Ngôn ngữ OCR được hỗ trợ

  • eng - Tiếng Anh
  • vie - Tiếng Việt
  • vie+eng - Kết hợp (khuyến nghị cho văn bản hỗn hợp)
  • Các ngôn ngữ khác được Tesseract hỗ trợ

🔍 Use Cases

  • 📄 Xử lý tài liệu: Scan tài liệu giấy thành text, trích xuất thông tin từ hóa đơn
  • 📊 Phân tích dữ liệu: Đọc bảng từ screenshot, trích xuất dữ liệu từ biểu đồ
  • 🎓 Hỗ trợ giáo dục: Đọc bài tập từ ảnh, phân tích sơ đồ
  • ♿ Accessibility: Mô tả ảnh cho người khiếm thị, chuyển đổi nội dung visual

🚀 Development

Cài đặt từ source

git clone https://github.com/thanhma/mcp-image-reader.git
cd mcp-image-reader
pip install -e ".[dev]"

Chạy tests

python test_server.py
python demo.py

📚 Tài liệu

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_image_reader-0.1.4.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_image_reader-0.1.4-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_image_reader-0.1.4.tar.gz.

File metadata

  • Download URL: mcp_image_reader-0.1.4.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for mcp_image_reader-0.1.4.tar.gz
Algorithm Hash digest
SHA256 41187c100d970ad8d0cdc23776abf0baaadf4f9eb41873545829e6af8ee15205
MD5 b0d2fed9cfa2ae67d79f65d4224a64bb
BLAKE2b-256 6c6892afff998b1390c56112e911cc0d52b2100ef1d7bb3b7a32d687a8f8171f

See more details on using hashes here.

File details

Details for the file mcp_image_reader-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_image_reader-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e4d6184ae7e0988b2f086280dc572bf6df341ce0eb9fdf6f81d2e366fd40f59e
MD5 3e515452101635be8a4391e0a7a4b7b4
BLAKE2b-256 a058a9b047f59420672065c6afbf2722ba28a020362ac10aeed23bee8b360b63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page