mcp-audit AGENTS.md

mcp-audit AGENTS.md is an instructions file for Codex, OpenCode from P4ST4S/mcp-audit. It costs 1,864 tokens per session, scanned A, original, Apache-2.0.

Project instructions for mcp-audit, a Go security and monitoring proxy for MCP servers. They explain the code layout, style rules, build commands and testing requirements.

In plain words
What is it for?
Use them when contributing to mcp-audit, especially to build, lint, run race-detection tests, understand the Go project structure, and prepare a pull request.
Why use it?
They give coding agents the repository’s working rules before they change code. This helps prevent incorrect builds, missed checks and changes that do not match the project’s conventions.

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

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

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

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

Security

Grade A, and why

mcp-audit AGENTS.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 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.

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.

AGENTS.md · 104 lines

How it starts

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

AGENTS.md

Guidance for AI coding agents (Claude Code, Cursor, Codex, Jules, Amp, etc.) contributing to mcp-audit. Read this in full before opening a PR.

mcp-audit is a security and observability proxy for MCP (Model Context Protocol) servers, written in Go. It records signed audit trails, enforces policies, applies rate limits, and exports OTLP traces + Prometheus metrics. See README.md for what it does and why; this file is about how to work on it.

Build, test, lint

go build ./...
go vet ./...
go test -race ./...
go test -race -coverprofile=coverage.out -covermode=atomic ./...

CI uses the toolchain directive pinned in go.mod (currently go1.26.4). The minimum supported Go version is 1.22, also declared in go.mod. Tests must pass with -race. Coverage is uploaded to Codecov on push to main.

For local end-to-end testing, see the demo/ directory and the run skill in CLAUDE.md if applicable.

Project layout

  • cmd/mcp-audit/ — CLI entry point and config loader (viper-based)
  • internal/audit/ — entry types, HMAC-SHA256 signing, storage interface
  • internal/audit/storage/jsonl.go, sqlite.go, async.go, instrumented.go
  • internal/proxy/stdio.go and http.go proxies, retry logic, TLS upstream support
  • internal/policy/ — allow/deny policy engine; emits JSON-RPC error code -32030
  • internal/middleware/ — rate limiter (per client_id, tool_name bucket; error code -32029) and PII redactor
  • internal/metrics/ — Prometheus recorder with stable metric names under mcp_audit_*
  • internal/otel/ — OTLP/HTTP JSON trace exporter (no SDK pulled in)
  • internal/httpclient/ — shared TLS-aware HTTP client used by proxy and OTel
  • internal/dashboard/ — read-only HTTP server (routes: /, /api/entries, /api/stats)

The split between internal/ and the package boundary in cmd/ is intentional: internal/ is not importable by third parties. internal/ packages can be refactored freely; the public CLI surface (config keys, flags, JSON-RPC error codes, audit JSON schema, metric names, OTLP attributes, dashboard API) is stable per STABILITY.md.

Read the full file on GitHub · 104 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 · 104 lines · 1,864 tokens per session scan A 521c51306fcb

Subscribe to this mod's changes

mcp-audit AGENTS.md is an instructions file published in the GitHub repository P4ST4S/mcp-audit (7 stars, last pushed 12d ago), licensed Apache-2.0. It adds 1,864 tokens to every session, about $0.0093 per session on Opus 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.