Skip to content

Expose literal OCR data to content-only MCP hosts - #226

Merged
silverstein merged 1 commit into
masterfrom
fix/ocr-host-text-20261014
Oct 14, 2026
Merged

silverstein merged 1 commit into
masterfrom
fix/ocr-host-text-20261014

Conversation

@silverstein

@silverstein silverstein commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

An actual Claude Desktop test found that optional local OCR completed and returned its source-page image, but Claude could not see the recognized words. The words were present only in structuredContent; the model-facing content contained a summary and image. Claude correctly refused to invent the missing raw OCR output.

This projects the same already-bounded payload into the existing text block. Job responses likewise expose the same job identity, progress and review paths to content-only hosts. Source/share implementations remain identical. OCR setup stays explicit and disabled by default; no engine, catalog change, word correction, extra recognition or PDF mutation is added.

Validation

  • Stonebook macOS 15.7.9, x64, Node 26.5.0: native OCR/smoke-contract bank 52/52 passed.
  • Same host: OCR jobs, output schemas, MCP contracts and packager coverage 110/110 passed across four files.
  • Three new native cases and the new job case failed against unpatched source, then passed with this fix. Cases preserve a real NVOICE QA ONLY misread, literal whitespace/quotes, 205 observed versus 200 returned and five omitted, empty proposals, image omission, and exact job progress at all stages.
  • One adjoining run initially failed five discovery expectations because the temporary installed-host OCR configuration exposed optional tools. The configuration was restored to its prior absence, and the corrected run passed. The failed log remains retained.
  • Bounded independent source review found no blocker. It did not rerun tests or qualify installed-host behavior.
  • VM and Stonebook have identical commit d185fd0358157ddeafce0dd43e7e89733e6fdc79 and tree b0470187e203650de3180a0d63adb7d23baf2bf8.

Installed-host result

Two clean isolated MCPB builds were byte-identical, with pinned consumer verification and actual Darwin/x64 packed smoke exit 0. Candidate archive SHA-256 is 99abaeb5f1de36d13bb601ee62e8eb19f96366d50fd0ec55cf038f7c2be06c72 (72,900,700 bytes). All 1,586 installed files matched it exactly.

The real installed Claude call completed in a fresh synthetic chat. Claude displayed all six literal strings, preserved NVOICE QA ONLY, flagged its mismatch against the source image and labelled the words and engine scores unverified. The source PDF remained unchanged. No Claude restart was needed.

One post-reinstall attempt in the previous chat timed out before a request appeared in the PDF Tools log. That failed attempt is preserved, not counted as a completed OCR operation. The successful native table readback and screenshot were retained from the original session evidence after the Mac later relocked. Temporary OCR configuration was removed and extension settings matched their preceding bytes.

Scope stays narrow: this qualifies the missing-text fix. It does not establish general OCR accuracy or visible inline image painting in Claude, and the broader visual-review gate remains open under the parent Bead. No public release is made. Private chats, configuration, PDFs and screenshots are not included.

Beads: pdf-toolkit-mcp-qxoj, discovered from pdf-toolkit-mcp-478i.

@silverstein
silverstein marked this pull request as ready for review October 14, 2026 21:14
@silverstein
silverstein merged commit 3a55247 into master Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant