Skip to main content

Lizeur is a MCP server to be able to get content from PDFs.

Project description

Lizeur - PDF Content Extraction MCP Server

Lizeur is a Model Context Protocol (MCP) server that enables AI assistants to extract and read content from PDF documents using Mistral AI's OCR capabilities. It provides a simple interface for converting PDF files to markdown text that can be easily consumed by AI models.

Features

  • PDF OCR Processing: Uses Mistral AI's latest OCR model to extract text from PDF documents
  • Intelligent Caching: Automatically caches processed documents to avoid re-processing
  • Markdown Output: Returns clean markdown text for easy integration with AI workflows
  • FastMCP Integration: Built with FastMCP for optimal performance and ease of use

Prerequisites

  • Python 3.10
  • UV package manager
  • Mistral AI API key

Installation

1. Clone the Repository

git clone <repository-url>
cd lizeur

2. Create and Activate Virtual Environment

# Create a virtual environment
uv venv --python 3.10

# Activate the virtual environment
# On macOS/Linux:
source .venv/bin/activate

# On Windows:
# .venv\Scripts\activate

3. Install Dependencies and Build

# Install dependencies
uv sync

# Build the package
uv build

4. Install System-Wide

# Install the package system-wide
uv pip install --system .

This will install the lizeur command globally on your system.

MCP Configuration

Add the following configuration to your mcp.json file:

{
  "mcpServers": {
    "lizeur": {
      "command": "lizeur",
      "env": {
        "MISTRAL_API_KEY": "your-mistral-api-key-here",
        "CACHE_PATH": "your cache path",
      }
    }
  }
}

Usage

Once configured, the MCP server provides a read_pdf tool that can be used by AI assistants:

  • Function: read_pdf
  • Parameter: absolute_path (string) - The absolute path to the PDF file
  • Returns: Markdown text extracted from the first page of the PDF

Example Usage in AI Assistant

The AI assistant can now use the tool like this:

What the OP code looks like for this specific controller, here is the doc /path/to/document.pdf

The MCP server will:

  1. Check if the document is already cached
  2. If not cached, upload the PDF to Mistral AI for OCR processing This will use your MISTRAL API key and cost money
  3. Extract the text and convert it to markdown
  4. Cache the result for future use
  5. Return the markdown content

Development

Local Development Setup

# Install in development mode
uv pip install -e .

# Run the server directly
python main.py

Project Structure

  • main.py - Main server implementation with FastMCP integration
  • pyproject.toml - Project configuration and dependencies
  • uv.lock - Locked dependency versions

Dependencies

  • mcp[cli]>=1.12.4 - Model Context Protocol implementation
  • mistralai>=0.0.10 - Mistral AI Python client

License

This project is marked as private and should not be uploaded to public package repositories.

Support

For issues and questions, please refer to the project repository or contact the maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lizeur-0.1.0.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lizeur-0.1.0-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file lizeur-0.1.0.tar.gz.

File metadata

  • Download URL: lizeur-0.1.0.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for lizeur-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e43acb4d291a4f0bceba37ec5d8cb77f7887bc9d5ee8ea473a3aa6b59076d200
MD5 073617f0d0611874fd902990f276f0c5
BLAKE2b-256 38c7fda14218f1c6071900bd8335b466f911ff50d926a52e46772ddb0695e9c8

See more details on using hashes here.

File details

Details for the file lizeur-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lizeur-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for lizeur-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f14c06a3554159419f53880302049b639dfce6372887587010e037b2672f7f3e
MD5 7af35de5d7d9828ccb89578756e54f35
BLAKE2b-256 472ff1d77bc311367c7cb50481d1215a027a5aa1bb0adfebec1abf4888e59c0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page