AGENTS.md
+21 −13
https://raw.githubusercontent.com/cyanheads/docgen-mcp-server/HEAD/AGENTS.md
− **Version:** 0.3.0− **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`− **Engines:** Bun ≥1.4.0, Node ≥24.0.0− **MCP SDK:** `@modelcontextprotocol/server` ^2.3.1− **Zod:** ^4.6.5− | `docgen_fill_form` | tool | Fill (and optionally flatten) the AcroForm fields of a supplied PDF — source as `{ base64 }` or an `{ url }` fetched behind an SSRF guard. Unmatched field names come back in `unmatchedFields[]`. |− | `docgen_list_form_fields` | tool | Read-only field discovery from the same source: `{ fields: [{ name, type, required, options? }] }`. Types: text, checkbox, dropdown, optionList, radioGroup, signature, button. Only choice fields include options; signatures/buttons are discovery only. No PDF modification or document storage. |− - `fetch-guard.ts` — HTTPS PDF fetcher shared by both form tools. Vets all resolved addresses at every redirect hop, connects only to a vetted address using a fresh socket with TLS identity and Host preserved, blocks private/loopback/link-local/metadata destinations, enforces PDF content type, byte cap, deadline and cancellation. Failures are leak-free `source_unfetchable` errors.− docgen semantic reasons use `ValidationError` (`-32007`): empty_workbook, invalid_source, invalid_sheet_name, invalid_pdf_source, not_a_form, template_render_failed, document_too_large. Schema failures stay `InvalidParams` (`-32602`); fetch, timeout and missing-document codes remain unchanged.− Skills are modular instructions in `framework-skills/` at the project root. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry. The directory is deliberately not `skills/`: Claude Code and Codex auto-load a plugin's root `skills/`, so a server that ships `.claude-plugin/` or `.codex-plugin/` would hand these development skills to every agent that installs it. Keep `skills/` free for skills meant f− **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.− | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |− `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings. MCPB is stdio-only — HTTP deployments are unaffected. Consume+ **Version:** 0.4.0+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`+ **Engines:** Bun ≥1.4.4, Node ≥24.0.0+ **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0+ **Zod:** ^4.6.7+ | `docgen_fill_form` | tool | Fill (and optionally flatten) AcroForm fields from `{ base64 }` or an SSRF-guarded `{ url }`. Reports unmatched names, resolved aliases, checkbox notices, and dropdowns made editable; invalid assignments fail together as `invalid_field_value`. |+ | `docgen_list_form_fields` | tool | Read-only field discovery: names, types, required flags, choices, stored values, and available labels, length limits, checkbox on-states and first-widget pages. Types: text, checkbox, dropdown, optionList, radioGroup, signature, button. Signatures/buttons are discovery only. No PDF modification or document storage. |+ | `skill://docgen-guide/SKILL.md` | resource | Published guide for inspecting, filling, reviewing and flattening PDFs, also available through the Skills extension. |+ - `fetch-guard.ts` — HTTPS PDF fetcher shared by both form tools. Vets all resolved addresses at every redirect hop, tries vetted addresses with bounded TCP fallback, preserves TLS identity and Host, and blocks private/loopback/link-local/metadata destinations. Accepts PDF content type or octet-stream bodies starting with `%PDF-`; enforces byte cap, deadline and cancellation. Failures are leak-free `source_unfetchable` errors.+ - `form-assignments.ts` / `form-inventory.ts` — AcroForm name resolution, assignment validation and read-only field metadata.+ docgen semantic reasons use `ValidationError` (`-32007`): empty_workbook, invalid_source, invalid_sheet_name, invalid_pdf_source, not_a_form, invalid_field_value, template_render_failed, document_too_large. Schema failures stay `InvalidParams` (`-32602`); fetch, timeout and missing-document codes remain unchanged.+ form-assignments.ts # Field-name resolution and aggregate assignment validation+ form-inventory.ts # Read-only AcroForm constraints and stored values+ Development skills live in `framework-skills/`. Read the matching skill directly, such as `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the registry.+ Published skills live in root `skills/` and teach tool workflows to agents using the server. Plugin installs, the npm package, Docker, and the MCPB carry this tree. `createApp({ skills: 'skills' })` also serves it to MCP clients. Author and validate published skills with `framework-skills/add-skill/SKILL.md`.+ **Agent skill directory:** Copy `framework-skills/` into the directory your development agent discovers (Claude Code: `.claude/skills/`, others: equivalent). The `maintenance` skill re-syncs these copies after framework updates.+ | `add-skill` | Author and validate a published skill in root `skills/` |+ | `bun run lint:packaging` | Check env-var parity, `.mcpbignore` coverage, plugin manifests and published skills |+ `bun run bundle` produces a stdio `.mcpb` extension for Claude Desktop. List build-only and local files in `.mcpbignore` with root-anchored patterns such as `/docs/`. Root `skills/` ships in the bundle. After packing, `scripts/clean-mcpb.ts` prunes dev dependencies, agent docs at dependency roots, platform-specific native bindings, node-gyp build metadata and framework build files. Nested runtime `skills/` modules stay in the bundle.+ - [ ] Keep the root Agent Plugins manifests `plugin.json` and `mcp.json` aligned with package metadata and the fixed stdio environment. Keep user-supplied values in the existing Claude and Codex overlays.+ - [ ] Validate any published `skills/` tree with `lint:packaging` and field-test its workflows.