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

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

🎨 Đị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.3.tar.gz (21.9 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.3-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_image_reader-0.1.3.tar.gz
  • Upload date:
  • Size: 21.9 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.3.tar.gz
Algorithm Hash digest
SHA256 de3d6bb0ec2b0a8fbfc7f4818a633019cfcec4723f50402130f886611a7dad78
MD5 782b41a3ec0288bef674cb3356af3f54
BLAKE2b-256 98d605fecbfebbfa0abe088c0c0ed75ac5fdb993f319d523cfecbaab26b66c62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_image_reader-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6307f8f5dd5d0c8a8d833dc7101fcbd6ae0ddb798a234e9b91a4485a3f0df066
MD5 7cac6fa632e99ba41a0aa0335f1b0496
BLAKE2b-256 23f537ab0dd6aef14796fde32e7102266c79b10eb718624616f67132ed10dc92

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