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.
curl -O https://raw.githubusercontent.com/Nizoka/pdfnative-mcp/main/.github/copilot-instructions.mdgit clone --depth 1 https://github.com/Nizoka/pdfnative-mcpWrote 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.
[](https://agentmods.dev/instructions/nizoka/pdfnative-mcp/copilot-instructions)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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 —
TOOLSregistry (+ 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
typographyfragment (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_ERRORbefore the build. - src/reproducible.ts — operator pin of the creation instant (
PDFNATIVE_MCP_CREATION_DATE, thenSOURCE_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.tsper 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/callsequences (43), run bynpm run examples:checkand rendered into the sample baseline.
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.
- 1mo ago Changed · +40 lines · +1,282 tokens per session 0cc946068c48
- 1mo ago First seen · 80 lines · 1,391 tokens per session scan A 33805fd288dc
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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.