Mistral OCR MCP Server

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.

Category
Visit Server

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

  1. Call health_check.
  2. For a local PDF, call list_pages.
  3. For a quick sample, call ocr_from_file with pages="0".
  4. For real work, call ocr_to_markdown_file and 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_KEYS accepts comma-, semicolon-, or newline-separated keys.
  • HTTP 401, 403, 429, selected transient failures, and 5xx responses trigger fallback to the next key.
  • HTTP 400 usually 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_DIR or outputs/ next to server.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. With include_images=true, the server requests include_image_base64, writes image assets, and rewrites Markdown placeholders such as ![img-0.jpeg](img-0.jpeg) to local relative paths.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured