mcp-codebase: Instructions file for Codex

AGENTS.md

mcp-codebase AGENTS.md is an instructions file for Codex, OpenCode from DmitriyOT/mcp-codebase. It costs 2,770 tokens per session, scanned A, original, MIT.

Repository instructions for AI coding agents working on mcp-codebase, an MCP server that lets an agent search and understand a software project. It parses source files into symbols, imports, and exports, stores them in PostgreSQL, and provides six tools over stdio, a standard input-and-output connection.

In plain words
What is it for?
Use it for any task in the mcp-codebase repository. It explains the project, its technology, required documentation workflow, and build and run expectations.
Why use it?
It gives agents the project context and requires them to read the relevant documentation before working. It also keeps documentation synchronized with code and requires completed changes to be committed and pushed.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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-codebase AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dmitriyot/mcp-codebase/agents-md"><img src="https://agentmods.dev/badge/instructions/dmitriyot/mcp-codebase/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,770 This file is loaded in full into every session.
When invoked 2,770 The same file — it is already loaded in full.
Security scan A 0 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.02770 $0.02770
Opus 5.5 $0.01108 $0.01108
Sonnet 5.5 $0.00554 $0.00554
Haiku 4.5 $0.00277 $0.00277

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

Security

Grade A, and why

mcp-codebase 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 2mo 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 · 211 lines

How it starts

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

AGENTS.md

Guidance for AI coding agents working in this repository. Assumes no prior knowledge of the project.

Documentation workflow (required)

Detailed project documentation lives in docs/ as Markdown files (start from docs/README.md). For every task, follow this workflow:

  1. Read the docs first. Before starting a task, read the parts of docs/ related to the task, and only then do the work.
  2. Docs must match the code. If you find a discrepancy between the documentation and the actual code, update the documentation to reflect the code.
  3. Keep docs current. After any code change, update the affected documentation in docs/ as part of the same change — a task is not done until the documentation is updated.
  4. Commit and push. When the task is complete (code + docs), commit with a clear message and push to the remote repository.

Project overview

mcp-codebase is an MCP (Model Context Protocol) server that gives an AI agent semantic navigation over a codebase. It crawls a target project, parses source files into symbols, imports, and exports, stores them in PostgreSQL, and exposes six high-level MCP tools over stdio:

  • search_symbols — find symbols by name with wildcards (*, ?), OR (|), and fuzzy trigram matching; filter by kind, language, file path.
  • get_symbol_details — source code, signature, docstring, file imports, sibling symbols.
  • explore_module — directory overview: file counts, key symbols, subdirectories, top imports.
  • find_usages — grep-style reference search for a symbol name across the project.
  • get_module_dependencies — what a file imports, what it exports, which files import it.
  • reindex — full or incremental reindex of the target project.

Note: this server indexes an external codebase (pointed at by PROJECT_ROOT), not itself.

Tech stack and requirements

  • Node.js 18+, TypeScript (ES2022 target, NodeNext modules, strict mode), pure ESM ("type": "module" in package.json).
  • PostgreSQL 14+ with the pg_trgm extension (created automatically) for fuzzy symbol search.
  • Key dependencies: @modelcontextprotocol/sdk (stdio transport), pg (connection pool), typescript (TS/JS parsing via the Compiler API), chokidar (watch mode), ignore (.gitignore handling), zod (tool input validation).

Read the full file on GitHub · 211 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. 2mo ago First seen · 211 lines · 2,770 tokens per session scan A caa4e49f7aa8

Subscribe to this mod's changes

mcp-codebase AGENTS.md is an instructions file published in the GitHub repository DmitriyOT/mcp-codebase (0 stars, last pushed 3mo ago), licensed MIT. It adds 2,770 tokens to every session, about $0.0111 per session on Opus 5.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.

Related

mcp-codebase AGENTS.md compared with instructions from other repositories

mcp-codebase AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-codebase AGENTS.mdDmitriyOT/mcp-codebaseInstructions file03mo agoMITA2,770Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode