- Home
- MCP servers
- OCR-MCP Server
OCR-MCP Server
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"sandraschi-ocr-mcp": {
"command": "python",
"args": [
"-m",
"ocr_mcp.server"
],
"env": {
"OCR_DEVICE": "cuda",
"OCR_CACHE_DIR": "/path/to/model/cache"
}
}
}
}OCR-MCP is a FastMCP server that adds advanced optical character recognition (OCR) capabilities to MCP clients. It processes a wide range of document formats, supports multiple OCR backends, and includes direct scanner control for Windows-based hardware, enabling automated, scalable document processing workflows inside the MCP ecosystem.
How to use
You use OCR-MCP by configuring an MCP client to connect to the OCR-MCP server, then sending documents for OCR processing. You can process single documents or batches, choose from multiple OCR backends, and receive results in text, HTML, JSON, or other supported formats. Use the web interface for convenient drag-and-drop processing, scanner control, and live status updates, or connect programmatically from your own client to integrate OCR into your automation pipelines.
How to install
Prerequisites: Python 3.11 or newer. A GPU is recommended for best performance with ML-based OCR models.
Install and run the OCR-MCP server using the provided runtime command. Ensure you have the required environment variables set for model caching and device configuration.
Next, start the OCR-MCP server so your MCP clients can connect and send documents for processing.
Configuration and usage notes
The server runs as a local stdio MCP endpoint. You define how to start it and what environment it uses in your MCP configuration. The key environment variables shown are used to control model caching and device selection.
If you are integrating with an MCP client, specify the stdio server configuration so your client can spawn and communicate with the OCR-MCP process.
Tools and features
OCR-MCP exposes a set of processing tools for document OCR and analysis, including multi-backend processing, region-based extraction, and layout analysis. You can perform single-document OCR, batch processing, region extraction, format conversion, and health checks to verify backend availability.
Security and access
Limit access to the OCR-MCP service to trusted MCP clients. Use network security measures for any remote deployments and control the environment in which OCR models run to protect sensitive documents.
Troubleshooting tips
If processing is slow or backends fail to respond, check GPU availability, verify that the chosen backend is accessible, and confirm that the OCR cache directory is writable. Review the server logs for any errors related to model loading or device configuration.
Available tools
process_document
Main OCR processing function with automatic backend selection for a given document path or image and options.
process_batch
Batch processing function to process multiple documents concurrently with progress tracking.
extract_regions
Fine-grained OCR on specified regions within a document, returning region-specific text data.
analyze_layout
Analyze document structure and layout, including tables, headers, and text blocks.
convert_format
Convert OCR results between formats, such as text, HTML, JSON, and XML.
ocr_health_check
Diagnostics to verify backend availability and health.