Skip to content

Add pdf-viewer plugin with local MCP server#72

Merged
ochafik merged 7 commits intoanthropics:mainfrom
bryan-anthropic:add-pdf-research-plugin
Mar 28, 2026
Merged

Add pdf-viewer plugin with local MCP server#72
ochafik merged 7 commits intoanthropics:mainfrom
bryan-anthropic:add-pdf-research-plugin

Conversation

@bryan-anthropic
Copy link
Copy Markdown
Contributor

@bryan-anthropic bryan-anthropic commented Feb 23, 2026

Summary

  • Adds a pdf-viewer plugin that uses a local stdio MCP server (@modelcontextprotocol/server-pdf) instead of a remote HTTP connector
  • First plugin in this repo to use the local server pattern — all existing plugins use type: "http" remote connectors
  • Exposes the server's interact tool: 10 annotation types, form filling, visual signatures, stamps, page extraction
  • Registers the plugin in marketplace.json

What's in the plugin

File Purpose
.mcp.json Local MCP server via npx -y @modelcontextprotocol/server-pdf --stdio
commands/open.md /pdf-viewer:open — open a PDF in the interactive viewer
commands/annotate.md /pdf-viewer:annotate — propose markup, review together, iterate
commands/fill-form.md /pdf-viewer:fill-form — fill form fields with live visual feedback
commands/sign.md /pdf-viewer:sign — place signature/initials images
skills/view-pdf/SKILL.md Unified skill: viewing, annotation, forms, signing workflows
CONNECTORS.md Documents the local server setup

Positioning

The viewer's value is interactivity with the user — showing the document, collaborating on markup, live form feedback. The SKILL.md explicitly steers Claude toward native Read for pure summarization/extraction and toward the viewer for annotate/fill/sign/stamp workflows.

.mcp.json (the key difference)

{
  "mcpServers": {
    "pdf": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-pdf", "--stdio"]
    }
  }
}

Instead of "type": "http" + "url", this uses "command" + "args" to start a local process. Unpinned version pulls latest (currently 1.3.1, which includes the interact tool from ext-apps#506).

Test results

Tested end-to-end via claude --plugin-dir pdf-viewer/:

Component Status
Plugin validation (claude plugin validate) PASS
MCP server connection (local stdio) PASS
list_pdfs, display_pdf, interact tools PASS — all 7 tools registered
Commands registration PASS (/pdf-viewer:{open,annotate,fill-form,sign})
Skill registration PASS (pdf-viewer:view-pdf)

Tool namespacing: mcp__plugin_pdf-viewer_pdf__<tool_name>

Open question: Cowork VM support

This works in Claude Code (desktop CLI). Unknown whether Cowork VMs support local stdio servers — all existing plugins use remote connectors, which may be a Cowork constraint or simply the pattern that's been used so far.

Test plan

  • Install: claude --plugin-dir pdf-viewer/
  • Verify MCP server connects and interact tool appears
  • /pdf-viewer:open with an arXiv URL
  • /pdf-viewer:annotate — verify propose→review loop works
  • /pdf-viewer:fill-form on a PDF with form fields
  • /pdf-viewer:sign with a signature image

Related

  • ext-apps#565 (merged) — removed the duplicate plugin/ dir from the server example; this repo is canonical

bryan-anthropic and others added 4 commits February 23, 2026 10:25
First knowledge-work plugin to use a local stdio MCP server instead of
a remote HTTP connector. The pdf-server runs locally via npx and provides
interactive PDF viewing for academic papers and local files.

Tested end-to-end in Claude Code: plugin validation, MCP server connection,
tool availability (list_pdfs, display_pdf), and command/skill registration
all confirmed working.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The underlying @modelcontextprotocol/server-pdf gained an `interact`
tool with 10 annotation types (highlight, underline, strikethrough,
note, rectangle, circle, line, freetext, stamp, image), form filling,
auto-highlight-text, page extraction, and annotated-PDF download.

This reshapes the plugin around interactive workflows:

- Rename plugin: pdf-research → pdf
- Rename skill: pdf-reading → pdf (unified, covers all capabilities)
- Commands: drop /summarize, rename /read → /open, add /annotate,
  /fill-form, /sign
- SKILL.md: document interact tool, all annotation types, coordinate
  system, interactive workflows (AI-driven annotate, form filling,
  visual signing)
- Positioning: explicitly steer AWAY from viewer for pure ingestion
  (use native Read instead) — the viewer's value is user interactivity
- /sign disclaimer: visual signature image, not certified digital sig

Out of scope (documented): summarization, cert signing, PDF generation.
Accuracy:
- list_pdfs: 'remote origins' → 'local directories' (server has no
  remote allowlist, any HTTPS works)
- get_screenshot: 'PNG' → 'image' (server returns JPEG)
- Supported sources: clarify only arXiv auto-converts /abs/→PDF;
  others need direct PDF URLs

Conventions (matching legal/, productivity/ patterns):
- Add argument-hint frontmatter to all 4 commands
- Add CONNECTORS.md callout to all commands

Positioning — form filling:
- Emphasize this is VISUAL form filling (vs programmatic tools)
- Document the unnamed-field workflow: screenshot → match bounding
  boxes to visual labels → fill by name. Many real PDFs have fields
  named 'Text1', 'Field_7' with labels only on the rendered page.
- User gets live feedback and can edit directly in viewer
Plugin name: pdf → pdf-viewer
- 'Viewer' makes the interactive/visual modality self-evident
- Naturally explains why NOT to use for summarization
- Matches enterprise-search precedent (capability-named, not job-function)

Skill name: pdf → view-pdf
- Verb-noun matches repo convention (review-contract, triage-nda)

Trigger description (SKILL.md frontmatter):
- Hybrid style: situation framing + verb list for keyword matching
- Includes 'open, show, view' so bare 'open this PDF' triggers the
  skill — SKILL body then disambiguates viewer vs Read
- Keeps 'Not for summarization (use Read)' guard

Marketplace/plugin.json description:
- Marketing-oriented (benefits-first) to match other plugins' style
- 'View, annotate, sign... Mark up contracts, fill forms with visual
  feedback, stamp approvals, place signatures — download annotated copy'

Updated all /pdf:* cross-references → /pdf-viewer:*
ochafik added a commit to modelcontextprotocol/ext-apps that referenced this pull request Mar 24, 2026
…owledge-work-plugins

This directory duplicated the Claude Code plugin that's being added to
the knowledge-work plugin marketplace (anthropics/knowledge-work-plugins#72).
Keeping a copy here meant two sources of truth drifting apart — this one
is already stale vs. the server's interact/annotation capabilities from #506.

The MCPB packaging (manifest.json) remains — that's the distributable
server artifact. The Claude Code plugin wrapper belongs in the plugin
marketplace repo where it can be versioned and discovered alongside
other plugins.

Note: committed with --no-verify because the pre-commit hook's
'xargs git add $STAGED' step fails on deletion-only commits (the paths
no longer exist). Hook fix tracked separately.
ochafik added a commit to modelcontextprotocol/ext-apps that referenced this pull request Mar 25, 2026
…owledge-work-plugins (#565)

This directory duplicated the Claude Code plugin that's being added to
the knowledge-work plugin marketplace (anthropics/knowledge-work-plugins#72).
Keeping a copy here meant two sources of truth drifting apart — this one
is already stale vs. the server's interact/annotation capabilities from #506.

The MCPB packaging (manifest.json) remains — that's the distributable
server artifact. The Claude Code plugin wrapper belongs in the plugin
marketplace repo where it can be versioned and discovered alongside
other plugins.

Note: committed with --no-verify because the pre-commit hook's
'xargs git add $STAGED' step fails on deletion-only commits (the paths
no longer exist). Hook fix tracked separately.
ochafik and others added 3 commits March 25, 2026 17:17
Without -y, npx prompts 'Ok to proceed? (y)' on first install of a
package, which hangs the stdio MCP connection (no TTY to answer).

Keeping version unpinned (auto-latest) — currently pulls 1.3.1 which
has the interact/annotation capabilities. Tested end-to-end via
'claude --plugin-dir pdf-viewer/'.
Rescope pdf-research → pdf-viewer: expose annotation, form-filling, signing
Upstream added 28 plugins since February (partners, URL-source).
Keep all upstream entries, append pdf-viewer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ochafik ochafik changed the title Add pdf-research plugin with local MCP server Add pdf-viewer plugin with local MCP server Mar 27, 2026
Copy link
Copy Markdown
Contributor

@ochafik ochafik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bryan-anthropic !

@ochafik ochafik merged commit f55b539 into anthropics:main Mar 28, 2026
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.

2 participants