doc2x-mcp AGENTS.md

doc2x-mcp AGENTS.md is an instructions file for Codex, OpenCode from NoEdgeAI/doc2x-mcp. It costs 934 tokens per session, scanned C, original, MIT.

Repository instructions for NoEdgeAI/doc2x-mcp, a TypeScript server that connects tools to the Doc2x document-conversion API. They describe the source layout, build and test commands, runtime requirements, and coding conventions.

In plain words
What is it for?
Use them when developing, building, testing, or running the doc2x-mcp project, especially its PDF, image, conversion, download, and materialization modules.
Why use it?
They give an agent the project's expected structure and development workflow before it changes code. This helps avoid editing generated files or using inconsistent commands and styles.

Instructions file for CodexOpenCode

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/noedgeai/doc2x-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/NoEdgeAI/doc2x-mcp

Made for: Codex, OpenCode.

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 doc2x-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/noedgeai/doc2x-mcp/agents-md.svg)](https://agentmods.dev/instructions/noedgeai/doc2x-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/noedgeai/doc2x-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/noedgeai/doc2x-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 934 This file is loaded in full into every session.
When invoked 934 The same file — it is already loaded in full.
Security scan C 2 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.00934 $0.00934
Opus 5 $0.00467 $0.00467
Sonnet 5 $0.00187 $0.00187
Haiku 4.5 $0.00093 $0.00093

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

Security

Grade C, and why

doc2x-mcp AGENTS.md scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://raw.githubusercontent.com/NoEdgeAI/doc2x-mcp/main/scripts/install-skill.sh | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://raw.githubusercontent.com/NoEdgeAI/doc2x-mcp/main/scripts/install-skill.sh | sh
AGENTS.md · 86 lines

How it starts

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

Repository Guidelines

Project Structure & Module Organization

  • src/: TypeScript source (ESM).
    • src/index.ts: MCP server entrypoint (stdio).
    • src/config/: runtime config parsing and defaults.
    • src/errors/: error model and error code definitions.
    • src/shared/: shared utilities.
    • src/mcp/: Tool registration and result shaping.
    • src/mcp/registerToolsShared.ts: Shared schemas, cache primitives, and atomic cache helpers.
    • src/doc2x/: Doc2x v2 API client logic (PDF/image/convert/download/materialize).
  • dist/: Build output (generated by tsc). Do not edit by hand.
  • .env.example: Sample env vars; .env is gitignored.

Build, Test, and Development Commands

  • npm install (or npm ci): Install dependencies.
  • npm run build: Compile TypeScript to dist/ via tsc -p tsconfig.json.
  • npm start: Run the MCP server (node dist/index.js).

Example local run:

DOC2X_API_KEY=sk-xxx npm run build && npm start

Coding Style & Naming Conventions

  • TypeScript (Node.js ESM, type: module); target Node >=18.
  • Prefer explicit errors and small modules; avoid over-abstraction.
  • Naming: camelCase for variables/functions, PascalCase for types/classes.
  • Formatting: keep diffs minimal; follow existing file style (no repo-wide formatter configured).

Testing Guidelines

  • Test runner: Node built-in test runner via node --test.
  • Available scripts:
    • npm run test:unit
    • npm run test:e2e
    • npm run test
  • Keep tests deterministic (no real network calls) and document new test entrypoints in package.json scripts.

Cache & Concurrency Guidelines

  • Keep cache access centralized in src/mcp/registerToolsShared.ts.
  • For UID caches, prefer shared atomic helpers (getSubmittedUidFromCache, setSubmittedUidCache, setFailedUidCache, deleteUidCache) instead of direct ctx.*Cache reads/writes in tool files.
  • For convert submit de-duplication, always go through runConvertSubmitAtomically; do not re-implement local in-flight maps.
  • Failed UID cache entries must use short TTL (failed state), successful/submitted entries use default TTL.
  • File signature strategy is stat-first plus digest reuse:
    • use size + mtimeMs as fast-path cache key for digest reuse
    • compute MD5 only on stat changes
    • keep sameSig as path/size precheck then digest confirm

Read the full file on GitHub · 86 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 · 86 lines · 934 tokens per session scan C ab385e498806

Subscribe to this mod's changes

doc2x-mcp AGENTS.md is an instructions file published in the GitHub repository NoEdgeAI/doc2x-mcp (3 stars, last pushed 2mo ago), licensed MIT. It adds 934 tokens to every session, about $0.0047 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). 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