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-dharmamitra OCR /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: ocr-mcp
Install from the MCP registry
Listed as io.github.alex-deus/mcp-dharmamitra
on the official Model Context Protocol registry. The package ships to PyPI as
mcp-dharmamitra and is meant to
be run with uvx — no clone, no manual install.
~/Library/Application Support/Claude/claude_desktop_config.json (or the
equivalent mcp block in Claude Code):
{
"mcpServers": {
"dharmamitra": {
"command": "uvx",
"args": ["mcp-dharmamitra"],
"env": {"DHARMAMITRA_COOKIE": ""}
}
}
}Or via the Claude Code CLI:
claude mcp add dharmamitra -e DHARMAMITRA_COOKIE="" -- uvx mcp-dharmamitraPin a specific version with uvx mcp-dharmamitra@0.1.0.
Install from source
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 pytestFor a source checkout the Claude Desktop entry uses the local path:
{
"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 /path/mcp-dharmamitra 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", "/path/mcp-dharmamitra/data:/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 /path/mcp-dharmamitra/data:/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.
Inputs: image_path (required), output_path (required), model, instruction, +4 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
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
Extract text from PNG, JPEG, TIFF, WebP, BMP and GIF images with OCR in 27 languages.
Translate text inside images while preserving layout; OCR extraction. Free API key.
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.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants and applications to perform optical character recognition (OCR) from images via stdin/stdout streams or REST API endpoints.-
- AlicenseAqualityBmaintenanceEnables OCR-based text, table, handwriting, and formula recognition from images via MCP, supporting local files and URLs for integration with AI assistants.41MIT
- 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
- AlicenseAqualityBmaintenanceEnables converting images (JPEG, PNG, GIF, WebP) into text descriptions using OpenAI-compatible vision models, with support for both local files and URLs.234 npmMIT