pdfnative-mcp copilot-instructions.md

pdfnative-mcp copilot-instructions.md is an instructions file for GitHub Copilot from Nizoka/pdfnative-mcp. It costs 1,391 tokens per session, scanned A, original, MIT.

Project instructions for an MCP server that lets AI clients use pdfnative, a PDF-processing library, through a standard connection.

In plain words
What is it for?
They help developers add or review tools, handle files and requests safely, and prepare consistent releases.
Why use it?
They give contributors shared rules for the server’s design, security, dependencies, testing, and releases.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/nizoka/pdfnative-mcp/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/Nizoka/pdfnative-mcp

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pdfnative-mcp copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nizoka/pdfnative-mcp/copilot-instructions.svg)](https://agentmods.dev/instructions/nizoka/pdfnative-mcp/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/nizoka/pdfnative-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/nizoka/pdfnative-mcp/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,391 This file is loaded in full into every session.
When invoked 1,391 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01391 $0.01391
Opus 5 $0.00696 $0.00696
Sonnet 5 $0.00278 $0.00278
Haiku 4.5 $0.00139 $0.00139

Measured 4d ago against content hash 33805fd288dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pdfnative-mcp copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pdfnative-mcp - Project Guidelines

Full context (architecture, tool schemas, output system, security design): docs/KNOWLEDGE_BASE.md. Don't duplicate it here.

Overview

MCP server bridging pdfnative (v1.7.x) to AI clients over stdio or Streamable HTTP, on the MCP TypeScript SDK v2 (@modelcontextprotocol/server, MCP 2026-07-28 with automatic 2025-era fallback). 28 tools, 6 prompts. Current release 1.6.0. Three runtime dependencies (pdfnative, the MCP SDK, zod) — never add one. Quality bar: production-grade OSS (strict TypeScript, strong validation, secure file IO, no egress except operator-configured TSA / OCSP / CRL endpoints, deterministic releases).

Architecture (one line each)

  • src/cli.ts — stdio (serveStdio) / Streamable HTTP (createMcpHandler) entry point.
  • src/http.ts — Node http ↔ Web Request/Response bridge + Host/Origin loopback guard.
  • src/auth.ts — opt-in HTTP bearer token (PDFNATIVE_MCP_HTTP_TOKEN, constant-time compare, 401 + WWW-Authenticate).
  • src/base64.ts — base64 boundary helpers (data: URI tolerated, PEM-vs-DER and double-encoding hints).
  • src/server.ts — tool registry (+ MCP annotations) + request handlers on the low-level Server + SERVER_INSTRUCTIONS + SERVER_CACHE_HINTS; resources & prompts capabilities.
  • src/tools/* — one file per tool (JSON schema as const + parallel Zod + handler); inspect-layout.ts (28th tool) reuses the generate_basic_pdf block schema + layout fragment.
  • src/network.ts — the only egress path: operator-configured TSA / OCSP / CRL providers + SSRF guard; URLs never come from tool arguments.
  • src/blocks.ts — the 7 extended document blocks (table, image, link, toc, barcode, svg, formField) → 13 block kinds in total.
  • src/layout.ts — pageSize / margins / headerTemplate / footerTemplate / compress / debug / encrypt fragment (PdfLayoutOptions) shared by the nine document tools.
  • src/table.ts, src/barcode.ts, src/form.ts, src/image.ts — bodies shared by a dedicated tool and its inline block (form.ts maps textareamultilineText; image.ts checks magic bytes + PNG IHDR, 24 MiB per-call budget; embed_image stays unbounded).
  • src/watermark.ts — text and/or image watermark + position; PDF/A-1b transparency guard.
  • src/inflate-cap.ts — PDFNATIVE_MCP_MAX_INFLATE_BYTES → engine decompression cap (read once at boot; invalid value refuses to start) + PDF_PARSE_FAILED mapping.
  • src/print.ts — shared print-production schema (boxes, bleed, marks, userUnit, outputIntent, metadata, creationDate).
  • src/diagnostics.ts — PDF/A diagnostics sink (strict / includeDiagnostics / embedFonts) + mapBuildError.
  • src/encryption.ts — shared password/encrypt schema + decrypt error mapper.
  • src/chart.ts — shared charts v2 schema + mapper (add_chart and the generate_basic_pdf chart block).
  • src/resources.ts — native MCP resources over the sandbox output dir (pdfnative://output/…).
  • src/text.ts — newline sanitizer (Safe PDF/A).
  • src/output.ts — output mode (base64 or sandboxed file write).
  • src/errors.ts — ToolError, SecurityError, GovernanceError.
  • tests/* — unit tests for tool behavior and sandbox security; tests/_encrypted-fixtures.ts builds encrypted PDFs in-process; tests/catalogue-superset.test.ts keeps the live catalogue a superset of tests/_fixtures/tool-shape.v1.5.0.json (never regenerate that fixture).

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 80 lines · 1,391 tokens per session scan A 33805fd288dc

Subscribe to this mod's changes

pdfnative-mcp copilot-instructions.md is an instructions file published in the GitHub repository Nizoka/pdfnative-mcp (2 stars, last pushed 11d ago), licensed MIT. It adds 1,391 tokens to every session, about $0.0070 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.