MCP server for reading and analyzing images with OCR and AI vision capabilities
Project description
MCP Image Reader Server
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 |
describe_image |
Mô tả nội dung ảnh | image_path, include_text, include_tables | Comprehensive description |
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
Mô tả ảnh
Mô tả nội dung của ảnh này: /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 Anhvie- Tiếng Việtvie+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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Tesseract OCR for OCR capabilities
- OpenCV for image processing
- MCP for the protocol specification
📞 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_image_reader-0.1.0.tar.gz.
File metadata
- Download URL: mcp_image_reader-0.1.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f2c01492fe48a16e73d370e4dac69e0efe3bfce74a17613e3a2264d8f7cb675
|
|
| MD5 |
16f78209648ef9f8cba5a993713a6489
|
|
| BLAKE2b-256 |
e79403c9d1678cf8214f5d377bbeb9d3239c491e7c1c0dc4731f9c70e3476d2d
|
File details
Details for the file mcp_image_reader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_image_reader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98599a7177caa5919d7409207edfd63d69c4507f08aa760dd956ebfd16ba15cb
|
|
| MD5 |
3726d4918fb0ac36c6b45ee23fdac321
|
|
| BLAKE2b-256 |
cbcfc8dad1e6d8068185cf0b51ef96896c725ec3ed78bae0b497b18943947403
|