DocMistral MCP Server

DocMistral MCP Server

Converts documents and images to Markdown using Mistral AI's OCR, enabling AI-powered document processing via MCP-compatible clients like Claude Desktop.

Category
Visit Server

README

DocMistral MCP Server

Model Context Protocol Python License CI Contributions npm version

A powerful MCP (Model Context Protocol) server that converts documents and images to Markdown using Mistral AI's advanced OCR and document processing capabilities. Perfect for integrating document processing into Claude Desktop and other MCP-compatible clients.

šŸš€ Features

MCP Server Capabilities

  • šŸ”— MCP Compatible: Works with Claude Desktop, Continue, and other MCP clients
  • šŸ“¦ One-Command Install: npx @trsdn/mistraldocai-mcp-server
  • šŸ”„ Automatic Setup: Manages Python environment and dependencies
  • šŸŒ Cross-Platform: Windows, macOS, and Linux support

Document Processing

  • šŸ“„ Documents: PDF, PPTX, DOCX via Mistral's OCR API
  • šŸ–¼ļø Images: PNG, JPG, JPEG, GIF, BMP, AVIF support
  • 🧠 AI-Powered: Advanced document understanding with complex layouts
  • āœļø OCR Support: Scanned documents and handwritten text
  • ⚔ Fast Processing: Up to 2,000 pages per minute
  • šŸ’° Cost-Effective: $0.001 per page ($1 per 1,000 pages)

šŸš€ Quick Start

Step 1: Install the MCP Server

# Install and test with one command
npx @trsdn/mistraldocai-mcp-server --test

Step 2: Get API Key

Get your Mistral API key from console.mistral.ai

Step 3: Configure Your MCP Client

For Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mistraldocai": {
      "command": "npx",
      "args": ["@trsdn/mistraldocai-mcp-server"],
      "env": {
        "MISTRAL_API_KEY": "your_mistral_api_key_here"
      }
    }
  }
}

For Other MCP Clients

Use the command: npx @trsdn/mistraldocai-mcp-server with environment variable MISTRAL_API_KEY

Step 4: Start Using!

The server provides 2 tools:

  • process_document - Convert documents/images to Markdown
  • get_supported_formats - List supported file formats

Manual Installation (Python Tool)

For direct Python usage:

  1. Clone this repository:
git clone <repository-url>
cd DocMistral
  1. Create a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Configuration

API Key Setup

  1. Get a Mistral API key from console.mistral.ai

  2. Create a .env file in the project directory:

cp .env.example .env
  1. Edit .env and add your API key:
MISTRAL_API_KEY=your_api_key_here

Alternatively, you can set it as an environment variable:

export MISTRAL_API_KEY=your_api_key_here

Usage

MCP Server Usage

The MCP server provides two tools for document processing:

1. Process Single Document

Convert a document or image file to Markdown:

{
  "name": "process_document",
  "arguments": {
    "file_path": "/path/to/document.pdf"
  }
}

Or with base64 content (useful for MCP clients):

{
  "name": "process_document",
  "arguments": {
    "base64_content": "base64_encoded_file_content",
    "file_name": "document.pdf"
  }
}

2. Get Supported Formats

Get information about supported file formats:

{
  "name": "get_supported_formats",
  "arguments": {}
}

Python Tool Usage

For direct command-line usage:

# Process all files in the input directory
python docmistral.py

# Convert a single file
python docmistral.py --file document.pdf

Custom Directories

Specify custom input and output directories:

python docmistral.py --input /path/to/docs --output /path/to/markdown

Command Line Options

  • --input, -i: Input directory (default: input)
  • --output, -o: Output directory (default: output)
  • --mistral-api-key, -k: Mistral AI API key (required)
  • --file, -f: Convert a single file instead of a directory

Directory Structure

DocMistral/
ā”œā”€ā”€ docmistral.py       # Main script
ā”œā”€ā”€ requirements.txt    # Python dependencies
ā”œā”€ā”€ .env.example        # Environment variables template
ā”œā”€ā”€ README.md          # This file
ā”œā”€ā”€ input/             # Default input directory
│   └── .gitkeep      # Ensures directory is tracked
└── output/            # Default output directory
    └── .gitkeep      # Ensures directory is tracked

Requirements

  • Python 3.8+
  • See requirements.txt for Python package dependencies

Supported Formats

  • Documents: PDF, PPTX, DOCX (via OCR API)
  • Images: PNG, JPG, JPEG, GIF, BMP, AVIF (via OCR API)
  • File size limit: 50 MB
  • Page limit: 1,000 pages per document

How it Works

  • Uses Mistral's dedicated OCR API (client.ocr.process) for all supported formats
  • Advanced document understanding handles complex layouts, tables, and equations
  • Processes up to 2000 pages per minute
  • Pricing: $0.001 per page ($1 per 1,000 pages)

šŸ”§ MCP Tools Reference

process_document

Converts documents and images to Markdown format.

Parameters:

  • file_path (string): Path to the document/image file
  • OR base64_content (string) + file_name (string): Base64 content with filename
  • mime_type (string, optional): MIME type of the file

Example Usage:

{
  "name": "process_document",
  "arguments": {
    "file_path": "/path/to/document.pdf"
  }
}

With Base64 Content:

{
  "name": "process_document",
  "arguments": {
    "base64_content": "base64_encoded_file_content",
    "file_name": "document.pdf"
  }
}

get_supported_formats

Lists all supported file formats and their limitations.

Parameters: None

Example Usage:

{
  "name": "get_supported_formats",
  "arguments": {}
}

šŸ“‹ Supported Formats

Format Extensions Processing Method Notes
Documents .pdf, .pptx, .docx Mistral OCR API Up to 1,000 pages
Images .png, .jpg, .jpeg, .gif, .bmp, .avif Mistral OCR API Up to 50 MB

Limitations:

  • Maximum file size: 50 MB
  • Maximum pages: 1,000 per document
  • Processing speed: Up to 2,000 pages/minute
  • Cost: $0.001 per page

šŸŽÆ Use Cases

  • Research: Convert academic papers and reports to Markdown
  • Documentation: Process technical manuals and guides
  • Data Extraction: Extract text from scanned documents
  • Content Migration: Convert legacy documents to modern formats
  • OCR Processing: Digitize handwritten notes and forms

šŸ”Œ MCP Compatibility

This server is fully compatible with the Model Context Protocol (MCP) specification and works with:

  • Claude Desktop - Anthropic's desktop application
  • Continue - VS Code extension
  • Zed - Code editor with MCP support
  • Custom MCP clients - Any application implementing the MCP protocol

MCP Registry

This server is available in the MCP ecosystem:

  • Package: @trsdn/mistraldocai-mcp-server
  • Command: npx @trsdn/mistraldocai-mcp-server
  • Protocol Version: MCP 1.0
  • Transport: stdio

šŸ·ļø Tags & Discovery

Find this MCP server using these tags:

  • mcp-server - MCP compatible server
  • mistral - Uses Mistral AI
  • ocr - Optical Character Recognition
  • document-processing - Document conversion
  • pdf-to-markdown - PDF conversion
  • image-to-text - Image text extraction
  • ai-powered - AI-enhanced processing

šŸ“¦ Installation Methods

NPX (Recommended)

npx @trsdn/mistraldocai-mcp-server

Global Installation

npm install -g @trsdn/mistraldocai-mcp-server
mistraldocai-mcp

Local Development

git clone https://github.com/yourusername/MistralDocAI-mcp.git
cd MistralDocAI-mcp
npm install && npm run build
npm start

šŸ› ļø Development

Building from Source

# Clone the repository
git clone <repository-url>
cd MistralDocAI-mcp

# Install npm dependencies
npm install

# Build TypeScript
npm run build

# Test the build
npm test

Publishing

npm run build
npm publish

Notes

  • The tool preserves the directory structure when converting files
  • All documents are processed through Mistral AI for consistency
  • Output files are saved with the .md extension
  • Supports fallback processing for edge cases
  • API key is required for all operations
  • The MCP server automatically manages Python virtual environments
  • Cross-platform support (Windows, macOS, Linux)

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