MistralDocAI-mcp AGENTS.md

MistralDocAI-mcp AGENTS.md is an instructions file for Codex, OpenCode from trsdn/MistralDocAI-mcp. It costs 1,552 tokens per session, scanned A, original, MIT.

Repository instructions for an MCP server that converts documents and images to Markdown using Mistral AI models. They explain its Node.js command-line wrapper, Python server, layout, setup, and communication rules.

In plain words
What is it for?
Use them when changing the server, its command-line program, Python code, package contents, setup process, or process communication.
Why use it?
They help coding agents avoid breaking startup, the tool interface, the published package, or the communication stream used by MCP clients.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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/trsdn/mistraldocai-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/trsdn/MistralDocAI-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 MistralDocAI-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/trsdn/mistraldocai-mcp/agents-md.svg)](https://agentmods.dev/instructions/trsdn/mistraldocai-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/trsdn/mistraldocai-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/trsdn/mistraldocai-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,552 This file is loaded in full into every session.
When invoked 1,552 The same file — it is already loaded in full.
Security scan A 1 finding. 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.1 $0.01552 $0.01552
Opus 5 $0.00776 $0.00776
Sonnet 5 $0.00310 $0.00310
Haiku 4.5 $0.00155 $0.00155

Measured 5d ago against content hash 17c1fb6eb2b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

MistralDocAI-mcp AGENTS.md scanned grade A with 1 finding 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 5d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

interface, never on `child_process` directly, so tests can substitute
AGENTS.md · 147 lines

How it starts

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

Agent instructions

Read this before changing anything in this repository.

What this repository is

An MCP (Model Context Protocol) server that converts documents and images to Markdown using Mistral AI's OCR and vision models. It ships as the npm package @trsdn/mistraldocai-mcp-server and is consumed by MCP clients such as Claude Desktop, which launch it over stdio and call its tools. A change that breaks start-up, the tool contract, or the published tarball breaks every client that has it configured, silently, until someone restarts their client.

The package is a thin Node.js wrapper around a Python server. Node owns the CLI, the managed virtual environment under ~/.mistraldocai-mcp/, and the process lifecycle. Python owns the actual MCP protocol handling and the Mistral calls.

What this repository is not

It is not a general-purpose OCR library, and it is not the Mistral SDK. It has no HTTP surface: MCP clients speak to it over stdin and stdout, which is why every diagnostic message goes to stderr. Writing to stdout corrupts the protocol stream.

Layout

Path Purpose
src/ TypeScript CLI and process supervision. Compiled to dist/.
src/python-environment.ts Interpreter discovery, virtual environment, dependency install. The seam that makes start-up testable.
python/mcp_server.py The MCP server itself: tool definitions and dispatch.
python/docmistral.py Document conversion and all Mistral API calls.
python/mcp_requirements.txt Python runtime dependencies. Every entry needs an upper bound.
python/requirements-dev.txt Python dev tooling (Ruff). Pinned exactly, and not shipped in the tarball.
scripts/setup.js npm postinstall hook. Must stay non-fatal; clients install without it.
scripts/verify_python_server.py Asserts the Python tool contract. The regression guard for the 1.0.4 breakage.
tests/ Jest unit tests. tests/support/ holds test doubles.
docs/self-assessment.md Per-criterion evidence behind .github/conformance.yml.

Read the full file on GitHub · 147 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. 5d ago First seen · 147 lines · 1,552 tokens per session scan A 17c1fb6eb2b9

Subscribe to this mod's changes

MistralDocAI-mcp AGENTS.md is an instructions file published in the GitHub repository trsdn/MistralDocAI-mcp (2 stars, last pushed 2d ago), licensed MIT. It adds 1,552 tokens to every session, about $0.0078 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.