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

💡 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

🎨 Đị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.2.tar.gz (18.7 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.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_image_reader-0.1.2.tar.gz
  • Upload date:
  • Size: 18.7 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.2.tar.gz
Algorithm Hash digest
SHA256 d8425c228398c12a75fcb2c1e9dd4e48c99c76bdf3621de946f4ec6553018ca8
MD5 8a8e472cfa4635243c4f22156a31047d
BLAKE2b-256 e94c00e2081b4ecb1862fee293401b339bf36fd329e2f4d630177d4edf8eaadd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_image_reader-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 714664fa3c96ae4355881d0919d8f128011dd3691ded079af73d1e46a5327800
MD5 ca5c52c45a7dd2507435aa01fd87daf7
BLAKE2b-256 19994bf5709fc5d8581ea4f710580312a015353f8a340f656b23d92de5160be8

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