Inline Nitro PDF viewer in Claude#90
Closed
SudNitro23 wants to merge 5 commits into
Closed
Conversation
Render PDFs inside the Claude conversation using Nitro's nitro-pdf-reader web component, folded into one self-contained MCP-App HTML — no browser popup, no network, no second login. - view_pdf tool mounts the viewer as an MCP-App resource; PDF bytes stream over the MCP transport via get_pdf_for_viewer (the sandbox CSP blocks all outbound network). - scripts/inline-viewer.mjs bundles the multi-file public-reader build into one HTML: app chunks + worker inlined, Pdfium WASM fed via emscripten wasmBinary, Kendo CSS + IBM Plex fonts inlined as data: URLs. - scripts/viewer-bridge.js connects via @modelcontextprotocol/ext-apps, loads the file, reroutes Download through the host, and adds a widescreen toggle. - save_pdf_edits is a stub pending a component save event. - Remove the legacy popup/companion editor and its express/open deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Closing — keeping this as a POC branch ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
view_pdf— renders a PDF in Nitro's reader inline inside the Claude conversation (MCP-App iframe). No browser popup, no second login, no network.How it works
The viewer is Nitro's
nitro-pdf-readerAngular web component (apps/public-reader). The MCP-App sandbox has no origin and blocks all outbound network, so the multi-file build is folded into one self-contained HTML:scripts/inline-viewer.mjs— collapses app chunks + dynamic imports into one ESM bundle (esbuild), embeds the worker as a Blob URL, injects the Pdfium WASM via emscriptenwasmBinary(sandbox CSP blocksfetch()of evendata:URLs), inlines the Kendo theme + IBM Plex fonts asdata:URLs.scripts/viewer-bridge.js— connects via@modelcontextprotocol/ext-apps, streams the PDF bytes over the MCP transport, reroutes Download through the host, adds a widescreen toggle + Esc/⌘Z/⌘⇧Z shortcuts.src/tools/viewer.ts— registersview_pdf, theget_pdf_for_viewerbyte provider, and asave_pdf_editsstub.Notes for reviewers
src/assets/mcp-app.htmlis a generated ~26 MB single-file bundle (built byinline-viewer.mjs), committed so the release workflow produces a working extension. Excluded from lint/format.manifest.jsonversion unchanged — the Publish Release workflow owns version bumps.🤖 Generated with Claude Code