About
Tesseract — Model Context Protocol server
README
A Model Context Protocol (MCP) server that provides OCR capabilities for PDF documents using Tesseract OCR. This server allows AI assistants to extract text from PDF files, supporting multiple languages including English and Simplified Chinese out of the box.
Features
- PDF to Text Conversion: Extract text from PDF documents using OCR technology
- Multi-language Support: Process documents in multiple languages (English and Simplified Chinese by default)
- Dockerized Solution: Easy deployment with Docker
- MCP Integration: Seamlessly integrates with AI assistants that support the Model Context Protocol
Prerequisites
- Docker installed on your system
Build Instructions
Build the Docker image with the following command:
docker build -t tesseract-pdf-mcp .
Running the Server
Run the MCP server with the following command:
docker run -it --rm \
-v /path/to/your/pdfs:/pdfs \
tesseract-pdf-mcp
Important Notes:
- The
-v /path/to/your/pdfs:/pdfsoption mounts a volume from your host system to the Docker container, allowing the server to access PDF files. - Replace
/path/to/your/pdfswith the actual path to the directory containing your PDF files. - The server will be accessible via standard input/output (stdio) as specified in the MCP protocol.
Usage
The server provides a tool called convert_pdf that can be used to extract text from PDF files.
Input
The convert_pdf tool accepts the following JSON input:
{
"file_path": "/pdfs/document.pdf",
"language": "eng"
}
Parameters:
file_path(required): Path to the PDF file to process. This should be the path inside the container (e.g.,/pdfs/document.pdf).language(optional): Language for OCR processing. Default is"eng"(English).- Available languages by default:
"eng"(English),"chi_sim"(Simplified Chinese)
- Available languages by default:
Output
The tool returns a JSON response with the following structure:
{
"status": "success",
"output_path": "/pdfs/document.txt"
}
On success:
status: Will be"success"output_path: The absolute path to the generated text file
On error:
status: Will be"error"message: Error descriptionoutput_path: Will benull
Example Usage
When connected to an AI assistant that supports MCP:
- The assistant can use the
convert_pdftool to extract text from a PDF file - The text file will be created in the same directory as the PDF file
- The assistant can then access the text file to analyze its contents
Connecting to AI Tools
To connect this MCP server to AI tools that support the Model Context Protocol, you'll need to configure the tool with the appropriate settings.
Configuration Example
Add the following configuration to your AI tool's settings:
{
"mcpServers": {
"tesseract-pdf-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/your/pdfs:/pdfs",
"tesseract-pdf-mcp"
],
"disabled": false,
"autoApprove": []
}
}
}
Make sure to replace /path/to/your/pdfs with the actual path to your PDF files directory.
Usage with AI Tools
Once connected:
- The AI tool will have access to the
convert_pdftool provided by this MCP server - You can ask the AI to extract text from PDF documents
- The AI will use the MCP server to process the PDFs and access the resulting text
Adding More Languages
The server comes with English (eng) and Simplified Chinese (chi_sim) language support by default. To add more languages:
- Modify the
Dockerfileby adding additional language packs to theapt-get installcommand:
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-chi-sim \
tesseract-ocr-fra \ # Add French
tesseract-ocr-deu \ # Add German
tesseract-ocr-spa \ # Add Spanish
poppler-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
- Rebuild the Docker image:
docker build -t tesseract-pdf-mcp .
Available Language Codes
Some common language codes for Tesseract OCR:
eng: Englishchi_sim: Simplified Chinesechi_tra: Traditional Chinesefra: Frenchdeu: Germanspa: Spanishita: Italianjpn: Japanesekor: Koreanrus: Russian
For a complete list of available language packs, refer to the Tesseract documentation.
Debugging Inside the Container
If you need to debug or test the PDF conversion logic directly inside the container, follow these steps:
Starting an Interactive Shell
Launch an interactive shell session in the container with the following command:
docker run --rm -it -v /path/to/your/pdfs:/data tesseract-pdf-mcp /bin/bash
This command:
- Creates a container from the
tesseract-pdf-mcpimage - Mounts your local PDF directory to
/datainside the container - Overrides the default command to start a bash shell
- Removes the container automatically when you exit (
--rm)
Working Inside the Container
Once inside the container's shell, you can:
- Navigate the filesystem using standard Linux commands (
cd,ls, etc.) - Access your mounted PDFs in the
/datadirectory - Run Python scripts or start an interactive Python session
Testing the Conversion Function
You can test the PDF to text conversion directly using Python's interactive shell:
# Start Python interactive shell
python3
# Import the conversion function
from ocr.converter import pdf_to_text
# Process a PDF file (replace with your actual filename)
output_path = pdf_to_text('/data/my_document.pdf', lang='eng')
# Verify the result
print(f"Conversion successful. Output saved to: {output_path}")
# Exit Python shell
exit()
The converted text file will be saved in the same directory as your PDF file (in the /data directory), making it accessible from your host machine as well.
Installing Tesseract
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/maximdx/tesseract-mcp-serverFAQ
Is Tesseract MCP free?
Yes, Tesseract MCP is free — one-click install via Unyly at no cost.
Does Tesseract need an API key?
No, Tesseract runs without API keys or environment variables.
Is Tesseract hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Tesseract in Claude Desktop, Claude Code or Cursor?
Open Tesseract on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Tesseract with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
