ai-readme-manager
This server helps AI assistants discover, read, create, update, validate, and compress AI_README.md convention files, ensuring consistent, standards-compliant code generation across your team.
Discover (
discover_ai_readmes): Scan your project to find and index allAI_README.mdfiles, returning paths, scopes, and coverage patterns.Get context (
get_context_for_file): Retrieve the most relevant conventions for any file or directory, automatically combining the closest parent README with the root-level README — call this before any code task.Update (
update_ai_readme): Record architectural decisions and coding conventions using targeted operations (append, prepend, replace, insert-after/before, or full rewrite), with built-in validation and conflict detection.Initialize (
init_ai_readme): Create missing or emptyAI_README.mdfiles and guide the AI through populating them by analyzing the codebase for tech stack, patterns, and conventions.Validate (
validate_ai_readmes): Check allAI_README.mdfiles for token efficiency, structure, line length, and filler language — returning ratings and actionable suggestions.Compress (
compress_ai_readme): Deterministically strip filler words and verbose phrases to reduce token footprint without touching code blocks, paths, or commands. Supports adryRunpreview mode.Smart context routing: AI automatically receives the most relevant README based on file path (closest parent + root).
Configurable: Set token budgets, validation rules, and exclusions via
.aireadme.config.json.Integrates with Claude Code, Cursor, GitHub Copilot, Claude Desktop, and OpenClaw.
Integrates with GitHub Copilot to provide context from AI_README.md files, enabling consistent coding conventions across the project.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-readme-managerinitialize AI_README for the src directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI_README MCP Server
Project memory for AI assistants — the conventions, traps, and hard-won lessons your code cannot tell them
📑 Quick Navigation
Related MCP server: RulesetMCP
📋 Overview
AI_README MCP Server is a Model Context Protocol (MCP) server that gives AI assistants a persistent, per-directory memory of your project — not just its coding conventions, but the silent-failure traps and post-mortem lessons that are invisible in the source. It discovers, routes, and manages AI_README.md files so that knowledge earned once is not lost, and the same bug is not reintroduced six months later.
Works with: GitHub Copilot (VSCode 1.102+), Claude Code, Cursor, OpenClaw, and other MCP-compatible AI tools.
🎯 The Problem
Your AI assistant starts every session with no memory of the last one.
It re-reads the code, re-derives what it can, and re-makes the same wrong call — because the reasoning that would have stopped it was never written anywhere it can see. You correct it. The session ends. The correction is gone.
Every project accumulates knowledge that is not visible in the code:
💣 Hard-won lessons - The code shows which library you use. It does not show the three you tried first, or why they failed.
🕳️ Silent-failure traps - Some mistakes throw no error. They just quietly stop working, and nobody notices for a week.
⚰️ Deliberate oddities - That duplicated-looking field, that extra
await, that retry that seems unnecessary. Each one is load-bearing, and none of them look it.🔁 Mistakes that repeat - The AI "cleans up" the workaround, reintroducing the exact bug it was working around.
🧠 Knowledge that lives in one person's head - and leaves with them.
An AI reading your code sees what it does today. It cannot see what you already tried, what broke, or why the obvious approach was rejected. So it confidently suggests the thing you learned not to do.
💡 The Solution
AI_README.md - a per-directory memory file holding what the code cannot say: conventions, plus the traps and post-mortem lessons that stop the same bug being reintroduced.
You have probably had this conversation:
You: This retry loop looks redundant, clean it up. AI: Done, simplified. (three days later, the flaky upload bug is back)
The loop was working around a provider that returns 200 before the file is durable. That lived in a Slack thread and one engineer's memory — invisible to the AI, so it removed it. Next month a different session removes it again.
The situation | The line that prevents it |
AI "simplifies" a workaround back into the bug it was avoiding |
|
AI picks the library you already migrated off |
|
AI adds a field the API silently ignores |
|
AI "fixes" an odd-looking sort |
|
AI removes a "pointless" |
|
The pattern is always the same: something looks wrong but is deliberate, and the reason lives outside the code.
Terse by design — written for an AI to load, not a human to browse.
Entry | Why it exists |
| Ship it wrong and every existing install keeps the wrong name. No deploy fixes it. |
| The natural way to write it throws no error and saves nothing. |
| Looks like harmless data hygiene. Is a site-wide forced logout. |
| Found the way these things usually are: in an incident review. |
The code shows the fix, never the failure that motivated it.
How It Works
Create
AI_README.mdfiles in your project (root or specific directories)Record conventions and hard-won lessons - especially anything that fails silently
Commit to git - the knowledge outlives the person who earned it
AI pulls the relevant ones before planning or editing - including before a file is opened
AI writes back - lessons get recorded on the spot, through a validated channel
What This MCP Server Does
🔍 Auto-discovers all AI_README.md files in your project
🎯 Routes context - the relevant parent chain for the code being edited
🚀 Guided initialization -
init_ai_readmescans for empty files and guides population✏️ Captures lessons in-flow - the moment a trap is found,
update_ai_readmerecords it✅ Reviews every write - validation, conflict detection, quality scoring
🗜️ Keeps it dense - token budget enforcement with compression and splitting
Result: the same bug does not get reintroduced six months later by an AI that never saw the post-mortem.
🆚 AI_README vs. CLAUDE.md
"Can't I just write a CLAUDE.md?" — For conventions, often yes. The difference is where the knowledge comes from.
CLAUDE.md is written by a human, up front. That fits rules you already know: which tools to call, how to run the tests.
But the knowledge worth most in a mature codebase isn't knowable up front. Nobody writes "kube-proxy rewrites the source address before Traefik fills XFF, so externalTrafficPolicy must be Local" on day one. That's learned at 2am — and the one who learned it alongside you was the AI. AI_README captures it in that moment, through a channel that reviews the write.
CLAUDE.md | AI_README | |
Typical content | Instructions you know in advance | Lessons learned by breaking things |
Authored by | Humans, up front | AI, at the moment of discovery |
Write path | Free-form text editing |
|
Review on write | None | Validation + conflict detection + quality score |
Token budget | Unmanaged — grows until it crowds out code |
|
Nesting | Yes | Yes |
Subdirectory rules | Not in context until you work in that directory | Retrieved on demand, for any path |
The reviewed write path is what keeps the file from rotting. Most important is conflict detection: if a request contradicts a recorded lesson, the AI stops and asks instead of quietly rewriting the rule — which is exactly what stops it "fixing" a workaround back into the bug it was avoiding.
On-demand retrieval closes a planning-time gap. Both formats nest, but a subdirectory's rules only reach the AI once it works in that directory. get_context_for_file returns the full parent chain for any path, before a file is opened — so conflicts surface while changing course is still cheap.
A root CLAUDE.md plus apps/frontend/CLAUDE.md holding one rule, "use CSS Modules only":
At session start, nothing opened: the AI listed only the root file's contents. The frontend rule was not in context.
Asked to plan a refactor in that directory without reading files: it could not name a styling approach — picking one "would be an invention", in its own words — and listed "whether
apps/frontend/has its own CLAUDE.md" among what it would need to check. It inferred the file might exist but could not see inside it.
Why this compounds: conventions are roughly fixed, but lessons accumulate for as long as the project lives — each one a bug that cannot return the same way twice. As AI drafts more of the work, stability depends less on any single model's reasoning and more on whether hard-won knowledge is reachable when it's needed — by an assistant that never saw this codebase, won't remember today tomorrow, and can't read the Slack thread where the decision was made.
Conventions make AI output consistent. Recorded lessons make it not regress.
Use both. This project ships both: the rule that makes this server work — "call get_context_for_file before any code-related task" — lives in CLAUDE.md, because it must apply before any MCP tool runs. CLAUDE.md drives the workflow; AI_README holds what the project taught you.
✨ Features
🔍 Automatic Discovery - Scan and index all AI_README.md files in your project
🎯 Smart Context Routing - Find relevant README content based on file paths
🤝 Team Consistency - Every team member's AI assistant reads the same conventions from git, ensuring uniform code quality
🚀 Guided Initialization -
init_ai_readmetool scans for empty files and guides AI through population💣 Captures Hard-Won Lessons - records the trap the moment you hit it, so the fix is never quietly undone
🛑 Conflict Detection - if a request contradicts a recorded lesson, the AI stops and asks instead of overwriting it
🔄 Update & Sync - AI can both read and update AI_README files
✅ Validation & Quality - Ensure README consistency with token limits and structure checks
🗜️ Auto-Compression -
compress_ai_readmeremoves filler language and verbose phrases automatically, reducing token footprint without losing information🏗️ Monorepo Support - Place AI_README.md files at different folder levels; the tool automatically finds and uses the most relevant one
📦 Easy Integration - Works seamlessly with Cursor, Claude Code, and other MCP clients
🚀 Installation & Setup
For Claude Code (VSCode Extension)
💡 Model Recommendation: For the best experience, use larger models (Sonnet or Opus) which have stronger instruction-following capabilities and more reliably trigger MCP tools. Smaller models like Haiku may not consistently call the tools when appropriate.
Step 1: Add MCP Server
In your project directory, run:
claude mcp add --scope project ai-readme-manager npx -- ai-readme-mcp@latestThis creates a .mcp.json file that uses npx to run the package - no installation or path configuration needed!
Step 2: Enable Project MCP Servers
Create or edit .claude/settings.local.json in your project:
{
"enableAllProjectMcpServers": true
}Step 3: Auto-approve MCP Tools (Optional but Recommended)
To avoid "Yes/No" prompts every time and enable "Yes, Do not ask again" option, add the tools to your allow list.
In .claude/settings.local.json, add:
{
"permissions": {
"allow": [
"mcp__ai-readme-manager__discover_ai_readmes",
"mcp__ai-readme-manager__get_context_for_file",
"mcp__ai-readme-manager__update_ai_readme",
"mcp__ai-readme-manager__validate_ai_readmes",
"mcp__ai-readme-manager__init_ai_readme",
"mcp__ai-readme-manager__compress_ai_readme"
]
},
"enableAllProjectMcpServers": true
}Note: Without this configuration, you'll be prompted for approval every time Claude uses these tools, and the "Do not ask again" option won't appear.
Step 4: Verify Installation
claude mcp get ai-readme-managerYou should see Status: ✓ Connected
Step 5: Add CLAUDE.md Instructions
Add the following to your project's CLAUDE.md to ensure Claude consistently calls the MCP tools before every code task:
## MCP: ai-readme-manager
Before any code-related task, ALWAYS call `mcp__ai-readme-manager__get_context_for_file(projectRoot, path)` first.
If `get_context_for_file` reports empty or missing AI_README files, call `mcp__ai-readme-manager__init_ai_readme(projectRoot)` to initialize them.
If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `mcp__ai-readme-manager__update_ai_readme` to resolve the conflict before proceeding.
When establishing new conventions or making architectural decisions, call `mcp__ai-readme-manager__update_ai_readme` to record them.
Convention used in 2+ files AND non-obvious (AI'd get it wrong from code alone) → call `mcp__ai-readme-manager__update_ai_readme` to record it. Bulleted keywords, not prose; 1 "- " bullet = 1 fact (+why only if it stops reversion); fragments. Record only the fact AI can't see in code — not where it lives, what toggles it, or how it works (those → "See <file>."). A run-on chaining facts with ";"/"then" is a wall — break it into bullets, don't grow it.
NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `mcp__ai-readme-manager__update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.Why this matters: Without
CLAUDE.md, Claude may skip calling the MCP tools, causing it to generate code that ignores your project's conventions. This step is essential for reliable tool triggering.
For Cursor
Add to Cursor's MCP configuration file:
Windows:
%APPDATA%\Cursor\User\mcp.jsonmacOS/Linux:
~/.cursor/mcp.json
{
"mcpServers": {
"ai-readme-manager": {
"command": "npx",
"args": ["ai-readme-mcp@latest"]
}
}
}After configuring, restart Cursor completely.
Add AGENTS.md Instructions
Add the following to your project's AGENTS.md to ensure Cursor consistently uses the MCP tools before every code task:
## MCP: ai-readme-manager
Before any code-related task, ALWAYS call `get_context_for_file(projectRoot, path)` first.
If `get_context_for_file` reports empty or missing AI_README files, call `init_ai_readme(projectRoot)` to initialize them.
If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `update_ai_readme` to resolve the conflict before proceeding.
When establishing new conventions or making architectural decisions, call `update_ai_readme` to record them.
Convention used in 2+ files AND non-obvious (AI'd get it wrong from code alone) → call `update_ai_readme` to record it. Bulleted keywords, not prose; 1 "- " bullet = 1 fact (+why only if it stops reversion); fragments. Record only the fact AI can't see in code — not where it lives, what toggles it, or how it works (those → "See <file>."). A run-on chaining facts with ";"/"then" is a wall — break it into bullets, don't grow it.
NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.For GitHub Copilot (VSCode 1.102+)
Requirements:
VSCode 1.102 or later
GitHub Copilot & Copilot Chat extensions installed
Option 1: Using VSCode Settings UI
Open VSCode Settings (Ctrl+,)
Search for "MCP"
Click "Edit in settings.json"
Add the MCP server configuration
Option 2: Manual Configuration
Add to your VSCode settings.json:
{
"github.copilot.chat.mcp.servers": {
"ai-readme-manager": {
"command": "npx",
"args": ["ai-readme-mcp@latest"]
}
}
}After configuring, restart VSCode and you'll see the MCP tools available in GitHub Copilot Chat!
Add .github/copilot-instructions.md Instructions
Create .github/copilot-instructions.md in your project to ensure Copilot consistently uses the MCP tools before every code task:
## MCP: ai-readme-manager
Before any code-related task, ALWAYS call `get_context_for_file(projectRoot, path)` first.
If `get_context_for_file` reports empty or missing AI_README files, call `init_ai_readme(projectRoot)` to initialize them.
If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `update_ai_readme` to resolve the conflict before proceeding.
When establishing new conventions or making architectural decisions, call `update_ai_readme` to record them.
Convention used in 2+ files AND non-obvious (AI'd get it wrong from code alone) → call `update_ai_readme` to record it. Bulleted keywords, not prose; 1 "- " bullet = 1 fact (+why only if it stops reversion); fragments. Record only the fact AI can't see in code — not where it lives, what toggles it, or how it works (those → "See <file>."). A run-on chaining facts with ";"/"then" is a wall — break it into bullets, don't grow it.
NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.For Claude Desktop Application
Add to claude_desktop_config.json:
Windows:
%APPDATA%\claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/config.jsonLinux:
~/.config/claude/config.json
{
"mcpServers": {
"ai-readme-manager": {
"command": "npx",
"args": ["ai-readme-mcp@latest"]
}
}
}Add CLAUDE.md Instructions
Add the following to your project's CLAUDE.md to ensure Claude Desktop consistently uses the MCP tools before every code task:
## MCP: ai-readme-manager
Before any code-related task, ALWAYS call `get_context_for_file(projectRoot, path)` first.
If `get_context_for_file` reports empty or missing AI_README files, call `init_ai_readme(projectRoot)` to initialize them.
If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `update_ai_readme` to resolve the conflict before proceeding.
When establishing new conventions or making architectural decisions, call `update_ai_readme` to record them.
Convention used in 2+ files AND non-obvious (AI'd get it wrong from code alone) → call `update_ai_readme` to record it. Bulleted keywords, not prose; 1 "- " bullet = 1 fact (+why only if it stops reversion); fragments. Record only the fact AI can't see in code — not where it lives, what toggles it, or how it works (those → "See <file>."). A run-on chaining facts with ";"/"then" is a wall — break it into bullets, don't grow it.
NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.For OpenClaw
Perfect for vibe coding / iterative AI development — OpenClaw users often run AI agents in tight loops to build or refactor code. Without persistent context, each iteration risks breaking conventions set in previous rounds.
ai-readme-mcpgives your agent a stable memory of project rules across every loop.
Option 1: CLI (Recommended)
openclaw mcp set ai-readme-manager '{"command":"npx","args":["ai-readme-mcp@latest"]}'Option 2: Edit config file directly
Add to ~/.openclaw/openclaw.json:
{
"mcp": {
"servers": {
"ai-readme-manager": {
"command": "npx",
"args": ["ai-readme-mcp@latest"]
}
}
}
}After configuring, restart OpenClaw to load the new MCP server. Verify with:
openclaw mcp listAdd skill instructions
To ensure OpenClaw's agent consistently reads project conventions before each code change, add the following to your skill or system prompt:
## MCP: ai-readme-manager
Before any code-related task, ALWAYS call `get_context_for_file(projectRoot, path)` first.
If `get_context_for_file` reports empty or missing AI_README files, call `init_ai_readme(projectRoot)` to initialize them.
If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `update_ai_readme` to resolve the conflict before proceeding.
When establishing new conventions or making architectural decisions, call `update_ai_readme` to record them.
Convention used in 2+ files AND non-obvious (AI'd get it wrong from code alone) → call `update_ai_readme` to record it. Bulleted keywords, not prose; 1 "- " bullet = 1 fact (+why only if it stops reversion); fragments. Record only the fact AI can't see in code — not where it lives, what toggles it, or how it works (those → "See <file>."). A run-on chaining facts with ";"/"then" is a wall — break it into bullets, don't grow it.
NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.Why this matters for iterative agents: In agentic loops, each iteration is a fresh context. Without
AI_README.md, the agent has no memory of decisions made in previous rounds — leading to style drift, conflicting patterns, and regressions.ai-readme-mcpacts as the persistent memory layer that keeps every loop grounded in the same conventions.
Alternative Installation Methods
The above methods use npx (recommended). If you prefer other approaches, you can use these configurations in your MCP config file:
Claude Code:
.mcp.json(project root)Cursor:
%APPDATA%\Cursor\User\mcp.json(Windows) or~/.cursor/mcp.json(macOS/Linux)Claude Desktop:
claude_desktop_config.json(see paths above)
Option 1: Using npx (Recommended)
No installation needed! Just configure and use via npx:
{
"mcpServers": {
"ai-readme-manager": {
"command": "npx",
"args": ["ai-readme-mcp@latest"]
}
}
}The
-yflag automatically accepts the npx prompt. The@latestensures you always get the newest version.
Option 2: Global Installation
Install once globally, use everywhere:
npm install -g ai-readme-mcp@latestThen configure:
{
"mcpServers": {
"ai-readme-manager": {
"command": "ai-readme-mcp"
}
}
}Pros: Faster startup (no npx download). Cons: Need to manually update when new versions release.
Don't forget: After configuring the MCP server, add the instructions file for your AI tool — see the setup section for your specific client above (
CLAUDE.md,AGENTS.md, or.github/copilot-instructions.md).
🚀 Quick Start
Use the init_ai_readme tool to automatically scan and populate empty AI_README files:
Step 1: Create empty AI_README.md files where needed
# Example: Create empty AI_READMEs in different directories
touch AI_README.md
touch apps/backend/AI_README.md
touch apps/frontend/AI_README.mdStep 2: Trigger the initialization
In your AI assistant (Claude Code, Cursor, etc.), simply say:
"Please use the init_ai_readme MCP tool for this project"
What happens:
🔍 Scans your project for empty AI_README files
📝 Creates root-level AI_README if none exist
📋 Provides detailed step-by-step instructions for each file
🤖 AI assistant will then:
Explore relevant directories
Analyze your codebase (tech stack, patterns, conventions)
Populate each AI_README with relevant documentation
When to use init_ai_readme:
First time setting up AI_README in your project
After creating new empty AI_README.md files in subdirectories
When
get_context_for_filedetects empty AI_README filesTo batch-process multiple empty AI_README files
✏️ Manual Creation & Editing
You can always create and edit AI_README.md files yourself - no tools required. There's no required format; AI treats it as plain text, so even a single line works!
This is your project's documentation. Feel free to edit it anytime - whether you're setting up for the first time, adding new conventions, or correcting something the AI wrote.
Simple examples that work perfectly:
Never use emoji in code or comments.Use Tailwind CSS, not inline styles.
Always use TypeScript strict mode.This is a Next.js 14 app with App Router.
Use server components by default.
Database: Prisma + PostgreSQL.Key point: Write whatever helps AI understand your preferences. A few clear sentences are often better than lengthy documentation.
Best Practices:
Keep it concise (< 400 tokens is ideal)
Focus on conventions, not documentation
Update as your project evolves - add new rules whenever you notice AI doing something wrong
Review AI-made updates with
git diff AI_README.mdand edit freelyUse AI to help maintain it, but you're always the final editor
⚙️ Configuration (.aireadme.config.json)
Most projects need no config — the defaults target tight, AI-optimized files (< 400 tokens). But large monorepos often have directories whose conventions genuinely don't compress that far. Drop a .aireadme.config.json at your project root to raise the budget:
{
"tokenBudget": 800
}tokenBudget is the single knob. Set it and everything scales with it — the quality-score thresholds, the "drifting / needs-rewrite" nudges, and the numbers printed in the over-budget prompts. You don't set five numbers; you set one.
It's a target, not a hard cap. A file is never rejected or truncated for going over
tokenBudget— crossing it earns a light "tighten this up" nudge, and validation only flags an error at double the budget. So a 420-token file under an 800 budget is perfectly fine.
Tier | Formula | @ 400 (default) | @ 800 |
Excellent | ½ × tokenBudget | 200 | 400 |
Good (the target) | 1 × tokenBudget | 400 | 800 |
Warning | 1.5 × tokenBudget | 600 | 1200 |
Error | 2 × tokenBudget | 800 | 1600 |
Omitting the file is identical to { "tokenBudget": 400 } — existing projects see no change. Advanced overrides (tokenLimits, rules, sectionSplitThreshold) are still accepted and win over the derived values when set explicitly.
Tip: prefer raising
tokenBudgetonly when content is genuinely irreducible. If a single section dominates an over-budget file, the tool will suggest splitting it into a child-directoryAI_README.mdinstead — that keeps each file tight without inflating the budget.
Excluding directories
By default the scanner skips node_modules, .git, dist, build, .next, and coverage. To always ignore extra directories (e.g. generated code, a legacy/ tree, or a docs/ folder you don't want the agent to consult conventions for), add excludePatterns:
{
"excludePatterns": ["**/legacy/**", "**/docs/**"]
}excludePatterns is a single "I don't care about this path" knob, applied two ways:
The scanner skips these directories (no AI_README inside them gets indexed).
get_context_for_fileshort-circuits when the file you're editing matches — no AI_README context (not even root) is injected. The tool returns a one-line note instead. This avoids forcing a heavy root AI_README on agents editingdocs/or other non-code paths.
Built-in ignores (node_modules etc.) stay excluded on top of yours — you can't accidentally start scanning them. (Passing excludePatterns directly to a tool call still overrides the config for that one call.)
Validation rules (optional)
Two rules are worth overriding for some teams:
{
"rules": {
"allowCodeBlocks": true,
"requireSections": ["## Conventions", "## Cross-directory dependencies"]
}
}allowCodeBlocks(defaultfalse) — code fences are flagged by default because they burn tokens. Settrueif a snippet genuinely belongs in your AI_README.requireSections(default none) — warn when a listed section heading is missing, e.g. to enforce a house template across every AI_README.
Guidance level
The tool descriptions and the guidance appended to get_context_for_file are sent to the model every turn. If this server dominates your context budget, switch to medium — it trims the descriptions ~80% and drops the AI_README-writing guide from every read (that guidance still lives on update_ai_readme, where it's actually needed):
{
"guidanceLevel": "medium"
}high(default) — the full "call this every time" prompting. Best for smaller / less compliant models that need a push to call the tools.medium— much smaller footprint. Best for capable models (Opus/Sonnet) where the extra tokens are pure cost.
Read once at startup from the
.aireadme.config.jsonat the server's working directory, so a change needs a server restart to take effect. (Tool descriptions ship before any tool call, so this is the one setting read from cwd rather than a per-callprojectRoot.) It only controls the server's prompt overhead — not what your AI_README files say or how validation behaves.
🗜️ Validate & Compress AI_README Files
Keep your AI_README files concise and token-efficient with a single prompt to your AI assistant:
Validate and compress all AI_README files using
validate_ai_readmesandcompress_ai_readme.
The AI will automatically run the full cycle: validate_ai_readmes → compress_ai_readme (dry-run preview) → apply → re-validate.
Multi-Level AI_README (Not Just for Monorepos!)
The power of this tool is multi-level documentation - not just for monorepos, but for any project that wants to organize conventions by module or feature.
Why multi-level?
🎯 Avoid bloated root README - Keep each README focused and concise
📍 Precise context - AI gets only the relevant conventions for the code it's working on
🔧 Flexible organization - Organize by feature, module, or any structure that makes sense
Simply place AI_README.md files at different folder levels:
my-monorepo/
├── AI_README.md # Root-level conventions (applies to all)
├── apps/
│ ├── frontend/
│ │ ├── AI_README.md # Frontend-specific conventions
│ │ └── src/components/Button.tsx
│ └── backend/
│ ├── AI_README.md # Backend-specific conventions
│ └── src/api/users.ts
└── packages/
└── shared/
├── AI_README.md # Shared library conventions
└── src/utils.tsSmart Empty README Handling:
📝 Create empty
AI_README.mdfiles in subdirectories where you need specific conventions🚀 Run
init_ai_readmetool (just tell your AI: "Please initialize AI_README files")🤖 AI automatically analyzes each directory and populates conventions
🔗 For subdirectories with parent READMEs, generates differential content (only module-specific conventions)
📋 For root directories, generates full project analysis
When AI works on a file, it automatically gets:
The most relevant AI_README (closest parent directory)
Plus the root-level AI_README (for project-wide standards)
For example, when editing apps/frontend/src/components/Button.tsx:
✅ Gets
apps/frontend/AI_README.md(React component standards)✅ Gets root
AI_README.md(project-wide Git, testing conventions)
Test the Integration
Restart your IDE, then ask your AI assistant:
"I'm about to create a new component. What conventions should I follow?"
The AI will automatically retrieve your AI_README context!
For detailed setup instructions, see Quick Start Guide.
🏗️ Project Structure
ai-readme-mcp/
├── src/
│ ├── index.ts # MCP Server entry point
│ ├── tools/ # MCP Tools implementation
│ ├── core/ # Core logic (scanner, router, updater)
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── fixtures/ # Test fixtures
└── docs/ # Documentation🛠️ Development
Prerequisites
Node.js 18+
npm/pnpm/yarn
TypeScript 5+
Setup
# Clone the repository
git clone https://github.com/Draco-Cheng/ai-readme-mcp.git
cd ai-readme-mcp
# Install dependencies
npm install
# Run type checking
npm run typecheck
# Run tests
npm test
# Build the project
npm run build
# Development mode with watch
npm run devLocal Development Configuration
If you're developing or modifying the source code, configure your MCP client to use your local build:
For Claude Code - Add with CLI:
# Linux/macOS:
claude mcp add --transport stdio ai-readme-manager --scope project -- node ~/ai-readme-mcp/dist/index.js
# Windows:
claude mcp add --transport stdio ai-readme-manager --scope project -- node C:\Users\YourName\ai-readme-mcp\dist\index.jsFor Claude Code - Manual .mcp.json:
{
"mcpServers": {
"ai-readme-manager": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/ai-readme-mcp/dist/index.js"]
}
}
}For Cursor or Claude Desktop:
{
"mcpServers": {
"ai-readme-manager": {
"command": "node",
"args": ["/absolute/path/to/ai-readme-mcp/dist/index.js"]
}
}
}Path examples:
Windows:
"C:\\Users\\YourName\\ai-readme-mcp\\dist\\index.js"(use\\for escaping)macOS/Linux:
"/home/username/ai-readme-mcp/dist/index.js"
📚 Documentation
Quick Start Guide - Get started in 10 minutes
Contributing Guide - How to contribute
Project Specification - Complete technical specification
🛠️ Available MCP Tools
discover_ai_readmes
Scans your project and discovers all AI_README.md files.
// Parameters
{
projectRoot: string; // Required: Project root directory
excludePatterns?: string[]; // Optional: Glob patterns to exclude
}
// Returns
{
projectRoot: string;
totalFound: number;
readmeFiles: Array<{
path: string;
scope: string;
level: number;
patterns: string[];
}>;
lastUpdated: string;
}get_context_for_file
Gets relevant AI_README context for a specific file path.
// Parameters
{
projectRoot: string; // Required: Project root directory
filePath: string; // Required: File path relative to root
includeRoot?: boolean; // Optional: Include root README (default: true)
excludePatterns?: string[]; // Optional: Glob patterns to exclude
}
// Returns
{
filePath: string;
totalContexts: number;
contexts: Array<{
path: string;
relevance: 'root' | 'direct' | 'parent';
distance: number;
content: string;
}>;
formattedPrompt: string; // Ready-to-use formatted context
}update_ai_readme
Update an AI_README.md file with specified operations.
// Parameters
{
readmePath: string; // Required: Path to AI_README.md file
projectRoot: string; // Required: Project root (config is read from here)
operations: Array<{ // Required: Update operations to perform
type: 'append' | 'prepend' | 'replace' | 'insert-after' | 'insert-before';
content: string; // Content to add or replace
section?: string; // Section heading (for insert operations)
searchText?: string; // Text to search for (for replace)
}>;
}
// Returns
{
success: boolean;
readmePath: string;
changes: Array<{
operation: string;
section?: string;
linesAdded: number;
linesRemoved: number;
}>;
summary: string; // Includes reminder to use git diff
error?: string; // Error message if failed
}Note: Changes are written directly to the file. Use Git for version control:
Review changes:
git diff AI_README.mdUndo changes:
git checkout AI_README.mdCommit changes:
git add AI_README.md && git commit -m "Update AI_README"
Example Usage:
// Append new section
{
readmePath: "apps/frontend/AI_README.md",
operations: [{
type: "append",
content: "## Performance\n- Use React.memo for expensive components"
}]
}
// Insert after specific section
{
readmePath: "AI_README.md",
operations: [{
type: "insert-after",
section: "## Coding Conventions",
content: "### Code Style\n- Use TypeScript strict mode\n- Prefer const over let"
}]
}
// Replace specific text
{
readmePath: "AI_README.md",
operations: [{
type: "replace",
searchText: "Run tests with npm test",
content: "Run tests with: `npm test` or `npm run test:watch`"
}]
}init_ai_readme
Initialize and populate empty AI_README files in your project.
// Parameters
{
projectRoot: string; // Required: Project root directory
excludePatterns?: string[]; // Optional: Glob patterns to exclude
targetPath?: string; // Optional: Specific directory to initialize
}
// Returns
{
success: boolean;
message: string;
readmesToInitialize: string[]; // Paths to empty AI_README files
instructions: string; // Detailed step-by-step guide for populating
}Features:
🔍 Scans project for empty or missing AI_README files
📝 Creates root-level AI_README if none exist
📋 Generates detailed step-by-step instructions for each file
🎯 Can target specific directories with
targetPathparameter🤖 Guides AI through analysis: tech stack, patterns, conventions
Example Usage:
// Initialize all empty AI_READMEs in project
{
projectRoot: "/path/to/project"
}
// Initialize only in specific directory
{
projectRoot: "/path/to/project",
targetPath: "apps/backend"
}Typical Workflow:
AI assistant runs
init_ai_readmeReceives detailed instructions for each empty file
Follows instructions:
Uses
Globto scan directoryReads 2-5 key source files
Analyzes tech stack, patterns, conventions
Uses
update_ai_readmeto populate each fileVerifies with
get_context_for_fileorvalidate_ai_readmes
validate_ai_readmes
Validate all AI_README.md files in your project for quality and token efficiency.
// Parameters
{
projectRoot: string; // Required: Project root directory
excludePatterns?: string[]; // Optional: Glob patterns to exclude
config?: { // Optional: Custom validation config
tokenBudget?: number; // Single knob; derives the tiers below (default: 400)
rules?: {
requireH1?: boolean;
requireSections?: string[];
allowCodeBlocks?: boolean;
maxLineLength?: number;
};
tokenLimits?: {
excellent?: number; // Default: 200
good?: number; // Default: 400
warning?: number; // Default: 600
error?: number; // Default: 800
};
};
}
// Returns
{
valid: boolean;
totalFiles: number;
results: Array<{
path: string;
valid: boolean;
tokens: number;
rating: 'excellent' | 'good' | 'needs-improvement' | 'too-long';
issues: string[];
suggestions: string[];
}>;
summary: string;
}Validation Features:
Token counting for AI consumption optimization
Structure validation (H1 heading, sections)
Line length checks (default: 100 chars)
Code block detection (disabled by default for strict mode)
Quality ratings based on token count
Default Token Limits (Strict Mode):
🌟 Excellent: < 200 tokens
✅ Good: < 400 tokens
⚠️ Needs improvement: < 600 tokens
❌ Too long: > 800 tokens
compress_ai_readme
Compress an AI_README.md file using deterministic filler-language removal. No LLM call — pure regex transforms.
// Parameters
{
readmePath: string; // Required: Absolute path to AI_README.md file
projectRoot: string; // Required: Project root (config is read from here)
dryRun?: boolean; // Optional: Preview changes without writing (default: false)
}
// Returns
{
success: boolean;
readmePath: string;
summary: string; // Human-readable summary with token diff
tokensBefore: number;
tokensAfter: number;
reductionPercent: number;
changes: Array<{
line: number;
original: string;
compressed: string;
patterns: string[]; // Filler patterns that were removed
}>;
written: boolean; // false if dryRun or no changes found
}What it removes (prose only — code blocks are never touched):
Filler words:
just,really,basically,actually,simply,essentiallyVerbose phrases:
in order to→to,utilize→use,make sure to→ensureHedging:
you should,remember to,it might be worth,please note thatFluff connectives:
furthermore,additionally,in addition,moreover
Output may contain sentence fragments — this is intentional. Token-efficient format is valid for AI_README files.
Typical Workflow:
Run
validate_ai_readmes— note anyfiller-languagewarningsRun
compress_ai_readmewithdryRun: trueto previewRun again without
dryRunto applyRe-run
validate_ai_readmesto confirm improvement
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Resources
📧 Contact
GitHub Issues: https://github.com/Draco-Cheng/ai-readme-mcp/issues
Project Link: https://github.com/Draco-Cheng/ai-readme-mcp
Available Tools
6 toolscompress_ai_readmeA
Compress an AI_README.md file using deterministic filler-language removal (no LLM call).
WHEN TO CALL:
validate_ai_readmes reports 'filler-language' warnings.
validate_ai_readmes reports token count is too high.
After init_ai_readme, to tighten up generated content.
Any time you want to reduce AI_README token footprint without losing information.
WHAT IT DOES (pure text transforms, deterministic):
Removes filler: just, really, basically, actually, simply, essentially
Shortens verbose phrases: 'in order to' → 'to', 'utilize' → 'use', 'make sure to' → 'ensure'
Removes hedging: 'you should', 'remember to', 'it might be worth', 'please note that'
Removes fluff connectives: furthermore, additionally, in addition, moreover
NEVER modifies: code blocks (``` fenced), inline code (
...), headings, file paths, URLs, commandsOutput may contain sentence fragments — this is intentional. Fragments are valid token-efficient format.
USE dryRun:true FIRST to preview changes before writing.
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | If true, return compression preview without writing the file (default: false) | |
| readmePath | Yes | Absolute path to the AI_README.md file to compress | |
| projectRoot | Yes | Project root directory. Config (.aireadme.config.json) is read from here. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and meets it thoroughly. It discloses that transformations are deterministic and pure-text, enumerates exactly what is removed, and explicitly states what is NEVER modified: code blocks, inline code, headings, file paths, URLs, and commands. It also preempts confusion by explaining intentional sentence fragments in the output.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is organized with clear headers and bullets, front-loading the core purpose and when-to-use conditions before diving into mechanics. Every bullet conveys a distinct, decision-relevant fact, and there is no redundant prose or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is highly complete for a 3-parameter tool: it explains when to call, what it changes, what it preserves, and how to preview safely. The only minor gap is that it does not specify what the tool returns on a successful non-dry-run write, but that is not essential for the agent to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers all three parameters at 100%, so the baseline is 3. The description adds meaningful usage context beyond the schema by insisting on dryRun:true first, explaining that projectRoot is where config is read from, and indicating that dryRun returns a compression preview. This enriches the agent's understanding of how parameters should be used.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Compress an AI_README.md file using deterministic filler-language removal'. It clearly distinguishes this tool from siblings like validate_ai_readmes, init_ai_readme, and update_ai_readme by naming the exact transformation and explicitly stating it makes no LLM call.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
A dedicated 'WHEN TO CALL' section lists concrete triggers: after validation filler-language warnings, high token counts, after init_ai_readme, or whenever reducing token footprint is desired. It also gives a clear operational instruction to use dryRun:true first, which is actionable guidance an agent can follow without inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discover_ai_readmesA
Scan the project and discover all AI_README.md files. Returns an index of all README files with their paths, scopes, and coverage patterns.
| Name | Required | Description | Default |
|---|---|---|---|
| projectRoot | Yes | The root directory of the project. Use the current working directory (e.g., from environment or pwd). If unsure, pass the project root path. | |
| excludePatterns | No | Glob patterns to exclude (e.g., ['node_modules/**', '.git/**']) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses the return format (index with paths, scopes, coverage patterns) but does not state whether the operation is read-only, its performance implications, or any side effects. The description establishes basic behavior but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, completely front-loaded with the action and result. Every word serves a purpose with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite no output schema, the description specifies what is returned (index with paths, scopes, coverage patterns), which is sufficient for a scanning tool. With good schema coverage, the overall definition is complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so both parameters are already documented with descriptions. The tool description adds no additional meaning beyond what the schema provides, resulting in a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: scanning to discover all AI_README.md files and returning an index with paths, scopes, and coverage patterns. This distinctly separates it from siblings like compress, init, update, or validate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for discovery but provides no explicit guidance on when to use this tool versus alternatives like get_context_for_file or init_ai_readme. Sibling names offer some context, but no when-not or exclusions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_context_for_fileA
ALWAYS CALL THIS FIRST - NO EXCEPTIONS. WHEN TO CALL (check these FIRST before responding):
User asks: optimize, improve, analyze, review, suggest, think, opinion.
User mentions: file name, component name, project, codebase, backend, frontend, infra, devops, CI/CD, docker, config.
User asks: "what can", "what should", "how to", "can you", "help me".
User wants to: create, build, add, implement, setup, configure, deploy, migrate, optimize, refactor, improve, analyze, review, suggest, think, opinion.
User selects an option that leads to code changes (e.g., choosing from a list of approaches).
User says: "next step", "next phase", "next section", "continue", "proceed", "go ahead", "start", "do it", "yes" (confirming action).
Before: Write, Edit, TodoWrite, Bash (for build/deploy), suggesting ANY code changes.
When executing a plan, todo, or multi-phase task: call BEFORE each file modification.
After user approves a plan or todo, call this BEFORE the each Write/Edit. IF ANY ABOVE = TRUE → CALL get_context_for_file IMMEDIATELY.
MANDATORY: Call this tool BEFORE every code-related response.
CALL EVERY TIME - EVERY response that involves code/suggestions MUST start with get_context_for_file. CALL EVERY TIME - even if you called it earlier in this conversation. CALL EVERY TIME - even if working on the same file. CALL EVERY TIME - even within the same section/phase - multiple calls are expected and correct. CALL EVERY TIME - context may have changed or sub-directories may have additional conventions. CALL EVERY TIME - when user confirms or selects an option that will result in code changes.
What this tool does: Gets AI_README context showing project conventions that MUST be followed. Why it matters:
Without: Wrong tech (suggest Tailwind when project uses CSS Modules).
With: Suggestions fit existing codebase perfectly.
During plan/todo/phase execution: Context may differ per directory; call before EACH file change. DETECT CONFLICTS: After reading context, if user wants X but AI_README says Y:
This is ARCHITECTURAL DECISION.
Workflow: get_context → update_ai_readme → get_context → Write/Edit.
RECORD DECISIONS: When you make architectural decisions during planning or implementation:
Design patterns, API structure, naming conventions, new abstractions.
Call update_ai_readme to record decisions that affect multiple files.
Future code (yours or others) will follow these recorded conventions.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to get context for (relative to project root). Can be either a FILE path or a DIRECTORY path. Examples: "src/components/Button.tsx", "src/components", "README.md", "src/app". Use "." to get root-level context when no specific file is known. The tool will find all relevant AI_README files in the path's directory and parent directories. | |
| includeRoot | No | Whether to include root-level AI_README (default: true) | |
| projectRoot | Yes | The root directory of the project. Use the current working directory (e.g., from environment or pwd). If unsure, pass the project root path. | |
| excludePatterns | No | Glob patterns to exclude when scanning |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It explains that context may differ per directory, multiple calls are expected, and that without it the agent may suggest wrong tech. However, it does not explicitly state that the tool is read-only or non-mutating, though implied.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a strong imperative, but it is overly verbose with repeated 'CALL EVERY TIME' sections and a long list of triggers. It could be trimmed significantly without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (4 params, no output schema), the description covers usage context thoroughly, including siblings workflow and conflict detection. However, it lacks any description of the return format, which would be important for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 4 parameters. The description adds some value for the 'path' parameter with examples and usage notes, but for others like 'includeRoot' and 'excludePatterns', it adds little beyond the schema. Since coverage is high, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Gets AI_README context showing project conventions that MUST be followed.' It identifies the verb (get), resource (AI_README context), and scope (project/file-level). It distinguishes from sibling tools like update_ai_readme and validate_ai_readmes by focusing on retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides an exhaustive list of when to call, including specific user intents and triggers. Explicitly states 'CALL EVERY TIME' before code changes. Includes a workflow: get_context → update_ai_readme → get_context → Write/Edit, clearly differentiating from siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
init_ai_readmeA
Initialize and populate empty AI_README files within a project. When to use:
First-time setup when no AI_README exists.
get_context_for_file reports empty or missing AI_README files.
Newly created directories need conventions recorded.
Multiple directories require conventions in one pass. What it does:
Scans for missing or empty AI_README documents.
Creates a root-level AI_README if none is present.
Provides directory-specific prompts to gather conventions.
Guides you through documenting tech stack, patterns, and naming. Workflow:
Call init_ai_readme.
Follow the step-by-step instructions to inspect each directory.
Use update_ai_readme to record the conventions.
Run validate_ai_readmes to check for problems.
Fix any warnings (remove redundant content, add Cross-directory dependencies section).
Re-run get_context_for_file to confirm coverage before coding.
| Name | Required | Description | Default |
|---|---|---|---|
| targetPath | No | Specific directory to initialize (optional, defaults to scanning entire project) | |
| projectRoot | Yes | The root directory of the project. Use the current working directory (e.g., from environment or pwd). If unsure, pass the project root path. | |
| excludePatterns | No | Glob patterns to exclude when scanning |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries burden. Discloses scanning, creation of root AI_README, and guidance prompts. Could mention idempotency or behavior if AI_README already exists, but overall transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is well-organized with sections, front-loaded with purpose, and every sentence adds value. No fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but description and workflow provide a clear picture of the multi-step process. Covers prerequisites, steps, and downstream tools. Lacks details on return format but sufficient for agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (all three parameters described). Description does not add significant detail beyond the schema for targetPath or excludePatterns. Baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool initializes and populates empty AI_README files, with specific verb and resource. It distinguishes from siblings like update_ai_readme by focusing on first-time setup.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit 'When to use' section lists four scenarios (first-time setup, empty reports, new directories, multiple directories). Workflow indicates sequence after other tools. Does not explicitly exclude cases, but the guidance is strong.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_ai_readmeA
CALL THIS to record DECISIONS and CONVENTIONS.
WHEN TO CALL:
A. CONFLICT RESOLUTION — STOP IMMEDIATELY when any of these occur:
User says: "don't use X", "use Y instead", "prefer", "switch to".
During planning: user's request or your proposal differs from AI_README conventions.
During planning: user approves a plan that contradicts AI_README.
User overrides a convention mid-task (even casually, e.g. 'just use X here').
DO NOT continue planning or coding. Call update_ai_readme first, then resume.
B. ARCHITECTURAL DECISIONS (during planning/implementation):
You chose a design pattern (e.g., repository pattern, factory, singleton).
You decided on API structure (REST paths, error format, response shape).
You established naming conventions (files, functions, variables).
You created new abstractions (utilities, hooks, services, types).
You set up error handling strategy or validation approach.
You introduced a new dependency or integration pattern.
C. IMPLEMENTATION PATTERNS (after writing code):
You created a reusable pattern others should follow.
You established a file/folder structure for a new feature.
You made decisions that affect future development.
D. MISSING / UNDOCUMENTED (during get_context or code review):
AI_README is missing a convention that is ALREADY USED in 2+ existing files.
A pattern exists in code but not in AI_README — record it so future code follows it.
Do NOT record one-off choices or speculative future patterns.
RULE: If a decision will affect MORE THAN ONE FILE or FUTURE CODE → RECORD IT.
WORKFLOW:
get_context (read current conventions).
Make decision or detect conflict.
update_ai_readme (record the decision).
Continue with implementation.
Content Rules:
Extremely concise (default < 400 tokens; project may set a higher tokenBudget).
Only actionable conventions (tech, naming, patterns, infrastructure patterns, testing patterns).
NO explanations or examples
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | List of update operations to perform | |
| readmePath | Yes | Path to the AI_README.md file to update | |
| projectRoot | Yes | Project root directory. Config (.aireadme.config.json) is read from here. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden and it largely delivers: it frames the call as a recording action that should happen before continuing work, and specifies content constraints and the 'last resort' treatment of rewrites. It does not explicitly state that the tool mutates the file on disk or what the return/error behavior is, but the schema's operation details and the tool name make the mutation obvious.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long, but it is front-loaded with the core purpose and organized into scannable sections and lettered categories. Every section earns its place; it is verbose only because the tool's trigger conditions are complex and high-stakes.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex decision-recording tool with no annotations and no output schema, the description combined with the detailed input schema is sufficient: it covers triggering conditions, the required preceding get_context step, what to record, what not to record, and how to format content. An agent can determine both when to invoke the tool and how to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3; the description adds value by adding a default token budget (<400 tokens), requiring actionable conventions only, and prohibiting explanations/examples, which directly shapes the operations.content parameter. It does not re-explain readmePath/projectRoot, but those are fully documented in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening line, 'CALL THIS to record DECISIONS and CONVENTIONS', states a specific action and resource, and the tool name reinforces it. It is clearly distinguished from siblings like init_ai_readme, compress_ai_readme, and get_context_for_file, which create, shrink, or read the file rather than record decisions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives exhaustive when-to-call criteria across conflict resolution, architectural decisions, implementation patterns, and undocumented conventions, plus explicit exclusions ('Do NOT record one-off choices or speculative future patterns') and a rule threshold ('affects MORE THAN ONE FILE or FUTURE CODE'). It also embeds a workflow that orders get_context before update_ai_readme and says to continue after recording.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_ai_readmesB
Validate all AI_README.md files in a project. Checks token count, structure, and content quality. Returns validation results with suggestions for improvement.
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | Custom validation configuration (optional, uses defaults if not provided) | |
| projectRoot | Yes | The root directory of the project. Use the current working directory (e.g., from environment or pwd). If unsure, pass the project root path. | |
| excludePatterns | No | Glob patterns to exclude (e.g., ["node_modules/**", ".git/**"]) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must disclose all behavioral traits. It mentions what is checked (token count, structure, content quality) and that results include suggestions, but it does not state whether the tool modifies files, requires permissions, or has side effects. The read-only nature is implied but not explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exceptionally concise: two sentences that efficiently convey the tool's purpose and output without any superfluous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (nested config, no output schema), the description is incomplete. It lacks details about return value structure, validation failure behavior, or how suggestions are presented. The agent would need more context to correctly handle the tool's output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are already well-documented in the schema. The description adds minimal extra meaning beyond stating the overall purpose; it does not elaborate on parameter details. Thus a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: validating AI_README.md files in a project, checking token count, structure, and content quality. It uses a specific verb ('validate') and resource ('AI_README.md files'), and distinguishes itself from sibling tools like compress, discover, or update.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool should be used to check the quality of readme files, but it does not provide explicit guidance on when to use it versus alternatives (e.g., after updates, before compression). No when-not-to-use or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.10.1- Changed
compress_ai_readme2 fields changed- added
Input schema / properties / projectRootAdded value: +{ + "description": "Project root directory. Config (.aireadme.config.json) is read from here.", + "type": "string" +} - changed
Input schema / requiredPrevious value: -[ - "readmePath" -]New value: +[ + "readmePath", + "projectRoot" +]
- Changed
update_ai_readme2 fields changed- added
Input schema / properties / projectRootAdded value: +{ + "description": "Project root directory. Config (.aireadme.config.json) is read from here.", + "type": "string" +} - changed
Input schema / requiredPrevious value: -[ - "readmePath", - "operations" -]New value: +[ + "readmePath", + "projectRoot", + "operations" +]
1 tool update
v1.6.4- Changed
validate_ai_readmes2 fields changed- removed
Input schema / properties / config / properties / maxTokensRemoved value: -{ - "type": "number" -} - added
Input schema / properties / config / properties / tokenBudgetAdded value: +{ + "type": "number" +}
6 tool updates
v1.6.3- First observed
compress_ai_readme - First observed
discover_ai_readmes - First observed
get_context_for_file - First observed
init_ai_readme - First observed
update_ai_readme - First observed
validate_ai_readmes
TDQS
Scored across 6 tools
Each tool targets a distinct phase of the AI_README lifecycle: discover, initialize, read, update, validate, and compress. However, the get_context_for_file description embeds update_ai_readme instructions and workflow, which blurs the boundary between reading and writing context.
Tool names generally follow a verb_noun pattern and are predictable. Minor inconsistencies exist: singular vs. plural forms (ai_readme vs. ai_readmes) and get_context_for_file does not mention ai_readme like the others do.
Six tools is well-scoped for an AI_README manager. Each tool covers a necessary function—discovery, initialization, context retrieval, updates, validation, and compression—without redundant or extraneous additions.
The tool surface covers the full AI_README lifecycle: discover existing files, initialize missing ones, read context, update conventions, validate quality, and compress content. There are no major dead ends; even maintenance tasks are supported.
Maintenance
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
- DartOAuthcom.dartai
AI-native project management for tasks, docs, collaboration, and agents.
Serves your design system and coding standards to coding agents, so they stop guessing.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with professional coding standards, development best practices, and context-aware guidance through static documentation and AI-powered custom recommendations. Enables agents to access comprehensive development guidelines including coding rules, debugging techniques, and AI steering instructions.-
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with queryable, version-controlled project rules and coding standards. Enables validation, rule-based guidance, and task summaries to keep AI work aligned with your project's conventions without repeating context.2MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to navigate and query hierarchical documentation structures, supporting markdown files with YAML metadata and OpenAPI 3.x specifications. It features intelligent full-text search, metadata filtering, and a built-in web interface for both human and AI-driven documentation access.6MIT
- AlicenseNot gradedqualityDmaintenanceTransforms any GitHub repository into a documentation hub for AI assistants, enabling up-to-date access to documentation and code to eliminate hallucinations.44 npm1Apache 2.0