Get the FREE Ultimate OpenClaw Setup Guide →

mcp-mistral-ocr

Model Context Protocol (MCP) Server for Mistral OCR API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio everaldo-mcp-mistral-ocr docker run -i --rm -e MISTRAL_API_KEY -e OCR_DIR -v /path/to/local/files:/data/ocr mcp-mistral-ocr:latest \
  --env OCR_DIR="/path/to/local/files" \
  --env MISTRAL_API_KEY="<YOUR_MISTRAL_API_KEY>"

How to use

This MCP server provides OCR capabilities by calling Mistral AI's OCR API. It can process both local files stored on the host (mounted into the container) and files retrieved from URLs, supporting common image formats (JPG, PNG, GIF, WebP) as well as PDFs. OCR results are saved as JSON files in the OCR_DIR/output directory with filenames that include the original file name and a timestamp for easy traceability. Two tools are exposed: process_local_file, which processes a file located in OCR_DIR, and process_url_file, which processes a file from a URL with an explicit file type specification. To use the server, configure the OCR_DIR to point to a local directory you control, provide your MISTRAL_API_KEY, and run the server container. Then call the tools with the appropriate arguments to obtain structured OCR results.

The available tools are:

  • process_local_file: Reads a file from the configured OCR_DIR and runs OCR via Mistral OCR API.
  • process_url_file: Fetches a file from a URL, requires a file_type parameter (either image or pdf), and runs OCR via the API. The results are written as JSON files to the output directory inside OCR_DIR.

How to install

Prerequisites:

  • Docker installed on your host (or a compatible container runtime).
  • An active Mistral AI API key.

Installation steps:

  1. Prepare your environment variables and local directories:

    • Create a directory for OCR input/output, e.g. /path/to/local/files
    • Ensure you have a valid MISTRAL_API_KEY
  2. Run the MCP server using Docker: docker run -i --rm
    -e MISTRAL_API_KEY=your_api_key
    -e OCR_DIR=/data/ocr
    -v /path/to/local/files:/data/ocr
    mcp-mistral-ocr:latest

  3. Optional: If you are building from a Dockerfile locally, build and tag the image first: docker build -t mcp-mistral-ocr . docker run -i --rm -e MISTRAL_API_KEY=your_api_key -e OCR_DIR=/data/ocr -v /path/to/local/files:/data/ocr mcp-mistral-ocr:latest

  4. Verify access by triggering the tools once the container is running (see available tools in the README).

Additional notes

Notes and tips:

  • Set OCR_DIR to a host directory that you want to use for input and output. Inside the container, this maps to /data/ocr.
  • The container’s output.json files are stored under /data/ocr/output as described in the README.
  • If you encounter size or page-limit errors, these are enforced by the Mistral API (maximum file size 50MB and maximum pages 1000).
  • For secure deployments, ensure MISTRAL_API_KEY is kept secret and not hard-coded in scripts; use environment variable injection or secret management where possible.
  • When using process_url_file, specify file_type as either image or pdf depending on the content to optimize OCR accuracy.

Related MCP Servers

Sponsor this space

Reach thousands of developers