markitdown-mcp-ocr

daevosDev/markitdown-mcp-ocr

3.1

If you are the rightful owner of markitdown-mcp-ocr and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MarkItDown-MCP is a robust Model Context Protocol server designed for document conversion with OCR capabilities, leveraging Tesseract OCR for text extraction.

MarkItDown-MCP with OCR Support

A powerful MCP (Model Context Protocol) server that provides document conversion capabilities with OCR support using Tesseract OCR.

Features

  • Document Conversion: Convert various document formats to markdown
  • OCR Support: Extract text from images using Tesseract OCR
  • Multiple Languages: Support for English and French OCR
  • Docker Support: Ready-to-use Docker containers
  • SSE Mode: Server-Sent Events support for real-time updates

Quick Start

Using Docker (Recommended)

Basic Docker Image
# Build the basic image
docker build -t markitdown-mcp .

# Run the container
docker run -p 3001:3001 --name markitdown-mcp markitdown-mcp
OCR-Enabled Docker Image
# Build the OCR-enabled image
docker build -f Dockerfile.ocr -t markitdown-mcp-ocr .

# Run the OCR container with volume mounting
docker run -p 3002:3001 -v $(pwd)/TEST:/app/test_files --name markitdown-mcp-ocr markitdown-mcp-ocr
Alternative OCR Configuration
# Build the alternative OCR image
docker build -f Dockerfile.test-ocr-fixed -t markitdown-mcp-ocr-fixed .

# Run with SSE on port 8000
docker run -p 8000:8000 -v $(pwd)/TEST:/app/test_files --name markitdown-mcp-sse markitdown-mcp-ocr-fixed

Manual Installation

Prerequisites
  • Python 3.11+
  • Tesseract OCR (for OCR support)
Install Dependencies
pip install -r requirements.txt
Run the Server
# Standard HTTP mode
markitdown-mcp --http --host 0.0.0.0 --port 3001

# SSE mode
python server.py

Usage

API Endpoints

  • HTTP Mode: http://localhost:3001/mcp
  • SSE Mode: http://localhost:8000

Testing OCR

  1. Place test images in the TEST/ directory
  2. Use the provided test scripts:
    python test-ocr-fix.py
    

Docker Compose

Use the provided docker-compose.yml for easy deployment:

docker-compose up -d

File Structure

markitdown-mcp/
ā”œā”€ā”€ Dockerfile              # Basic Docker configuration
ā”œā”€ā”€ Dockerfile.ocr          # OCR-enabled Docker configuration
ā”œā”€ā”€ Dockerfile.test-ocr-fixed # Alternative OCR configuration
ā”œā”€ā”€ docker-compose.yml      # Docker Compose setup
ā”œā”€ā”€ requirements.txt        # Python dependencies
ā”œā”€ā”€ server.py              # SSE server script
ā”œā”€ā”€ test-ocr-fix.py        # OCR testing script
ā”œā”€ā”€ TEST/                  # Test files directory
│   ā”œā”€ā”€ demo-ocr-test.png
│   ā”œā”€ā”€ test-ocr-fr.png
│   └── ...
└── README.md              # This file

Configuration

Environment Variables

  • HOST: Server host (default: 0.0.0.0)
  • PORT: Server port (default: 3001 for HTTP, 8000 for SSE)

OCR Languages

The OCR configuration supports:

  • English (eng)
  • French (fra)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with Docker
  5. Submit a pull request

License

This project is licensed under the MIT License.