mcp-mistral-ocr

by everaldo

Integrations

  • Supports containerized deployment using Docker, with configuration options for environment variables and volume mounting to access local files.

MCP Mistral OCR

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)
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

OCR images or pdfs, locally or by URLs by using Mistral OCR API (paid)

  1. Features
    1. Environment Variables
      1. Installation
        1. Installing via Smithery
        2. Using Docker
        3. Local Development
      2. Claude Desktop Configuration
        1. Available Tools
          1. 1. process_local_file
          2. 2. process_url_file
        2. Output
          1. Supported File Types
            1. Limitations

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                Provides tools for reading and extracting text from PDF files, supporting both local files and URLs.
                Last updated -
                3
                Python
              • A
                security
                A
                license
                A
                quality
                Provides image recognition capabilities using Anthropic Claude Vision and OpenAI GPT-4 Vision APIs, supporting multiple image formats and offering optional text extraction via Tesseract OCR.
                Last updated -
                3
                9
                Python
                MIT License
                • Linux
                • Apple
              • A
                security
                F
                license
                A
                quality
                An MCP server that provides a tool to extract text content from local PDF files, supporting both standard PDF reading and OCR capabilities with optional page selection.
                Last updated -
                1
                2
                Python
                • Apple
              • -
                security
                -
                license
                -
                quality
                A Retrieval-Augmented Generation server that enables semantic PDF search with OCR capabilities, allowing users to query document content through any MCP client and receive intelligent answers.
                Last updated -
                1
                Python
                Apache 2.0

              View all related MCP servers

              ID: 798rkh8r8l