Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-mistral-ocr

MCP.Pizza Chef: everaldo

The mcp-mistral-ocr is an MCP server that integrates Mistral AI's OCR API to extract text from images and PDFs. It supports processing local files and URLs, handles multiple file formats like JPG, PNG, and PDF, and outputs results as timestamped JSON files. Containerized with Docker, it offers easy deployment and environment variable configuration for API keys and file directories.

Use This MCP server To

Extract text from scanned documents and images automatically Process PDFs and images from URLs for text extraction Convert local image files to searchable JSON text data Integrate OCR into AI workflows for document understanding Automate data extraction from invoices and receipts Generate structured JSON outputs from scanned forms Enable real-time OCR processing in AI-powered applications

README

MCP Mistral OCR

smithery badge

An MCP server that provides OCR capabilities using Mistral AI's OCR API. This server can process both local files and URLs, supporting images and PDFs.

Features

  • Process local files (images and PDFs) using Mistral's OCR
  • Process files from URLs with explicit file type specification
  • Support for multiple file formats (JPG, PNG, PDF, etc.)
  • Results saved as JSON files with timestamps
  • Docker containerization
  • UV package management

Environment Variables

  • MISTRAL_API_KEY: Your Mistral AI API key
  • OCR_DIR: Directory path for local file processing. Inside the container, this is always mapped to /data/ocr

Installation

Installing via Smithery

To install Mistral OCR for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @everaldo/mcp/mistral-crosswalk --client claude

Using Docker

  1. Build the Docker image:
docker build -t mcp-mistral-ocr .
  1. Run the container:
docker run -e MISTRAL_API_KEY=your_api_key -e OCR_DIR=/data/ocr -v /path/to/local/files:/data/ocr mcp-mistral-ocr

Local Development

  1. Install UV package manager:
pip install uv
  1. Create and activate virtual environment:
uv venv
source .venv/bin/activate  # On Unix
# or
.venv\Scripts\activate  # On Windows
  1. Install dependencies:
uv pip install .

Claude Desktop Configuration

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "mistral-ocr": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MISTRAL_API_KEY",
        "-e",
        "OCR_DIR",
        "-v",
        "C:/path/to/your/files:/data/ocr",
        "mcp-mistral-ocr:latest"
      ],
      "env": {
        "MISTRAL_API_KEY": "<YOUR_MISTRAL_API_KEY>",
        "OCR_DIR": "C:/path/to/your/files"
      }
    }
  }
}

Available Tools

1. process_local_file

Process a file from the configured OCR_DIR directory.

{
    "name": "process_local_file",
    "arguments": {
        "filename": "document.pdf"
    }
}

2. process_url_file

Process a file from a URL. Requires explicit file type specification.

{
    "name": "process_url_file",
    "arguments": {
        "url": "https://example.com/document",
        "file_type": "image"  // or "pdf"
    }
}

Output

OCR results are saved in JSON format in the output directory inside OCR_DIR. Each result file is named using the following format:

  • For local files: {original_filename}_{timestamp}.json
  • For URLs: {url_filename}_{timestamp}.json or url_document_{timestamp}.json if no filename is found in the URL

The timestamp format is YYYYMMDD_HHMMSS.

Supported File Types

  • Images: JPG, JPEG, PNG, GIF, WebP
  • Documents: PDF and other document formats supported by Mistral OCR

Limitations

  • Maximum file size: 50MB (enforced by Mistral API)
  • Maximum document pages: 1000 (enforced by Mistral API)

mcp-mistral-ocr FAQ

How do I configure the API key for mcp-mistral-ocr?
Set the MISTRAL_API_KEY environment variable with your Mistral AI API key before running the server.
What file types does mcp-mistral-ocr support?
It supports common image formats like JPG, PNG, and PDF files for OCR processing.
Can mcp-mistral-ocr process files from URLs?
Yes, it can process files from URLs if the file type is explicitly specified.
How are OCR results returned?
Results are saved as JSON files with timestamps for easy tracking and integration.
Is there a recommended way to deploy mcp-mistral-ocr?
The server is containerized with Docker for straightforward deployment and environment management.
Where should local files be placed for processing?
Local files should be placed in the directory specified by the OCR_DIR environment variable, mapped to /data/ocr inside the container.
Does mcp-mistral-ocr support batch processing?
While not explicitly stated, it can process multiple files by placing them in the OCR_DIR or specifying multiple URLs sequentially.
Can this server be integrated with other LLM providers?
Yes, it can be integrated with LLMs like OpenAI, Claude, and Gemini to enhance document understanding workflows.