unlimited-ocr-mcp
Exposes OCR tools for CrewAI agents to extract text from images and PDF documents.
Enables LangChain agents to invoke OCR tools for parsing single images, multiple images, and PDF documents.
Provides OpenAI-compatible tool schemas so applications using OpenAI-style function calling can invoke the OCR tools.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@unlimited-ocr-mcpExtract the text from the PDF at ./documents/scanned.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Unlimited-OCR MCP Server
MCP (Model Context Protocol) Server and Tool definitions for Unlimited-OCR — enables Agent frameworks (LangChain, DuMate, AutoGPT, CrewAI, etc.) to invoke OCR as a structured tool.
Features
MCP Server — exposes OCR capabilities via the Model Context Protocol (stdio & SSE transport)
OpenAI-compatible Tool Definitions — JSON schemas for function calling
Dual Backend — supports both local Transformers inference and remote vLLM/SGLang HTTP API
Three OCR Modes — single image (
gundam/base), multi-image, and PDFFull Parameter Coverage —
crop_mode,ngram,max_length,dpi, etc.
Related MCP server: GLM OCR MCP Server
Quick Start
Install
pip install -e ".[all]"
# Or minimal install (HTTP backend only):
pip install -e ".[pdf]"Start MCP Server
Option 1: HTTP backend (vLLM / SGLang server)
# Start an SGLang/vLLM server first
python -m sglang.launch_server \
--model baidu/Unlimited-OCR \
--served-model-name Unlimited-OCR \
--port 10000 ...
# Then start the MCP server
UNLIMITED_OCR_BACKEND=http \
UNLIMITED_OCR_SERVER_URL=http://127.0.0.1:10000 \
python -m mcp.serverOption 2: Transformers backend (local GPU)
UNLIMITED_OCR_BACKEND=transformers \
UNLIMITED_OCR_MODEL=baidu/Unlimited-OCR \
python -m mcp.serverOption 3: SSE transport (for remote agents)
UNLIMITED_OCR_BACKEND=http \
python -m mcp.server --transport sse --port 8080Configure in Agent Frameworks
Claude Desktop / MCP Client
Add to your MCP client config:
{
"mcpServers": {
"unlimited-ocr": {
"command": "python",
"args": ["-m", "mcp.server"],
"env": {
"UNLIMITED_OCR_BACKEND": "http",
"UNLIMITED_OCR_SERVER_URL": "http://127.0.0.1:10000"
}
}
}
}LangChain (direct tool call)
from skill.tool_definitions import call_tool
# Direct call — no LLM orchestrator needed
result = call_tool("ocr_parse_image", {
"image_path": "document.jpg",
"image_mode": "gundam",
})
print(result["text"])LangChain (LLM tool calling)
from skill.tool_definitions import get_openai_tools
from mcp.ocr_engine import OCREngine
tools = get_openai_tools()
llm_with_tools = llm.bind_tools(tools)
# The LLM decides when to call OCR
response = llm_with_tools.invoke("Parse the document at document.jpg")See examples/langchain_integration.py for a complete example.
Available Tools
ocr_parse_image
Parse a single image using Unlimited-OCR.
Parameter | Type | Default | Description |
| string | required | Path to the image file |
|
|
| Image processing mode |
| string | — | Directory to save results |
| int | 35 | N-gram repetition penalty |
| int | 128 | N-gram window size |
| int | 32768 | Max output token length |
Image modes:
gundam(default):base_size=1024,image_size=640,crop_mode=True— recommended for most imagesbase:base_size=1024,image_size=1024,crop_mode=False— full image processing
ocr_parse_multi
Parse multiple images (multi-page). Always uses base mode.
Parameter | Type | Default | Description |
| string[] | required | List of image paths |
| string | — | Directory to save results |
| int | 35 | N-gram repetition penalty |
| int | 1024 | N-gram window size |
| int | 32768 | Max output token length |
ocr_parse_pdf
Parse a PDF document (auto-converts pages to images, then multi-page OCR).
Parameter | Type | Default | Description |
| string | required | Path to the PDF file |
| int | 300 | DPI for PDF-to-image conversion |
| string | — | Directory to save results |
| int | 35 | N-gram repetition penalty |
| int | 1024 | N-gram window size |
| int | 32768 | Max output token length |
Configuration
Environment variables:
Variable | Default | Description |
|
| Backend: |
|
| Model name or path |
|
| vLLM/SGLang server URL |
|
| Torch dtype (transformers only) |
|
| Device (transformers only) |
Project Structure
unlimited-ocr-mcp/
├── mcp/ # MCP Server
│ ├── __init__.py
│ ├── ocr_engine.py # OCR engine (Transformers + HTTP backends)
│ ├── server.py # MCP Server (stdio + SSE transport)
│ └── pdf_utils.py # PDF to image conversion
├── skill/ # Skill / Tool definitions
│ ├── _meta.json # Skill metadata
│ ├── SKILL.md # Skill definition (name, description, instructions)
│ ├── skill-card.md # Skill card (publisher, use case, risks)
│ ├── tool_definitions.py # OpenAI-compatible tool definitions (Python)
│ └── openai_tools.json # Standalone tool schema (JSON)
├── examples/
│ ├── langchain_integration.py
│ └── mcp_client_example.py
├── pyproject.toml
├── requirements.txt
├── LICENSE
└── README.mdRequirements
Python >= 3.10
MCP backend:
mcpSDK >= 1.0.0Transformers backend:
torch,transformers,Pillow,einops,addict,easydictHTTP backend:
requests(vLLM or SGLang server running separately)PDF support:
pymupdf>= 1.23.0
Related
Unlimited-OCR — the upstream OCR model
MCP Specification — Model Context Protocol docs
Feature Request Issue #97 — the original proposal
License
Apache License 2.0
Available Tools
3 toolsocr_parse_imageB
Parse a single image using Unlimited-OCR. Supports 'gundam' (crop mode) and 'base' modes.
| Name | Required | Description | Default |
|---|---|---|---|
| image_mode | No | gundam | |
| image_path | Yes | Path to the image file. | |
| max_length | No | ||
| output_dir | No | ||
| ngram_window | No | ||
| no_repeat_ngram_size | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, but it only discloses that the tool supports gundam (crop mode) and base modes. It does not describe output behavior, side effects, file handling, or whether any writes occur (e.g., via the output_dir parameter). The description is too sparse to give the agent confidence about what happens when the tool runs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded; both sentences deliver relevant information with no filler. The format is easy to parse. It could be slightly longer to include more guidance, but for what it contains, it is well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given six parameters, no output schema, and no annotations, the description is not sufficiently complete. The agent is left without information on how most parameters behave, what output to expect, or how to handle errors. The basic purpose is clear, but the overall operational context is thin.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 17%, so the description must compensate for undocumented parameters. It explains image_mode by identifying 'gundam' as crop mode and 'base' as a plain mode, which adds value beyond the enum values. However, max_length, output_dir, ngram_window, and no_repeat_ngram_size remain entirely unexplained, leaving most parameters ambiguous.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Parse a single image using Unlimited-OCR.' This clearly distinguishes the tool from its siblings (ocr_parse_multi, ocr_parse_pdf) by scoping it to a single image. Mentioning the supported modes ('gundam' and 'base') adds further specificity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for parsing a single image, which gives context but stops short of explicitly stating when to use it versus alternatives like ocr_parse_multi or ocr_parse_pdf. There is no explicit exclusion or mention of sibling tools. The single-image qualifier is an implicit usage signal, but not a full guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ocr_parse_multiB
Parse multiple images (multi-page) using Unlimited-OCR.
| Name | Required | Description | Default |
|---|---|---|---|
| max_length | No | ||
| output_dir | No | ||
| image_paths | Yes | ||
| ngram_window | No | ||
| no_repeat_ngram_size | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'Parse multiple images using Unlimited-OCR', which adds no behavior beyond the tool name itself; there is no mention of output format, side effects, network usage, or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single crisp sentence with no filler, front-loading the core action. It is concise, though it sacrifices necessary detail for brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given five parameters, no annotations, no output schema, and no parameter-level descriptions, this one-sentence description is grossly incomplete. An agent cannot know how to set or interpret the optional parameters, what the tool returns, or when to invoke it instead of siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only loosely clarifies that image_paths holds multiple images/pages. The four optional parameters (max_length, output_dir, ngram_window, no_repeat_ngram_size) are entirely undocumented, leaving the agent to guess their meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states a specific action ('Parse') and resource ('multiple images'), and the '(multi-page)' qualifier plus sibling names (ocr_parse_image, ocr_parse_pdf) make it clearly distinct. Mentioning 'Unlimited-OCR' also adds concrete context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Use case is only implied: 'multiple images' and 'multi-page' suggest it is for bulk/page-wise OCR, but there is no explicit guidance on when to choose this tool over ocr_parse_image or ocr_parse_pdf, nor any exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ocr_parse_pdfC
Parse a PDF document using Unlimited-OCR.
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | ||
| pdf_path | Yes | ||
| max_length | No | ||
| output_dir | No | ||
| ngram_window | No | ||
| no_repeat_ngram_size | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals only that OCR is used; it does not mention whether the tool writes output files, what the returned data looks like, processing limitations, or side effects. This is nearly as opaque as a tautology.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The text is brevity itself at a single sentence, so it earns some credit for front-loading the core action. However, brevity here is under-specification: the sentence lacks any functional detail and is too sparse to guide correct invocation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with six parameters, no output schema, and no annotations, this description is severely incomplete. The agent cannot determine inputs beyond pdf_path, cannot predict output format, and cannot assess risk or resource usage. A minimally viable description would at least outline what 'parse' returns and what output_dir is for.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% and the description mentions no parameters at all. Six parameters exist, including dpi, max_length, output_dir, and ngram_window, but the agent receives no hints about their meaning, defaults, or relationships. The description does absolutely nothing to compensate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific action ('Parse'), a clear resource ('a PDF document'), and the method ('using Unlimited-OCR'). The noun phrase distinguishes this from sibling tools named for images or multi-document parsing, though it does not explicitly name the alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to choose this tool over ocr_parse_image or ocr_parse_multi, nor about preconditions like file paths or OCR suitability. The description simply states what it does, leaving all selection logic to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct input type: a single image, multiple images, or a PDF. The descriptions make the boundaries clear, so an agent can select the correct tool without confusion.
All tools follow the consistent 'ocr_parse_<input>' pattern using snake_case. The naming is predictable and immediately communicates each tool's purpose.
Three tools is a well-scoped size for an OCR-focused server, covering the main input types without unnecessary bloat.
The tool surface covers the core OCR workflows: single images, multi-image batches, and PDFs. There are no obvious missing operations for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Agent-native document parsing: PDF, scans and FR/EU invoices to structured JSON or Markdown.
Generate and read PDFs for AI agents: a generate_pdf and a read_pdf tool, priced per document.
OCR and document understanding: extract text from images, then summarize or translate it.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to recognize and extract text from images using PaddleOCR, supporting both file paths and base64 input with structured results including confidence scores and text positions.21MIT
- FlicenseAqualityCmaintenanceEnables text extraction from images and PDF files using the ZhipuAI GLM-OCR API. It allows users to process documents through local file paths or base64-encoded data for high-quality OCR results.15
- FlicenseAqualityDmaintenanceExtracts text content from PDFs and images using Mistral's OCR API, enabling OCR capabilities in MCP-compatible clients like Cursor and Claude Desktop.18
- FlicenseNot gradedqualityCmaintenanceProvides OCR capabilities for images and PDFs using Mistral AI's OCR API, supporting both local files and URLs with output in markdown or JSON format.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jexbow/unlimited-ocr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server