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 |
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 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
Metadata
Release files for mcp-image-reader 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_image_reader-0.1.4.tar.gz | 23.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_image_reader-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.9 kB
Release files / mcp_image_reader-0.1.4.tar.gz
| Download URL | mcp_image_reader-0.1.4.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41187c100d970ad8d0cdc23776abf0baaadf4f9eb41873545829e6af8ee15205
|
|
BLAKE2b-256 checksum How to use checksums |
6c6892afff998b1390c56112e911cc0d52b2100ef1d7bb3b7a32d687a8f8171f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / mcp_image_reader-0.1.4-py3-none-any.whl
| Download URL | mcp_image_reader-0.1.4-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4d6184ae7e0988b2f086280dc572bf6df341ce0eb9fdf6f81d2e366fd40f59e
|
|
BLAKE2b-256 checksum How to use checksums |
a058a9b047f59420672065c6afbf2722ba28a020362ac10aeed23bee8b360b63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for mcp-image-reader 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.