Mistral OCR MCP Server
Enables OCR processing of local files and public URLs using Mistral OCR. Provides tools for health checks, key management, page listing, and generating Markdown output.
README
Mistral OCR MCP Server
This MCP server exposes Mistral OCR for local files and public URLs.
Tools
| Tool | Use |
|---|---|
health_check |
Validate keys, network access, model name, and output directory. |
set_api_key |
Set one runtime key for the current MCP process. |
set_api_keys |
Set multiple runtime keys for automatic fallback. |
list_pages |
Inspect a local file and return PDF page count when available. |
ocr_from_file |
OCR a local file and return Markdown inline. Best for short tests. |
ocr_from_url |
OCR a public URL and return Markdown inline. Best for short tests. |
ocr_to_markdown_file |
OCR a local file and save Markdown to disk. Best for PDFs. |
ocr_url_to_markdown_file |
OCR a public URL and save Markdown to disk. |
Configuration
Prefer multiple keys so the server can automatically switch when one key is unauthorized, rate-limited, or temporarily failing.
[mcp_servers.mistral-ocr]
type = "stdio"
command = "uv"
args = ["--directory", 'D:\34728\play\OCR\mistral-ocr-mcp', "run", "server.py"]
[mcp_servers.mistral-ocr.env]
MISTRAL_API_KEYS = "key1,key2,key3"
MISTRAL_OCR_OUTPUT_DIR = 'D:\34728\play\OCR\outputs'
Single-key compatibility is still supported:
MISTRAL_API_KEY = "key1"
After editing the Codex config, restart Codex or reload MCP tools so the new server process sees the environment variables.
Recommended Agent Workflow
- Call
health_check. - For a local PDF, call
list_pages. - For a quick sample, call
ocr_from_filewithpages="0". - For real work, call
ocr_to_markdown_fileand read the generated.md.
Example:
health_check()
list_pages(file_path="D:\docs\paper.pdf")
ocr_to_markdown_file(file_path="D:\docs\paper.pdf", pages="0-3")
To preserve extracted PDF figures, pass include_images=true.
ocr_to_markdown_file(
file_path="D:\docs\paper.pdf",
pages="0-5",
include_images=true,
image_limit=50,
image_min_size=64
)
The Markdown file will contain relative image links and the image files will be
saved in a sibling folder named like paper_hash_assets/.
Local Smoke Tests
cd D:\34728\play\OCR\mistral-ocr-mcp
uv sync
$env:MISTRAL_API_KEYS="key1,key2"
.\.venv\Scripts\python.exe -m py_compile server.py test_ocr.py
.\.venv\Scripts\python.exe test_ocr.py "https://arxiv.org/pdf/2201.04234"
Notes
MISTRAL_API_KEYSaccepts comma-, semicolon-, or newline-separated keys.- HTTP
401,403,429, selected transient failures, and5xxresponses trigger fallback to the next key. - HTTP
400usually means a bad request or unsupported file payload and does not trigger key rotation. - Saved Markdown uses UTF-8 and is written to
MISTRAL_OCR_OUTPUT_DIRoroutputs/next toserver.py. - Cache filenames include a content/options hash. Re-running the same OCR task
returns the cached Markdown path unless
use_cache=false. - Mistral OCR returns images separately from Markdown. Without
include_images=true, the server saves text/tables only. Withinclude_images=true, the server requestsinclude_image_base64, writes image assets, and rewrites Markdown placeholders such asto local relative paths.
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
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.