pdfnative-mcp: Instructions file for GitHub Copilot

.github/copilot-instructions.md

pdfnative-mcp copilot-instructions.md is an instructions file for GitHub Copilot from Nizoka/pdfnative-mcp. It costs 2,673 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

Written for GitHub Copilot: a Copilot instructions file. Also seen: mentions AGENTS.md.

This is Nizoka/pdfnative-mcp's own configuration. It tells GitHub Copilot how to work on pdfnative-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pdfnative-mcp configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is [`docs/KNOWLEDGE_BASE.md`](../docs/KNOWLEDGE_BASE.md). Don't duplicate it here..

Reuse

Borrowing it

Nothing to install: this file belongs to Nizoka/pdfnative-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Nizoka/pdfnative-mcp/main/.github/copilot-instructions.md
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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pdfnative-mcp copilot-instructions.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,673 This file is loaded in full into every session.
When invoked 2,673 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02673 $0.02673
Opus 5.5 $0.01069 $0.01069
Sonnet 5.5 $0.00535 $0.00535
Haiku 4.5 $0.00267 $0.00267

Measured 1mo ago against content hash 0cc946068c48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 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. Repository rules shared by every coding agent: AGENTS.md — keep this file consistent with it. Contract for agents that use the server (tool catalogue, decision tree, token economy, error codes): docs/AGENT_CONTRACT.md.

Overview

MCP server bridging pdfnative 1.8.0 (pinned ^1.8.0) 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, 7 prompts, 47 error codes, 27 Unicode scripts. Current release 1.7.0 (TOOL_API_VERSION 1.7.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, reproducible output, deterministic releases). Faithful thin wrapper: every PDF feature lives in the engine; never reimplement one, never over-promise (state engine limits in the tool description and ROADMAP.md).

Architecture (one line each)

  • src/cli.ts — stdio (serveStdio) / Streamable HTTP (createMcpHandler) entry point; boot-time operator knobs.
  • 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 — TOOLS registry (+ annotations, _meta.examples), request handlers, dispatchOutput, classifyUnexpected (unexpected failure on PDF input → PDF_PARSE_FAILED), SERVER_INSTRUCTIONS, prompts, resources, cache hints, TOOL_API_VERSION.
  • src/tools/* — one file per tool (JSON schema as const + parallel Zod + handler); inspect-layout.ts 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 / typography fragment shared by the nine document tools.
  • src/typography.ts — the opt-in typography fragment (12 keys, all off by default; no hyphenation dictionary is installed).
  • src/color.ts — shared colour fragment: hex / RGB plus CMYK operand strings (0–1) and percent tuples (0–100); toEngineColor().
  • src/print.ts — shared print-production schema (boxes, bleed, marks + colour bars, userUnit, outputIntent RGB / CMYK / Gray, metadata, creationDate).
  • src/pdfx.ts, src/pdfa.ts — conformance targets from the engine's own tuples; static PDF/X conflicts refused as VALIDATION_ERROR before the build.
  • src/reproducible.ts — operator pin of the creation instant (PDFNATIVE_MCP_CREATION_DATE, then SOURCE_DATE_EPOCH); read once at boot.
  • src/diagnostics.ts — diagnostics sink (strict / includeDiagnostics / embedFonts), escalate() by diagnostic code, mapBuildError.
  • src/table.ts, src/barcode.ts, src/form.ts, src/image.ts — bodies shared by a dedicated tool and its inline block (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).
  • 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/projection.ts — token-frugal responses (verbosity: 'summary', fields); src/cache.ts — opt-in response cache.
  • src/resources.ts — native MCP resources over the sandbox output dir (pdfnative://output/…).
  • src/output.ts — output mode (base64 or sandboxed file write); src/text.ts — newline sanitizer; src/errors.ts — ToolError, SecurityError, GovernanceError.
  • scripts/* — TypeScript run by tsx: gate.ts, generate-samples.ts + verify-samples.ts (byte baseline), generate-pdfa-corpus.ts + validate-pdfa.ts / validate-pdfx.ts (conformance corpus), tool-shape.ts, verify-docs.ts, release-prepare.ts, build-claude-rules.ts. See scripts/README.md.
  • tests/* — vitest, one *.test.ts per tool or module; _-prefixed shared fixtures; tests/_fixtures/ (tool shape, sample baseline, engine-surface matrix, build-error registry); tests/tools/ (repository tooling). Never regenerate tests/_fixtures/tool-shape.v1.5.0.json.
  • examples/*.json — executable tools/call sequences (43), run by npm run examples:check and rendered into the sample baseline.

Read the full file on GitHub · 120 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. 1mo ago Changed · +40 lines · +1,282 tokens per session 0cc946068c48
  2. 1mo 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 7d ago), licensed MIT. It adds 2,673 tokens to every session, about $0.0107 per session on Opus 5.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.

Related

Other instructions, from other repositories