Skip to main content
Glama

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 PDF

  • Full Parameter Coveragecrop_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.server

Option 2: Transformers backend (local GPU)

UNLIMITED_OCR_BACKEND=transformers \
UNLIMITED_OCR_MODEL=baidu/Unlimited-OCR \
python -m mcp.server

Option 3: SSE transport (for remote agents)

UNLIMITED_OCR_BACKEND=http \
python -m mcp.server --transport sse --port 8080

Configure 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

image_path

string

required

Path to the image file

image_mode

gundam | base

gundam

Image processing mode

output_dir

string

Directory to save results

no_repeat_ngram_size

int

35

N-gram repetition penalty

ngram_window

int

128

N-gram window size

max_length

int

32768

Max output token length

Image modes:

  • gundam (default): base_size=1024, image_size=640, crop_mode=True — recommended for most images

  • base: 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

image_paths

string[]

required

List of image paths

output_dir

string

Directory to save results

no_repeat_ngram_size

int

35

N-gram repetition penalty

ngram_window

int

1024

N-gram window size

max_length

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

pdf_path

string

required

Path to the PDF file

dpi

int

300

DPI for PDF-to-image conversion

output_dir

string

Directory to save results

no_repeat_ngram_size

int

35

N-gram repetition penalty

ngram_window

int

1024

N-gram window size

max_length

int

32768

Max output token length

Configuration

Environment variables:

Variable

Default

Description

UNLIMITED_OCR_BACKEND

transformers

Backend: transformers or http

UNLIMITED_OCR_MODEL

baidu/Unlimited-OCR

Model name or path

UNLIMITED_OCR_SERVER_URL

http://127.0.0.1:10000

vLLM/SGLang server URL

UNLIMITED_OCR_TORCH_DTYPE

bfloat16

Torch dtype (transformers only)

UNLIMITED_OCR_DEVICE

cuda

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.md

Requirements

  • Python >= 3.10

  • MCP backend: mcp SDK >= 1.0.0

  • Transformers backend: torch, transformers, Pillow, einops, addict, easydict

  • HTTP backend: requests (vLLM or SGLang server running separately)

  • PDF support: pymupdf >= 1.23.0

License

Apache License 2.0

Available Tools

3 tools
ocr_parse_imageB

Parse a single image using Unlimited-OCR. Supports 'gundam' (crop mode) and 'base' modes.

ParametersJSON Schema
NameRequiredDescriptionDefault
image_modeNogundam
image_pathYesPath to the image file.
max_lengthNo
output_dirNo
ngram_windowNo
no_repeat_ngram_sizeNo

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
max_lengthNo
output_dirNo
image_pathsYes
ngram_windowNo
no_repeat_ngram_sizeNo

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness1/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dpiNo
pdf_pathYes
max_lengthNo
output_dirNo
ngram_windowNo
no_repeat_ngram_sizeNo

TDQS

C2.1/5.0
Behavior1/5

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.

Conciseness2/5

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.

Completeness1/5

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.

Parameters1/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

B3.3/5.0
Disambiguation5/5

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.

Naming Consistency5/5

All tools follow the consistent 'ocr_parse_<input>' pattern using snake_case. The naming is predictable and immediately communicates each tool's purpose.

Tool Count5/5

Three tools is a well-scoped size for an OCR-focused server, covering the main input types without unnecessary bloat.

Completeness5/5

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

ActivityMaintained
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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