mcp-dharmamitra
Supports requests to Cloudflare-protected Dharmamitra OCR endpoints by attaching a configured cf_clearance cookie when provided, helping avoid 403 responses.
Click on "Deploy 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., "@mcp-dharmamitraOCR /data/scan.png and save the Tibetan text to /data/out.txt"
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.
mcp-dharmamitra
MCP server that runs OCR on an image via the public Dharmamitra OCR endpoint and writes the extracted text to a local file. Optimised for Tibetan / Sanskrit / Devanagari input.
Tool
ocr_image
Argument | Type | Default | Notes |
|
| — | Absolute path to a local image (png/jpg/…). |
|
| — | File to write UTF-8 text into. Parent dirs are created. |
|
|
| Passed to the API. |
|
|
| Passed to the API. |
|
|
| Optional model instruction. |
|
|
| OCR model id. |
|
|
| Delay between status polls. |
|
|
| Overall polling deadline. |
Returns a small JSON summary — the extracted text is written to output_path,
not returned to the client.
{
"job_id": "b8b26984b3ca49199c28303cad6a144d",
"output_path": "/abs/path/out.txt",
"pages": 1,
"processing_time_seconds": 3.957,
"chars": 1234
}Related MCP server: Tesseract OCR MCP Server
Install
uv sync # or: pip install -e '.[dev]'Run locally with the MCP inspector:
uv run mcp dev src/mcp_dharmamitra/server.pyRun tests:
uv run pytestWire into Claude Desktop / Claude Code
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"dharmamitra": {
"command": "uv",
"args": ["--directory", "/path/mcp-dharmamitra", "run", "mcp-dharmamitra"],
"env": {"DHARMAMITRA_COOKIE": ""}
}
}
}Docker
Build the image:
docker build -t mcp-dharmamitra:latest .MCP talks over stdio, so the container must be run with -i (no -t). Mount
a host directory that holds the input images — the tool arguments
(image_path, output_path) are paths inside the container.
Smoke-test the entrypoint:
docker run --rm --entrypoint python mcp-dharmamitra:latest \
-c "from mcp_dharmamitra.server import mcp; print(mcp.name)"Wire the container into Claude Desktop / Claude Code
Replace /Users/aleksei/projects/ai/mcp-dharmamitra/tmp with any host
directory you want the tool to be able to read/write. Files inside it will be
visible under /data in the container.
{
"mcpServers": {
"dharmamitra": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/Users/aleksei/projects/ai/mcp-dharmamitra/tmp:/data",
"-e", "DHARMAMITRA_COOKIE",
"mcp-dharmamitra:latest"
],
"env": {
"DHARMAMITRA_COOKIE": ""
}
}
}
}Or the same via CLI:
claude mcp add dharmamitra \
--scope project \
-e DHARMAMITRA_COOKIE="" \
-- docker run -i --rm \
-v /Users/aleksei/projects/ai/mcp-dharmamitra/tmp:/data \
-e DHARMAMITRA_COOKIE \
mcp-dharmamitra:latestWhen calling the tool, pass container paths. Example — image at
<host>/tmp/text.png → /data/text.png:
{
"image_path": "/data/text.png",
"output_path": "/data/text.txt"
}The resulting text.txt appears in the mounted host directory.
Cloudflare / cf_clearance
The endpoint sits behind Cloudflare. Most requests go through without any
cookie. If you start getting 403, grab a fresh cf_clearance value from a
logged-in browser session on dharmamitra.org and export it:
export DHARMAMITRA_COOKIE='cf_clearance value here'The server will attach it as a cookie on every request. Do not hardcode it — Cloudflare rotates the value.
Available Tools
1 toolocr_imageA
Run Dharmamitra OCR on an image and save extracted text to a file.
Args: image_path: Absolute path to a local image file (png/jpg/…). output_path: File path where the extracted text will be written (UTF-8). transliterate_devanagari_to_iast: Pass-through flag for the API. transliterate_tibetan_to_wylie: Pass-through flag for the API. instruction: Optional instruction string for the OCR model. model: OCR model id ("auto" by default). poll_interval_seconds: Delay between status polls. timeout_seconds: Overall polling timeout.
Returns a summary with job_id, output_path, pages, processing time and char count.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | auto | |
| image_path | Yes | ||
| instruction | No | ||
| output_path | Yes | ||
| timeout_seconds | No | ||
| poll_interval_seconds | No | ||
| transliterate_tibetan_to_wylie | No | ||
| transliterate_devanagari_to_iast | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden. It adds real behavioral context beyond the schema: the operation is an async job (poll_interval_seconds, timeout_seconds, job_id in the return), and it names the returned summary fields. It stops short of stating auth requirements, error behavior, or whether output_path is overwritten.
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?
Front-loaded with the core action, then a clean args list and a return summary. It is longer than a single sentence but every line adds parameter or return semantics, so little is wasted.
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 eight parameters, a write side effect, and no annotations, the description covers inputs and the return shape well. Remaining gaps—overwrite semantics for output_path, permissions/auth, and failure modes—are minor for an OCR utility whose output schema is provided.
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%, so the description must compensate, and it does for all eight parameters: path formats (absolute, png/jpg), UTF-8 output, the meaning of the two transliteration flags, the optional instruction, the 'auto' model default, and what the polling/timeout knobs control.
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 verb and resource: 'Run Dharmamitra OCR on an image and save extracted text to a file.' The input and the side effect (writing extracted text to a file) are both named, so an agent knows exactly what the tool accomplishes without opening the schema.
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 purpose implies the usage context (OCR of a local image), but there is no explicit when-to-use, when-not, or alternative-tool guidance. With no siblings this is less costly, but the description still leaves selection and prerequisites to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
ocr_image
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of selecting the wrong one; its purpose (OCR an image and write text to a file) is unambiguous. An agent cannot confuse it with anything else in this server.
The single tool uses a clean, predictable verb_noun-style name (ocr_image) with snake_case arguments that match the naming convention. No competing conventions exist to create inconsistency.
One tool is thin for a named service like Dharmamitra, which suggests an OCR/document-processing domain that could span submission, status, and result retrieval. The tool does bundle the full submit-and-poll workflow, so it is self-contained, but the surface is minimal.
The core OCR operation, polling, and file output are covered, but there is no batch processing, no job status/list/cancel operation, and no way to discover supported models or endpoints. These are workable gaps but leave the lifecycle incomplete.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Convert images to PNG, JPEG, WebP, or AVIF through one public remote MCP tool.
OCR.space MCP — wraps the OCR.space API (ocr.space) for image/PDF → text OCR.
OCR and document understanding: extract text from images, then summarize or translate it.
Related MCP Servers
- FlicenseAqualityDmaintenanceA Tesseract.js-based server that enables image-to-text recognition within MCP-compatible environments like Cursor. It supports multiple languages and common image formats, allowing users to extract text from local files using natural language commands.2-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants and applications to perform optical character recognition (OCR) from images via stdin/stdout streams or REST API endpoints.-
- AlicenseNot gradedqualityCmaintenanceEnables OCR-based text, table, handwriting, and formula recognition from images via MCP, supporting local files and URLs for integration with AI assistants.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to perform local OCR on image files or base64-encoded images, returning recognized text with optional bounding boxes and confidence scores.1Apache 2.0