PDF Reader — Universal Agent Plugin
Local pdf.js context canvas & 14-tool MCP server for Antigravity, Claude Desktop, and DeepSeek Harness — 1-step area crop, dual-column clean read, BM25 search, native PDF annotations, macOS Vision OCR, and live Typora sync.
English · 简体中文
🌐 Works Natively Across Three Agent Ecosystems
| Host | Visual Reader Experience | MCP & Skill Integration | One-Step Install |
|---|---|---|---|
| Google Antigravity | Docked right-hand sidecar pane (sidecar://pdf-reader/reader/) with 96px bottom safe area |
plugin.json + mcp_config.json + SKILL.md + AGENTS.md |
agy plugin install ... or unzip pdf-reader-v2.0.0.zip |
| Claude Desktop (+ Claude Code) | Local standalone pdf.js web reader (http://127.0.0.1:18765, auto-launched on pdf_open) |
One-click .mcpb bundle (manifest.json) + claude_desktop_config.json + ~/.claude/skills |
Double-click pdf-reader-v2.0.0.mcpb or bash bin/install.sh --target claude-desktop |
DeepSeek Harness (dsh) |
Local standalone pdf.js web reader (http://127.0.0.1:18765, auto-launched on pdf_open) |
Cordis plugin (package.json) + @deepseek-ai/dsh-mcp-client (cordis.patch.yml) + .agents/skills |
bash bin/install.sh --target deepseek-harness |
✨ Key Features
- Pure Context Supply Mode (No Conflicting Second Chat Box):
- Keep using your host's native chat box (
Ask anything, Claude Desktop, ordsh) with full model switching, voice,/commands,@file mentions, and streaming stop — zero duplicate chat input covering the viewer, with a 96px bottom safe area so the last page stays unobstructed. - Select text or drag a 1-step crop box (
Option/Alt+ drag or pressA) to attach live selection or high-res equation/figure captures to the top context chip. Ask naturally in chat —pdf_current()delivers your active selection, book page offset, and cropped PNG image directly in one call!
- Keep using your host's native chat box (
- 1-Step Area Marquee & 4-Color Semantic Annotations:
- Highlight text as 🟨 Key Point, 🟥 Hard, 🟩 Concept, or 🟦 Question with instant inline follow-up commenting, or press
Hfor Highlighter Pen Mode (⌘Z/⌘⇧Zundo & redo). - Hold
Option/Alt+ drag (or pressA) on equations, figures, tables, or scanned pages to save 4-color area capture notes (kind: "area"), pin as ask context, or copy the high-res crop.
- Highlight text as 🟨 Key Point, 🟥 Hard, 🟩 Concept, or 🟦 Question with instant inline follow-up commenting, or press
- Academic Reading UX:
- Back / Forward Jump History (
⌘[/⌘]), Internal Link Hover Peek (hover citations/equations for 350ms to preview the target slice), Book Page Offset (map printed textbook page 1 to any PDF physical page), 90° Page Rotation, Agent Spotlight (pdf_navigatescrolls and pulses the explained passage), Night Mode (Dark Pages), responsive side-by-side drawer on wide panes, and automatic English / Chinese UI.
- Back / Forward Jump History (
- Dual-Column Clean Read, BM25 Multi-Doc Search & macOS Vision OCR:
pdf_readreorders two-column academic layouts and strips repeating headers/footers;pdf_searchranks hits with pure-Python BM25 + exact-phrase boost + TOC section paths across the current PDF or all registered PDFs (scope="all").pdf_crop_imagezooms into dense equations/subfigures at up to 280+ DPI in memory;pdf_ocrruns local Apple Vision OCR on scanned pages on macOS and caches results locally forpdf_readandpdf_search.
- Native PDF Annotations + Live Markdown / Typora Sync:
pdf_notesreads both plugin notes and native PDF/Annothighlights/comments (created in Preview, iPad, or Zotero).- Notes stay clean and curated (added manually or via
pdf_add_noteon demand, while preserving legacyqanotes) and sync atomically into~/Documents/PDF Notes/<Title>.md(preserving<!-- My Notes:start ... -->). Export to Typora or write a separate Annotated PDF copy (pdf_export_notes(format="annotated_pdf")) without ever touching the source PDF.
- 14-Tool MCP Server (
pdf_reader_mcp) & Single Python Storage Kernel:- One zero-dependency Python stdlib storage kernel (
server/pdf_store.py) shared by both the MCP server and the thin Node gateway (sidecars/reader/main.mjs), with strict read-only / non-destructive AST safety guarantees.
- One zero-dependency Python stdlib storage kernel (
🚀 Installation
Prerequisites (All Hosts)
- Node.js >= 18 (zero
npm installneeded — uses built-in Node APIs only) - Python 3 with
mcpandpymupdf(oruvinstalled — the launcher auto-detects conda, Homebrew, system Python, oruv run):pip install -r requirements.txt
Quick Install (Any or All Hosts)
Clone the repository anywhere and run the unified installer (automatically backs up existing configs before merging):
git clone https://github.com/Aludel/antigravity-pdf-reader
cd antigravity-pdf-reader
pip install -r requirements.txt
# Install for all three hosts at once:
bash bin/install.sh --target all
# Or target a single host:
bash bin/install.sh --target antigravity
bash bin/install.sh --target claude-desktop
bash bin/install.sh --target deepseek-harness
Host-Specific Setup Details
1. Claude Desktop (One-Click .mcpb Extension)
- Download
pdf-reader-v2.0.0.mcpbfrom Releases. - Double-click
pdf-reader-v2.0.0.mcpb— or open Claude Desktop → Settings → Extensions → Advanced settings → Install Extension… and select the.mcpbfile. - Ask Claude: "Open
~/Downloads/paper.pdfon page 4 with PDF Reader" — your browser opens the interactive reader side-by-side with Claude Desktop!
(Manual claude_desktop_config.json template is also provided in integrations/claude-desktop/claude_desktop_config.example.json.)
2. DeepSeek Harness (dsh)
bash bin/install.sh --target deepseek-harness sets up everything automatically:
- Copies
SKILL.mdinto~/.dsh/skills/pdf-reader/SKILL.mdand~/.agents/skills/pdf-reader/SKILL.md(and.agents/skills/pdf-reader/SKILL.mdis bundled in-repo for workspace auto-discovery). - Registers
pdf_reader_mcpvia@deepseek-ai/dsh-mcp-clientin~/.dsh/cordis.patch.yml(exposingmcp__pdf_reader_mcp__pdf_open,mcp__pdf_reader_mcp__pdf_current, etc.) and writes~/.dsh/mcp.json. - Also exports a native Cordis plugin entry (
integrations/deepseek-harness/index.mjsvia rootpackage.json). Seeintegrations/deepseek-harness/cordis.patch.ymlfor manual profile patching (~/.dsh/profiles/web/cordis.patch.yml).
3. Google Antigravity
# Option A: agy CLI
agy plugin install https://github.com/Aludel/antigravity-pdf-reader
# Option B: Release zip
mkdir -p ~/.gemini/config/plugins
unzip pdf-reader-v2.0.0.zip -d ~/.gemini/config/plugins/
⌨️ Controls & Shortcuts
| Action | Shortcut / Gesture |
|---|---|
| Previous / Next page, Jump to page | Scroll, ← / →, or type a page number in the top bar and press Enter |
| Back / Forward jump history | ⌘[ / ⌘] or click ↩ / ↪ in the top bar |
| Preview internal citation / link | Hover an internal link for 350ms to open the hover peek card; click preview to jump |
| Book page offset | Click the page suffix in the top bar to set "Current PDF page = Book page 1" |
| Zoom, Fit mode & Rotate | ⌘+ / ⌘-, pinch, ⌘0 or Width / Page, and ↻ to rotate 90° |
Night Mode (Dark Pages) |
Top-right ⋯ → Dark Pages |
| Highlight selected text | Select text → click 🟨 Key Point, 🟥 Hard, 🟩 Concept, or 🟦 Question (follow-up bar lets you add a comment or undo immediately) |
| Highlighter Pen Mode | Click the pen icon or press H (drag-select highlights immediately; Esc exits) |
| 1-step Area Crop / Area Note | Press A or hold Option/Alt + drag anywhere → save as 4-color area note, click 📌 to pin for host chat, or copy image |
| Pin text selection for host chat | Select text → click 📌 (stays pinned in the top context chip even while browsing other pages) |
| Add a page note | Press N, or click + Page Note inside the ☰ Notes drawer |
| Undo / Redo annotations | ⌘Z / ⌘⇧Z |
| Open notes in Typora / Export PDF | ☰ drawer or ⋯ → Open Notes in Typora / Export Annotated PDF |
🛠️ MCP Tools (pdf_reader_mcp — 14 Tools)
| Tool | Safety Hints (RO / Destructive) |
Description |
|---|---|---|
pdf_current |
Read-Only | Returns active PDF, current/book page, pdf_offset, live selection, active_context, and inline cropped PNG Image when an area capture is pinned |
pdf_open |
Write (Non-destructive) | Opens a local PDF in Antigravity's sidecar pane or launches the standalone pdf.js web reader (supports use_book_page) |
pdf_navigate |
Write (Non-destructive) | Smoothly scrolls the open reader to a page, quote, or bbox and flashes a temporary spotlight without adding a permanent note |
pdf_set_page_offset |
Write (Non-destructive) | Sets which physical PDF page corresponds to printed book page 1 (pdf_offset = pdf_page_for_book_page_1 - 1) |
pdf_read |
Read-Only | Dual-column-reordered, header/footer-denoised text extraction ("3", "3-5", "current", "all"; supports use_book_pages and cached OCR) |
pdf_search |
Read-Only | Pure read-only BM25 + exact-phrase search with TOC section paths across the current PDF or all registered PDFs (scope="all") |
pdf_outline |
Read-Only | Reads PDF metadata, pdf_offset, embedded page_labels summary, and built-in table of contents |
pdf_page_image |
Read-Only | Renders any page in memory to PNG (returned as an MCP Image) for page-wide figures, tables, or scans |
pdf_crop_image |
Read-Only | Renders a normalized [x, y, w, h] region in memory at high DPI (up to 2400px) for dense equations or subfigures |
pdf_ocr |
Write (Non-destructive) | Local macOS Vision OCR on up to 20 scanned pages per call; caches recognized text and word boxes in .pdfnotes/cache/ |
pdf_notes |
Read-Only | Lists plugin highlights, area captures, page notes, legacy Q&A items, and native PDF /Annot annotations (include_native=True) |
pdf_add_note |
Write (Append) | Appends a text highlight (quote), high-res area capture note (bbox), or page note (comment) and syncs Markdown |
pdf_edit_note |
Destructive | Updates a plugin note's comment/color or permanently deletes it (read-only native pdf_* annotations cannot be deleted) |
pdf_export_notes |
Destructive (Overwrite) | Syncs Markdown (~/Documents/PDF Notes/<Title>.md) and opens Typora/Finder, or exports a separate annotated PDF copy (never overwrites source PDF) |
📂 Repository Layout
plugin.json Antigravity plugin manifest
manifest.json Claude Desktop .mcpb extension manifest
package.json DeepSeek Harness (dsh) / Cordis package manifest
.claude-plugin/plugin.json Claude Code plugin manifest
.agents/skills/pdf-reader/ DeepSeek Harness workspace auto-discovered skill
mcp_config.json Antigravity MCP server config
bin/mcp-launcher.mjs Cross-platform Python/uv auto-discovery stdio launcher
bin/run-mcp-server.sh POSIX shell launcher & CLI tool runner
bin/install.sh Safe multi-host installer (--target antigravity|claude-desktop|deepseek-harness|all)
server/mcp_server.py 14-tool FastMCP server & standalone reader supervisor
server/pdf_store.py Pure-stdlib single storage kernel, book page offset, Markdown sync & --stdio-worker RPC
server/pdf_layout.py PyMuPDF dual-column reorder, header/footer denoise, BM25 search, bbox crop & native /Annot I/O
server/pdf_ocr_mac.py Local macOS Vision.framework on-demand OCR & cache
sidecars/reader/ Dual-mode pdf.js context canvas (thin Node gateway + pure context supply UI)
integrations/ Ready-to-use configs for Claude Desktop & DeepSeek Harness (cordis.patch.yml)
skills/pdf-reader/SKILL.md Cross-host agent skill instructions (synced with .agents/skills/)
rules/AGENTS.md Always-on rule for live PDF context supply & prompt-injection safety
assets/ Logo (logo.svg, icon.png) & showcase (demo.svg)
🔒 Privacy & License
- 100% Local-First Privacy: All PDF parsing, page rendering, local OCR, highlights, area captures, and notes stay strictly on your local machine with zero telemetry and zero external network calls — see PRIVACY.md and SECURITY.md.
- License: Plugin source code is licensed under the MIT License. Vendored
pdf.js(5.4.624) remains under its original Apache-2.0 license — see THIRD_PARTY_NOTICES.md and CHANGELOG.md.
Metadata
Release files for antigravity-pdf-reader 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| antigravity_pdf_reader-2.0.0.tar.gz | 2.4 MB | With provenance | Details for antigravity_pdf_reader-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| antigravity_pdf_reader-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for antigravity_pdf_reader-2.0.0-py3-none-any.whl |
Total release size: 4.9 MB
Release files / antigravity_pdf_reader-2.0.0.tar.gz
| Download URL | antigravity_pdf_reader-2.0.0.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3eb1e56b746d211095c4a5e574c9e1bf4eaa938bc4fac47c19a7d4a4f106bdf3
|
|
BLAKE2b-256 checksum How to use checksums |
a4881b139fb8d29aa0f7723c571e5a3d79767291a27bcfa611f8aed90104de12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logRelease files / antigravity_pdf_reader-2.0.0-py3-none-any.whl
| Download URL | antigravity_pdf_reader-2.0.0-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
145319ab48700641ec6b8d2b100731cb47daafdb39db813af8fd082898b1fc40
|
|
BLAKE2b-256 checksum How to use checksums |
905b1b206915050626cab774144da18b46f1ddb0aab3f31a31d2f8ed1b0a2ed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logSecurity for antigravity-pdf-reader 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for antigravity_pdf_reader-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.