Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/pdf-server/.mcpbignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Source files (built output in dist/ is what we need)
*.ts
tsconfig*.json
vite.config.ts
src/

# Tests
*.test.*

# Development assets
screenshot.png
grid-cell.png
pdf-icon.svg

# Plugin directory (separate distribution path)
plugin/

# Git and CI
.git/
.github/
.gitignore
Binary file added examples/pdf-server/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions examples/pdf-server/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"manifest_version": "0.3",
"name": "@modelcontextprotocol/server-pdf",
"display_name": "PDF (By Anthropic)",
"version": "1.0.1",
"description": "Read and interact with PDF files using an interactive viewer with search, navigation, and text extraction",
"author": {
"name": "Anthropic",
"url": "https://www.anthropic.com"
},
"homepage": "https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/pdf-server",
"repository": {
"type": "git",
"url": "https://github.com/modelcontextprotocol/ext-apps"
},
"support": "https://github.com/modelcontextprotocol/ext-apps/issues",
"icon": "icon.png",
"server": {
"type": "node",
"entry_point": "dist/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/dist/index.js", "--stdio"],
"env": {}
}
},
"tools": [
{
"name": "list_pdfs",
"description": "List available PDF files that can be displayed"
},
{
"name": "display_pdf",
"description": "Display an interactive PDF viewer with search and navigation"
},
{
"name": "read_pdf_bytes",
"description": "Read a range of bytes from a PDF file (max 512KB per request)"
}
],
"keywords": ["pdf", "documents", "viewer", "reading"],
"license": "MIT",
"compatibility": {
"platforms": ["darwin", "win32", "linux"],
"runtimes": { "node": ">=18.0.0" }
},
"privacy_policies": ["https://www.anthropic.com/privacy"]
}
8 changes: 8 additions & 0 deletions examples/pdf-server/plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "pdf-research",
"version": "0.1.0",
"description": "Read, navigate, and analyze PDF documents — academic papers, reports, and local files. Uses a local PDF MCP server for interactive viewing and text extraction.",
"author": {
"name": "Anthropic"
}
}
8 changes: 8 additions & 0 deletions examples/pdf-server/plugin/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"pdf": {
"command": "npx",
"args": ["@modelcontextprotocol/server-pdf", "--stdio"]
}
}
}
16 changes: 16 additions & 0 deletions examples/pdf-server/plugin/CONNECTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Connectors

## Local MCP Server

This plugin uses a **local MCP server** instead of a remote connector.
The PDF server runs on your machine via `npx`.

| Category | Server | How it runs |
| ---------- | ---------------------------------- | -------------------------------------- |
| PDF viewer | `@modelcontextprotocol/server-pdf` | Local stdio via `npx` (auto-installed) |

### Requirements

- Node.js >= 18
- Internet access for remote PDFs (arXiv, bioRxiv, etc.)
- No API keys or authentication needed
40 changes: 40 additions & 0 deletions examples/pdf-server/plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# PDF Research Plugin

Read and analyze PDF documents using a local MCP server. Designed for
academic paper review, document analysis, and research workflows.

## What It Does

- **Open PDFs** from local files, arXiv, bioRxiv, and other academic sources
- **Interactive viewer** with search, navigation, and zoom
- **AI-powered analysis** -- summarize, extract key points, compare papers

## Commands

| Command | What it does |
| ------------------------- | ---------------------- |
| `/pdf-research:read` | Open a PDF for reading |
| `/pdf-research:summarize` | Summarize a document |

## How It Works

This plugin uses a **local MCP server** (`@modelcontextprotocol/server-pdf`)
that runs on your machine via `npx`. No API keys or remote services needed --
the PDF server starts automatically when the plugin loads.

This is different from other knowledge-work plugins which use remote HTTP
connectors. The local server pattern enables offline PDF access and avoids
the need for a remote deployment.

## Requirements

- Node.js >= 18
- Internet for remote PDFs (arXiv, etc.)

## Supported PDF Sources

- Local files (file paths in your working directory)
- [arXiv](https://arxiv.org) papers
- [bioRxiv](https://biorxiv.org) / [medRxiv](https://medrxiv.org) preprints
- [chemRxiv](https://chemrxiv.org), [Zenodo](https://zenodo.org), [OSF](https://osf.io)
- [HAL Science](https://hal.science), [SSRN](https://ssrn.com)
21 changes: 21 additions & 0 deletions examples/pdf-server/plugin/commands/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
description: Open a PDF for reading and analysis
---

# Read PDF

Open a PDF document for interactive reading. Accepts local file paths,
arXiv URLs, or other academic paper URLs.

## Instructions

1. If the user provides a URL or file path, call `display_pdf` with that URL
2. If no URL given, call `list_pdfs` first to show available documents
3. After displaying, offer to summarize, extract key points, or answer questions

## Supported Sources

- Local files (drag-and-drop or file path)
- arXiv papers (arxiv.org/abs/... or arxiv.org/pdf/...)
- bioRxiv, medRxiv, chemRxiv preprints
- Zenodo, OSF, HAL, SSRN
23 changes: 23 additions & 0 deletions examples/pdf-server/plugin/commands/summarize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Summarize the current PDF or a new document
---

# Summarize PDF

Generate a structured summary of a PDF document.

## Instructions

1. If a PDF is already displayed, work with it
2. If user provides a new URL/path, call `display_pdf` first
3. Read through the document and produce:
- **Title and authors** (if academic paper)
- **Key findings** (3-5 bullet points)
- **Methodology** (brief summary)
- **Conclusions**
- **Relevance** — what makes this paper notable

## Notes

- For long documents, focus on abstract, introduction, and conclusion sections
- Ask the user which sections they care most about if the doc is very long
35 changes: 35 additions & 0 deletions examples/pdf-server/plugin/skills/pdf-reading/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: pdf-reading
description: Read and navigate PDF documents using the local PDF server. Reference this when the user wants to open, read, search, or interact with any PDF file or academic paper.
---

# PDF Reading

You have access to a local PDF server that provides interactive document viewing.

## Available Tools

- **list_pdfs** -- Show available PDFs. Call with no arguments.
- **display_pdf** -- Open a PDF in the interactive viewer.
- `url` (string): URL or local file path
- `page` (number, optional): Starting page number

## How to Use

**When the user mentions a PDF, paper, or document:**
1. If they give a URL or path, call `display_pdf` directly
2. If they say "open the paper" without specifying, call `list_pdfs` to show options
3. After displaying, offer to summarize, extract data, answer questions

**arXiv shortcuts:**
- `arxiv.org/abs/2301.12345` is auto-converted to the PDF URL
- Users can just say "open arxiv 2301.12345"

**Supported remote sources:**
arXiv, bioRxiv, medRxiv, chemRxiv, Zenodo, OSF, HAL Science, SSRN

## Best Practices

- Always display the PDF before trying to analyze it
- For multi-page documents, ask which section the user cares about
- When comparing papers, display them one at a time and note key differences
Loading