Setting Up a Document OCR MCP Server for Claude Desktop & Cursor
B.L.A.S.T. connects natively to Claude Desktop and Cursor using the Model Context Protocol (MCP). Registering blast_ocr.mcp_server over stdio gives an agent structured Markdown/tables, TEDS-evaluable table extraction, and inline LaTeX equations without sending files to a third-party cloud API. Verified in blast_ocr/mcp_server.py.
Step 1: Claude Desktop configuration
Add the server to claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"blast_ocr": {
"command": "python",
"args": ["-m", "blast_ocr.mcp_server"]
}
}
}
Step 2: Cursor IDE configuration
Cursor Settings → Features → MCP Servers → Add New MCP Server:
- Name:
blast_ocr - Type:
command - Command:
python -m blast_ocr.mcp_server
MCP tools exposed to AI agents
Once registered, four deterministic tools are available (blast_ocr/mcp_server.py, MCP_TOOLS):
blast_ocr_process(source_path, formats=["markdown"], engine="rapidocr", secure_mode=False, dewarp=False)— runs the full pipeline, returnsgenerated_files, atext_snippet, and jobmetadata.blast_ocr_extract_tables(source_path)— runsTableExtractoron a single image, returnstables_markdownandtables_html.blast_ocr_extract_formulas(text)— takes already-extracted plain text (not a file path), isolates inline/block LaTeX math.blast_ocr_semantic_chunk(source_path, max_tokens=512, overlap_tokens=64)— processes to Markdown, then splits into RAG-ready chunks.
All four validate incoming paths via _is_safe_mcp_path(), which blocks resolved paths under system directories (/etc, /root, /boot, /sys, /proc, /dev, /usr, /home, /var) unless they fall inside the current working directory or the OS temp directory.