PDF-only papers

Some arXiv papers are PDF-only. Paper Reader can still read them: your agent opens the PDF and publishes a short-lived reading link using your model.

What you get

You give the agent an arXiv ID; it reads the PDF and sends Paper Reader a validated payload. Paper Reader checks it against the arXiv record and returns a private reading link — /read/arxiv/<your-id>?h=<code> — that lasts about six hours (the reader shows the exact expiry).

With an agent key from your account, the publish also returns a durable library link — /read/arxiv/<your-id>?d=<code> — saved to your library with no expiry until you delete it. Share that one for stable links; recipients can save their own copy from it.

The link expires, so tell your agent where to save the JSON payload it sends and keep the paper or its arXiv PDF for longer. By default, the agent should ask or propose ~/Documents/paper-reader/payloads/ rather than storing payloads inside the Paper Reader repository. When the link expires, send the saved payload to publish_paper again instead of re-reading the PDF.

Before you start

  • Node.js and npm.
  • OpenCode installed.
  • A model with usable quota or API access.
  • A publisher token from the Paper Reader operator (see Publisher token below).
  • Permission for the agent to download the arXiv PDF when it needs it.

Agent-assisted reading (OpenCode)

Install the published tools; no repository clone or build is required. The installer copies the skill to your OpenCode skills directory and prints the MCP configuration.

npx -y paper-reader-mcp install

To merge the MCP entry into an existing opencode.json instead of copying it by hand, run:

npx -y paper-reader-mcp install --opencode-path ./opencode.json

The installer validates the existing file and preserves its other keys. Without --opencode-path, it only prints the block for you to add.

Before its next publish, ask your agent where to save the JSON payload it emits (for example, ~/Documents/paper-reader/payloads/paper-reader-<your-id>.json) so it can be re-sent when the link expires:

export PAPER_READER_TOKEN='your-publisher-token'

Add the printed MCP block to the opencode.json that OpenCode loads (global config or project root), keeping any existing keys:

{
  "mcp": {
    "paper-reader": {
      "type": "local",
      "command": ["npx", "-y", "paper-reader-mcp"],
      "environment": {
        "PAPER_READER_URL": "https://paper-reader-omega.vercel.app",
        "PAPER_READER_TOKEN": "{env:PAPER_READER_TOKEN}"
      }
    }
  }
}

Restart OpenCode, then use a prompt with your paper's arXiv ID:

Read arXiv <your-id> with the paper-reader skill and publish a Paper Reader link.

Success looks like a browser URL of the form /read/arxiv/<your-id>?h=<code>. Open it to verify; it expires in about six hours. The skill calls paper_format, reads the PDF natively (or renders pages locally when needed), calls publish_paper, and returns the URL. If your agent cannot read the PDF natively, its page renderer uses pdftoppm, mutool, or pdfimages; install one if that step fails.

Publisher token

Publishing is beta-gated: ask the project owner for a publisher token and export PAPER_READER_TOKEN before launching OpenCode. If you get 503 PUBLISH_DISABLED, the deployment has publishing disabled; 401 UNAUTHORIZED means the token is wrong.

Privacy and sharing

The private link works for anyone who has it. Treat the full URL as a password: don't share it publicly or cite it as a stable source. When an HTML reader appears later, use that stable version.

Troubleshooting

  • MCP does not load: verify the package is installed and restart OpenCode. Run npx -y paper-reader-mcp install --check or check the logs from the MCP command to see startup errors.
  • 401 UNAUTHORIZED or 503 PUBLISH_DISABLED: verify your publisher token and confirm the deployment has publishing enabled.
  • Link expired: ask the agent to re-send the saved JSON payload with publish_paper.
  • 409 HTML_AVAILABLE: open /read/arxiv/<your-id> on the Paper Reader site instead.

Appendix: calling the API

Engineers can call the API directly. The payload must look like paper_format returns. Successful responses include a short-lived url and its expiry time. The long random code in that URL is what makes the link private.

export PAPER_READER_URL="https://paper-reader-omega.vercel.app"
export PAPER_READER_TOKEN="your-publisher-token"

curl -X POST "$PAPER_READER_URL/api/publish" \
  -H "authorization: Bearer $PAPER_READER_TOKEN" \
  -H "content-type: application/json" \
  --data-binary @payload.json

409 HTML_AVAILABLE means use the HTML/ar5iv reader;422 means the metadata or figure source needs fixing;410 means the link expired and the agent should rerun;429 means retry; 503 means metadata or publishing is temporarily unavailable or disabled.

Appendix: running locally

Most readers should use the hosted deployment above. For local development, run the app with publishing enabled:

git clone https://github.com/lealiaxiong/paper-reader paper-reader
cd paper-reader
npm install
PUBLISH_TOKENS='your-publisher-token' npm run dev

Then set PAPER_READER_URL to http://localhost:3000 in the MCP config and use the same token as PAPER_READER_TOKEN. The local server only enables publishing when PUBLISH_TOKENS is set. Build the MCP server as shown above.