mcp-codebase AGENTS.md

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

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

Made for: Codex, OpenCode.

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. 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.02770 $0.02770
Opus 5 $0.01385 $0.01385
Sonnet 5 $0.00554 $0.00554
Haiku 4.5 $0.00277 $0.00277

Measured yesterday against content hash caa4e49f7aa8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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. yesterday 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 1mo ago), licensed MIT. It adds 2,770 tokens to every session, about $0.0138 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.