drawio-mcp-server: Instructions file for Codex

AGENTS.md

drawio-mcp-server AGENTS.md is an instructions file for Codex, OpenCode from lgazo/drawio-mcp-server. It costs 2,865 tokens per session, scanned C, original, MIT.

Project instructions for a draw.io MCP server, a service that lets an agent work with draw.io diagrams through a standard tool connection. They also cover logging, code navigation, version compatibility, and efficient command use.

In plain words
What is it for?
Use them when developing or maintaining the draw.io server, especially when handling logs, navigating its codebase, checking draw.io versions, or using rtk commands.
Why use it?
They prevent diagnostic messages from corrupting the machine-readable communication used by the server and keep changes compatible with the project.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; positional $N argument.

This is lgazo/drawio-mcp-server's own configuration. It tells Codex and OpenCode how to work on drawio-mcp-server 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 drawio-mcp-server configures →

About the project

Draw.io MCP Server connects AI agents to Draw.io, a diagramming application, through the Model Context Protocol. Users can create, edit, manage, import, export, and persist diagrams across documents and pages from supported agent environments. The catalogue entries package the server with commands, instructions, a plugin, and settings for agent-based diagram workflows.

lgazo/drawio-mcp-server · 1,492 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to lgazo/drawio-mcp-server. 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/lgazo/drawio-mcp-server/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/lgazo/drawio-mcp-server

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lgazo/drawio-mcp-server/agents-md/github.svg)](https://agentmods.dev/instructions/lgazo/drawio-mcp-server/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lgazo/drawio-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/lgazo/drawio-mcp-server/agents-md/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 drawio-mcp-server AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lgazo/drawio-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/lgazo/drawio-mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,865 This file is loaded in full into every session.
When invoked 2,865 The same file — it is already loaded in full.
Security scan C 2 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.02865 $0.02865
Opus 5.5 $0.01146 $0.01146
Sonnet 5.5 $0.00573 $0.00573
Haiku 4.5 $0.00286 $0.00286

Measured 11d ago against content hash f96df1f40ed7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

drawio-mcp-server 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 11d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- rtk-instructions v2 -->

Makes network callslowCapability

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

rtk curl <url> # Compact HTTP responses (70%)
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 224 lines

How it starts

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

Draw.io MCP Server

Logging discipline (drawio-mcp-server)

When the stdio transport is active, stdout must contain only JSON-RPC frames produced by the MCP SDK. A single stray console.log will cause spec-strict clients (e.g. codex-cli) to reject the server. The rules below codify this.

  1. Stdout discipline. console.log, console.info, console.dir, and process.stdout.write are banned in packages/drawio-mcp-server/src/** outside the allowlist below. The MCP SDK transport is the only legitimate writer to stdout.
  2. Logger usage. Every production function that needs to emit a diagnostic MUST receive an AppLogger (index.ts) or Logger (types.ts) — as a parameter or via Context.log. Constructing a logger inside a function is forbidden except in the entry-point files listed in rule 3.
  3. Allowlist (the only files permitted to call console.*):
    • src/mcp_console_logger.ts — the stderr bridge implementation.
    • src/mcp_server_logger.ts — internal console.error for unrecoverable invalid-level guard.
    • src/standard_console_logger.ts — test-only logger (writes to stdout). Do not import from production code.
    • src/index.ts — only via the module-scope fatalLog constant. No other site in index.ts may use console.*.
    • src/prefetch-assets.ts — separate CLI entrypoint; instantiates mcp_console_logger and uses it.
    • src/**/*.test.ts — tests may use console and standard_console_logger freely.
  4. Pre-boot phase. Code that runs before createDrawioMcpApp({ config }) returns (CLI help, config-parse failure) uses fatalLog. After the app exists, use app.log or a logger provided by dependency injection.
  5. Two logger modes. --logger console (default) writes to stderr; --logger mcp-server sends MCP notifications/message to the connected client. No other logging output channels exist; do not add raw process.stderr.write either — go through the logger.
  6. Transport-mode awareness. src/stdio-transport-purity.test.ts spawns the binary with --transport stdio and asserts every non-empty stdout line parses as JSON. This catches stdout contamination introduced by future commits.
  7. Browser packages exempt. packages/drawio-mcp-extension/** and packages/drawio-mcp-plugin/** execute in a browser context and may use console.* freely; they share no streams with the MCP server.
  8. Lint enforcement (Biome). biome check src/ runs as part of pnpm --filter drawio-mcp-server lint and enforces noConsole for src/** with the per-file overrides matching rule 3. Biome is a devDep of drawio-mcp-server and pinned via the pnpm catalog.

Read the full file on GitHub · 224 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. 11d ago Changed · +44 lines · +647 tokens per session f96df1f40ed7
  2. 1mo ago First seen · 180 lines · 2,218 tokens per session scan C bd4c4308b3f1

Subscribe to this mod's changes

drawio-mcp-server AGENTS.md is an instructions file published in the GitHub repository lgazo/drawio-mcp-server (1,492 stars, last pushed 10d ago), licensed MIT. It adds 2,865 tokens to every session, about $0.0115 per session on Opus 5.5. A static security scan graded it C with 2 findings (hidden instructions, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

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).

microsoft/vscode · 9,649 tokens

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.

vercel/next.js · 7,549 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens