Mistral OCR MCP Server
Extracts text content from PDFs and images using Mistral's OCR API, enabling OCR capabilities in MCP-compatible clients like Cursor and Claude Desktop.
README
Mistral OCR MCP Server
A Model Context Protocol (MCP) server that provides OCR (Optical Character Recognition) functionality using Mistral's OCR API. This server allows you to extract text content from PDF files and images through MCP-compatible clients like Cursor and Claude Desktop.
š For more context and practical usage examples, read the related article: How I Use Mistral Document AI to Consolidate My Notes
Usage example flowchart

Features
- Extract text from PDF files and images (JPG, JPEG, PNG, TIFF, BMP)
- Returns structured content with page-by-page breakdown
- Integrates seamlessly with MCP clients
- Built with FastMCP for optimal performance
Prerequisites
- uv package manager
- Python 3.10.1 or higher
- Mistral API Key : https://console.mistral.ai/api-keys
Installation
-
Clone the repository:
git clone https://github.com/lemopian/mistral-ocr-mcp.git cd mistral-ocr-mcp -
Install dependencies using uv:
uv sync -
Set up environment variables: Create a
.envfile in the project root:echo "MISTRAL_API_KEY=your_mistral_api_key_here" > .env
Configuration for MCP Clients
Add the following configuration to your MCP client config file:
{
"mcpServers": {
"mistral-ocr": {
"command": "/Users/yourusername/.local/bin/uv",
"args": [
"--directory",
"/path/to/mistral-ocr-mcp",
"run",
"main.py"
]
}
}
}
Important: Replace /path/to/mistral-ocr-mcp with the actual path to your cloned repository.
Usage
Once configured, the server provides the following tool:
extract_file_content
Extracts text content from PDF files and images.
Parameters:
file_path(string): Local path to the PDF or image file
Returns:
- Extracted text content as a string
Supported formats:
- PDF files (
.pdf) - Image files (
.jpg,.jpeg,.png,.tiff,.bmp)
Example usage :
Please extract the text from this document: /path/to/your/document.pdf
Development
Running the server directly
uv run main.py
Project structure
mistral-ocr-mcp/
āāā mistral_ocr/ # Package directory
ā āāā __init__.py # Package initialization
ā āāā extractor.py # Mistral OCR functionality
āāā docs/ # Documentation
ā āāā flowchart.png # Architecture flowchart
āāā main.py # MCP server implementation
āāā pyproject.toml # Project dependencies and configuration
āāā uv.lock # Dependency lock file
āāā .env # Environment variables (create this)
āāā .gitignore # Git ignore rules
āāā README.md # This file
Environment Variables
MISTRAL_API_KEY: Your Mistral API key (required)
Troubleshooting
-
"MISTRAL_API_KEY must be set" error:
- Ensure you've created a
.envfile with your Mistral API key - Verify the API key is valid
- Ensure you've created a
-
"File not found" error:
- Check that the file path is correct and accessible
- Ensure the file format is supported
-
MCP connection issues:
- Verify the path to
uvis correct in your MCP configuration - Ensure the repository path is absolute and correct
- Check that all dependencies are installed with
uv sync
- Verify the path to
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.