ai-readme-mcp 0.1.0 β 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -67
- package/dist/index.js +361 -42
- package/dist/index.js.map +1 -1
- package/docs/templates/basic.md +55 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -10,26 +10,34 @@
|
|
|
10
10
|
|
|
11
11
|
AI_README MCP Server is a Model Context Protocol (MCP) server that automatically manages and syncs AI_README.md files across your projects. It enables AI assistants to intelligently read and update relevant context documentation when modifying code.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### Why AI_README?
|
|
14
|
+
|
|
15
|
+
When working with AI assistants on code projects, **consistency and quality matter**. This tool helps teams:
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
- **π€ Standardize AI interactions** - Ensure all team members and AI assistants follow the same coding standards, conventions, and best practices
|
|
18
|
+
- **π Improve AI output quality** - By providing clear, structured context, AI generates more accurate and consistent code that matches your project's style
|
|
19
|
+
- **π― Maintain consistency across teams** - When multiple developers use AI assistants, AI_README ensures everyone gets the same guidelines and standards
|
|
20
|
+
- **β‘ Save time on onboarding** - New team members and AI assistants instantly understand project conventions without lengthy explanations
|
|
21
|
+
- **π Keep documentation in sync** - AI can automatically update README files as the project evolves, maintaining up-to-date documentation
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- π¦ **Easy Integration** - Works seamlessly with Claude Code and other MCP clients
|
|
21
|
-
- π§ͺ **Well Tested** - 36 unit tests, 100% passing
|
|
23
|
+
Think of it as a **"style guide and context manager for AI"** - ensuring every AI interaction in your project follows your team's standards and produces high-quality, consistent output.
|
|
24
|
+
|
|
25
|
+
## β¨ Features
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
- π **Automatic Discovery** - Scan and index all AI_README.md files in your project
|
|
28
|
+
- π― **Smart Context Routing** - Find relevant README content based on file paths
|
|
29
|
+
- π **Update & Sync** - AI can both read and update AI_README files
|
|
30
|
+
- β
**Validation & Quality** - Ensure README consistency with token limits and structure checks
|
|
31
|
+
- π€ **Smart Initialization** - Auto-generate AI_README files based on project analysis
|
|
32
|
+
- ποΈ **Monorepo Support** - Place AI_README.md files at different folder levels; the tool automatically finds and uses the most relevant one
|
|
33
|
+
- π¦ **Easy Integration** - Works seamlessly with Cursor, Claude Code, and other MCP clients
|
|
24
34
|
|
|
25
|
-
- β
**Validation & Health Checks** - Ensure README consistency and integrity (Phase 3)
|
|
26
|
-
- π¬ **Watch Mode** - Auto-sync changes to README files (Phase 4)
|
|
27
35
|
|
|
28
36
|
## π Quick Start
|
|
29
37
|
|
|
30
38
|
### Installation
|
|
31
39
|
|
|
32
|
-
**Option 1: Using npx (Recommended
|
|
40
|
+
**Option 1: Using npx (Recommended)**
|
|
33
41
|
|
|
34
42
|
No installation needed! Just configure and use via npx:
|
|
35
43
|
|
|
@@ -46,7 +54,7 @@ No installation needed! Just configure and use via npx:
|
|
|
46
54
|
|
|
47
55
|
The `-y` flag automatically accepts the npx prompt.
|
|
48
56
|
|
|
49
|
-
**Option 2: Global Installation
|
|
57
|
+
**Option 2: Global Installation**
|
|
50
58
|
|
|
51
59
|
```bash
|
|
52
60
|
npm install -g ai-readme-mcp
|
|
@@ -64,9 +72,9 @@ Then configure:
|
|
|
64
72
|
}
|
|
65
73
|
```
|
|
66
74
|
|
|
67
|
-
**Option 3: Local Development
|
|
75
|
+
**Option 3: Local Development**
|
|
68
76
|
|
|
69
|
-
> **Note:** Use this method
|
|
77
|
+
> **Note:** Use this method if you want to modify or contribute to the source code.
|
|
70
78
|
|
|
71
79
|
```bash
|
|
72
80
|
# Clone this repository to a permanent location
|
|
@@ -135,7 +143,7 @@ Add to Cursor's MCP configuration file:
|
|
|
135
143
|
**Windows:** `%APPDATA%\Cursor\User\mcp.json`
|
|
136
144
|
**macOS/Linux:** `~/.cursor/mcp.json`
|
|
137
145
|
|
|
138
|
-
**
|
|
146
|
+
**Using npx (Recommended):**
|
|
139
147
|
|
|
140
148
|
```json
|
|
141
149
|
{
|
|
@@ -148,7 +156,7 @@ Add to Cursor's MCP configuration file:
|
|
|
148
156
|
}
|
|
149
157
|
```
|
|
150
158
|
|
|
151
|
-
**
|
|
159
|
+
**If globally installed:**
|
|
152
160
|
|
|
153
161
|
```json
|
|
154
162
|
{
|
|
@@ -160,16 +168,14 @@ Add to Cursor's MCP configuration file:
|
|
|
160
168
|
}
|
|
161
169
|
```
|
|
162
170
|
|
|
163
|
-
**
|
|
171
|
+
**For local development:**
|
|
164
172
|
|
|
165
173
|
```json
|
|
166
174
|
{
|
|
167
175
|
"mcpServers": {
|
|
168
176
|
"ai-readme-manager": {
|
|
169
177
|
"command": "node",
|
|
170
|
-
"args": [
|
|
171
|
-
"D:\\Home\\WorkSpace\\playground\\ai-readme-mcp\\dist\\index.js"
|
|
172
|
-
]
|
|
178
|
+
"args": ["/path/to/ai-readme-mcp/dist/index.js"]
|
|
173
179
|
}
|
|
174
180
|
}
|
|
175
181
|
}
|
|
@@ -186,7 +192,7 @@ Add to `claude_desktop_config.json`:
|
|
|
186
192
|
**Windows:** `%APPDATA%\claude\claude_desktop_config.json`
|
|
187
193
|
**macOS/Linux:** `~/.config/claude/config.json` or `~/Library/Application Support/Claude/config.json`
|
|
188
194
|
|
|
189
|
-
**
|
|
195
|
+
**Using npx (Recommended):**
|
|
190
196
|
|
|
191
197
|
```json
|
|
192
198
|
{
|
|
@@ -199,7 +205,7 @@ Add to `claude_desktop_config.json`:
|
|
|
199
205
|
}
|
|
200
206
|
```
|
|
201
207
|
|
|
202
|
-
**
|
|
208
|
+
**If globally installed:**
|
|
203
209
|
|
|
204
210
|
```json
|
|
205
211
|
{
|
|
@@ -211,14 +217,14 @@ Add to `claude_desktop_config.json`:
|
|
|
211
217
|
}
|
|
212
218
|
```
|
|
213
219
|
|
|
214
|
-
**
|
|
220
|
+
**For local development:**
|
|
215
221
|
|
|
216
222
|
```json
|
|
217
223
|
{
|
|
218
224
|
"mcpServers": {
|
|
219
225
|
"ai-readme-manager": {
|
|
220
226
|
"command": "node",
|
|
221
|
-
"args": ["/
|
|
227
|
+
"args": ["/path/to/ai-readme-mcp/dist/index.js"]
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
230
|
}
|
|
@@ -226,7 +232,20 @@ Add to `claude_desktop_config.json`:
|
|
|
226
232
|
|
|
227
233
|
### Create Your First AI_README
|
|
228
234
|
|
|
229
|
-
|
|
235
|
+
You can use the `init_ai_readme` MCP tool to automatically generate a customized AI_README.md based on your project:
|
|
236
|
+
|
|
237
|
+
**Smart Mode (Default)**:
|
|
238
|
+
The tool automatically detects your project and generates relevant content:
|
|
239
|
+
- Detects project type (library/application/monorepo)
|
|
240
|
+
- Identifies language (TypeScript, Python, Go, Rust, Java, etc.)
|
|
241
|
+
- Recognizes framework (React, Vue, Next.js, Express, NestJS, etc.)
|
|
242
|
+
- Analyzes directory structure
|
|
243
|
+
- Generates framework-specific conventions
|
|
244
|
+
|
|
245
|
+
Ask your AI assistant:
|
|
246
|
+
> "Please use init_ai_readme to create an AI_README.md for this project"
|
|
247
|
+
|
|
248
|
+
Or create manually:
|
|
230
249
|
|
|
231
250
|
```markdown
|
|
232
251
|
# My Project
|
|
@@ -244,13 +263,54 @@ Create `AI_README.md` in your project root:
|
|
|
244
263
|
Run tests with: `npm test`
|
|
245
264
|
```
|
|
246
265
|
|
|
266
|
+
### Multi-Level AI_README (Not Just for Monorepos!)
|
|
267
|
+
|
|
268
|
+
**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.
|
|
269
|
+
|
|
270
|
+
**Why multi-level?**
|
|
271
|
+
- π― **Avoid bloated root README** - Keep each README focused and concise
|
|
272
|
+
- π **Precise context** - AI gets only the relevant conventions for the code it's working on
|
|
273
|
+
- π§ **Flexible organization** - Organize by feature, module, or any structure that makes sense
|
|
274
|
+
|
|
275
|
+
Simply place `AI_README.md` files at different folder levels:
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
my-monorepo/
|
|
279
|
+
βββ AI_README.md # Root-level conventions (applies to all)
|
|
280
|
+
βββ apps/
|
|
281
|
+
β βββ frontend/
|
|
282
|
+
β β βββ AI_README.md # Frontend-specific conventions
|
|
283
|
+
β β βββ src/components/Button.tsx
|
|
284
|
+
β βββ backend/
|
|
285
|
+
β βββ AI_README.md # Backend-specific conventions
|
|
286
|
+
β βββ src/api/users.ts
|
|
287
|
+
βββ packages/
|
|
288
|
+
βββ shared/
|
|
289
|
+
βββ AI_README.md # Shared library conventions
|
|
290
|
+
βββ src/utils.ts
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Smart Empty README Handling:**
|
|
294
|
+
- π If you create an empty `AI_README.md` in a subdirectory, the tool can auto-fill it with relevant conventions
|
|
295
|
+
- π For subdirectories with parent READMEs, generates differential content (only module-specific conventions)
|
|
296
|
+
- π For root directories, generates full project analysis
|
|
297
|
+
- Ask your AI: "This AI_README.md is empty, can you help fill it?"
|
|
298
|
+
|
|
299
|
+
When AI works on a file, it automatically gets:
|
|
300
|
+
- The **most relevant** AI_README (closest parent directory)
|
|
301
|
+
- Plus the **root-level** AI_README (for project-wide standards)
|
|
302
|
+
|
|
303
|
+
For example, when editing `apps/frontend/src/components/Button.tsx`:
|
|
304
|
+
- β
Gets `apps/frontend/AI_README.md` (React component standards)
|
|
305
|
+
- β
Gets root `AI_README.md` (project-wide Git, testing conventions)
|
|
306
|
+
|
|
247
307
|
### Test the Integration
|
|
248
308
|
|
|
249
|
-
Restart
|
|
309
|
+
Restart your IDE, then ask your AI assistant:
|
|
250
310
|
|
|
251
311
|
> "I'm about to create a new component. What conventions should I follow?"
|
|
252
312
|
|
|
253
|
-
|
|
313
|
+
The AI will automatically retrieve your AI_README context!
|
|
254
314
|
|
|
255
315
|
For detailed setup instructions, see [Quick Start Guide](./docs/QUICK_START.md).
|
|
256
316
|
|
|
@@ -307,10 +367,64 @@ npm run dev
|
|
|
307
367
|
- **[Quick Start Guide](./docs/QUICK_START.md)** - Get started in 10 minutes
|
|
308
368
|
- **[Contributing Guide](./CONTRIBUTING.md)** - How to contribute
|
|
309
369
|
- [Project Specification](./docs/SPEC.md) - Complete technical specification
|
|
310
|
-
- [AI_README Templates](./docs/templates/) - Example templates for your projects
|
|
311
370
|
|
|
312
371
|
## π οΈ Available MCP Tools
|
|
313
372
|
|
|
373
|
+
### `init_ai_readme`
|
|
374
|
+
|
|
375
|
+
Initialize a new AI_README.md file with smart content generation based on project analysis.
|
|
376
|
+
|
|
377
|
+
```typescript
|
|
378
|
+
// Parameters
|
|
379
|
+
{
|
|
380
|
+
targetPath: string; // Required: Directory where AI_README.md will be created
|
|
381
|
+
projectName?: string; // Optional: Project name (auto-detected if not provided)
|
|
382
|
+
overwrite?: boolean; // Optional: Overwrite existing file (default: false)
|
|
383
|
+
smart?: boolean; // Optional: Enable smart content generation (default: true)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Returns
|
|
387
|
+
{
|
|
388
|
+
success: boolean;
|
|
389
|
+
readmePath: string;
|
|
390
|
+
action: 'created' | 'filled' | 'overwritten';
|
|
391
|
+
projectInfo?: {
|
|
392
|
+
projectName: string;
|
|
393
|
+
projectType: 'library' | 'application' | 'monorepo' | 'unknown';
|
|
394
|
+
language: string;
|
|
395
|
+
framework?: string;
|
|
396
|
+
packageManager?: string;
|
|
397
|
+
hasTests: boolean;
|
|
398
|
+
mainDirs: string[];
|
|
399
|
+
};
|
|
400
|
+
message: string;
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
**Smart Mode Features**:
|
|
405
|
+
- Auto-detects project type, language, and framework
|
|
406
|
+
- Generates framework-specific conventions (React, Vue, Python, etc.)
|
|
407
|
+
- For subdirectories with parent READMEs, generates differential content
|
|
408
|
+
- Handles empty files (< 50 chars) by auto-filling them
|
|
409
|
+
- Analyzes directory structure and dependencies
|
|
410
|
+
|
|
411
|
+
**Example Usage**:
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
// Create smart README for React project
|
|
415
|
+
{
|
|
416
|
+
targetPath: "/path/to/react-app",
|
|
417
|
+
smart: true
|
|
418
|
+
}
|
|
419
|
+
// Result: Auto-detects React, generates component naming conventions, etc.
|
|
420
|
+
|
|
421
|
+
// Fill empty subdirectory README
|
|
422
|
+
{
|
|
423
|
+
targetPath: "/path/to/monorepo/apps/frontend"
|
|
424
|
+
}
|
|
425
|
+
// Result: Generates differential content extending root README
|
|
426
|
+
```
|
|
427
|
+
|
|
314
428
|
### `discover_ai_readmes`
|
|
315
429
|
|
|
316
430
|
Scans your project and discovers all AI_README.md files.
|
|
@@ -433,44 +547,71 @@ Update an AI_README.md file with specified operations.
|
|
|
433
547
|
}
|
|
434
548
|
```
|
|
435
549
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
550
|
+
### `validate_ai_readmes`
|
|
551
|
+
|
|
552
|
+
Validate all AI_README.md files in your project for quality and token efficiency.
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
// Parameters
|
|
556
|
+
{
|
|
557
|
+
projectRoot: string; // Required: Project root directory
|
|
558
|
+
excludePatterns?: string[]; // Optional: Glob patterns to exclude
|
|
559
|
+
config?: { // Optional: Custom validation config
|
|
560
|
+
maxTokens?: number;
|
|
561
|
+
rules?: {
|
|
562
|
+
requireH1?: boolean;
|
|
563
|
+
requireSections?: string[];
|
|
564
|
+
allowCodeBlocks?: boolean;
|
|
565
|
+
maxLineLength?: number;
|
|
566
|
+
};
|
|
567
|
+
tokenLimits?: {
|
|
568
|
+
excellent?: number; // Default: 200
|
|
569
|
+
good?: number; // Default: 400
|
|
570
|
+
warning?: number; // Default: 600
|
|
571
|
+
error?: number; // Default: 1000
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// Returns
|
|
577
|
+
{
|
|
578
|
+
valid: boolean;
|
|
579
|
+
totalFiles: number;
|
|
580
|
+
results: Array<{
|
|
581
|
+
path: string;
|
|
582
|
+
valid: boolean;
|
|
583
|
+
tokens: number;
|
|
584
|
+
rating: 'excellent' | 'good' | 'needs-improvement' | 'too-long';
|
|
585
|
+
issues: string[];
|
|
586
|
+
suggestions: string[];
|
|
587
|
+
}>;
|
|
588
|
+
summary: string;
|
|
589
|
+
}
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
**Validation Features**:
|
|
593
|
+
- Token counting for AI consumption optimization
|
|
594
|
+
- Structure validation (H1 heading, sections)
|
|
595
|
+
- Line length checks (default: 100 chars)
|
|
596
|
+
- Code block detection (disabled by default for strict mode)
|
|
597
|
+
- Quality ratings based on token count
|
|
598
|
+
|
|
599
|
+
**Default Token Limits (Strict Mode)**:
|
|
600
|
+
- π Excellent: < 200 tokens
|
|
601
|
+
- β
Good: < 400 tokens
|
|
602
|
+
- β οΈ Needs improvement: < 600 tokens
|
|
603
|
+
- β Too long: > 1000 tokens
|
|
604
|
+
|
|
605
|
+
## π What's Next
|
|
606
|
+
|
|
607
|
+
We're actively working on new features:
|
|
608
|
+
|
|
609
|
+
- **Watch Mode** - Auto-sync changes when AI_README files are modified
|
|
610
|
+
- **Performance Optimization** - Caching and incremental updates
|
|
611
|
+
- **VSCode Extension** - Visual interface for managing AI_README files
|
|
612
|
+
- **CI/CD Integration** - GitHub Actions for automated README validation
|
|
613
|
+
|
|
614
|
+
Want to contribute? Check out our [Contributing Guide](./CONTRIBUTING.md)!
|
|
474
615
|
|
|
475
616
|
## π€ Contributing
|
|
476
617
|
|
|
@@ -493,4 +634,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
493
634
|
|
|
494
635
|
---
|
|
495
636
|
|
|
496
|
-
**Status:**
|
|
637
|
+
**Status:** β
Published | **Version:** 0.3.0 | **Last Updated:** 2025-11-08
|