auto-doc-sync-mcp
v1.1.1
Published
MCP Server for automatic documentation synchronization - AI context management for any codebase with multi-dev coordination
Maintainers
Readme
Auto-Doc-Sync MCP Server
Tự động đồng bộ documentation cho mọi dự án - Giúp team tránh conflicts và hiểu context codebase ngay lập tức.
🎯 Tính Năng
Documentation Sync
- ✅ Tự động cập nhật CHANGES.md sau mỗi commit
- ✅ Tạo AI Context (CONTEXT.md) với phân loại thay đổi
- ✅ Module docs chi tiết cho từng module
- ✅ Deduplication - Không bị trùng lặp
- ✅ Dependency warnings - Cảnh báo khi cần install packages
- ✅ Multi-language - Hỗ trợ Flutter, Node.js, Python, Ruby, Go
- ✨ AI Prompts - Auto-generate prompts theo tech stack (BE/FE/Mobile)
🆕 Multi-Dev Coordination (NEW!)
- 🔴 Real-time WIP Tracking - Biết ai đang edit file nào
- 🛡️ Conflict Detection - Check conflict TRƯỚC khi edit
- 📡 Remote Sync Checker - Phát hiện thay đổi từ remote chưa pull
- 👥 Session Management - Quản lý Claude sessions đang active
- 🧹 Auto Cleanup - Tự động dọn sessions cũ
📖 Chi tiết: Xem MULTI_DEV_COORDINATION.md
📦 Cài Đặt
1. Cài MCP Server
npm install -g auto-doc-sync-mcp2. Cấu Hình Claude Desktop
Thêm vào ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"auto-doc-sync": {
"command": "auto-doc-sync-mcp"
}
}
}3. Restart Claude Desktop
Restart Claude Desktop để load MCP server.
🚀 Sử Dụng
Bước 1: Install vào Project
Trong Claude Code, chạy:
User: Install auto-doc-sync vào project này
Claude sẽ tự động:
1. Detect project type (Flutter, Node.js, etc.)
2. Tạo .claude/hooks/auto-doc-sync/auto-doc-sync.js
3. Install git post-commit hook
4. Tạo CHANGES.md, docs/CONTEXT.md, docs/modules/Bước 2: Test Hook
Tạo một commit bất kỳ:
git add .
git commit -m "test: verify auto-doc-sync"Hook sẽ tự động chạy và cập nhật:
- ✅ CHANGES.md
- ✅ docs/CONTEXT.md
- ✅ docs/modules/*.md
Bước 3: Sync với Team
Sau khi git pull, chạy:
User: /sync
Claude sẽ hiển thị:
- Recent changes (last 24h)
- Breaking changes
- Active modules
- Dependencies cần update🛠️ MCP Tools Available
1. install
Cài đặt auto-doc-sync vào project
User: Install auto-doc-sync vào /path/to/projectParameters:
project_path(required): Đường dẫn đến project rootauto_detect(optional): Auto-detect project type (default: true)
2. sync
Xem recent changes và team activity
User: Sync project documentation
User: Sync widgets moduleParameters:
project_path(required): Project root pathmodule(optional): Module cụ thể để deep dive
3. configure_modules
Cấu hình custom module detection rules
User: Configure modules với rules:
- core-* cho lib/core/*
- widgets cho lib/features/widgets/*Parameters:
project_path(required)module_rules(required): Array of {name, pattern}
4. deduplicate
Dọn dẹp duplicate entries
User: Deduplicate documentation
User: Deduplicate CHANGES.md onlyParameters:
project_path(required)target(optional): 'all', 'changes', 'modules' (default: 'all')
5. run_hook
Chạy hook manually (không cần commit)
User: Run auto-doc-sync hook manually6. check_conflicts 🆕
Kiểm tra conflict trước khi edit file
User: Check conflicts cho file lib/auth/login.dartParameters:
project_path(required): Project root pathfile_path(required): File cần check
Checks:
- WIP conflicts (Claude sessions khác đang edit)
- Remote changes (file thay đổi trên remote chưa pull)
- Local uncommitted changes
7. list_sessions 🆕
Xem tất cả Claude sessions đang active
User: List active Claude sessionsParameters:
project_path(required)include_stale(optional): Include sessions inactive >30 phút
8. register_session 🆕
Đăng ký session hiện tại để tracking
User: Register session với description "Implementing auth feature"Parameters:
project_path(required)working_on(optional): Mô tả công việc đang làm
9. cleanup_sessions 🆕
Dọn dẹp sessions cũ/stale
User: Cleanup stale sessions10. end_session 🆕
Kết thúc session hiện tại
User: End my Claude session📚 MCP Resources Available
Tự động expose documentation files:
CHANGES.md- Global changelogdocs/CONTEXT.md- AI contextdocs/modules/*.md- Module-specific docs
Claude có thể đọc các files này trực tiếp qua MCP resources.
🤖 MCP Prompts Available
Auto-generated prompts theo tech stack của project:
4 prompts tự động customize dựa trên Flutter/Node.js/Python/Ruby/Go:
sync-and-review- Xem changes + recommendations tránh conflictsUser: Use prompt sync-and-reviewonboarding-guide- Tạo hướng dẫn onboarding cho dev mớiUser: Use prompt onboarding-guidetech-stack-analysis- Best practices cho tech stack hiện tạiUser: Use prompt tech-stack-analysismodule-coordination- Check module nào cần coordinateUser: Use prompt module-coordination for widgets
Tất cả prompts tự động:
- ✅ Detect tech stack (Flutter, Node.js, Python, etc.)
- ✅ Read CONTEXT.md để hiểu current state
- ✅ Generate language-specific best practices
- ✅ Output bằng Tiếng Việt cho team
📖 Chi tiết: Xem PROMPTS.md
🎨 Workflow Thực Tế
Kịch Bản 1: Dev Bắt Đầu Làm Feature Mới
1. Dev: git pull
2. Hook tự động update docs
3. Dev: /sync
4. Claude hiển thị:
- widgets module: 19 commits - High activity
- Breaking changes: None
- Dependencies: No updates needed
5. Dev: "Widgets module đang hot, tôi nên hỏi team trước"Kịch Bản 2: Review Code Sau Pull
1. Dev: git pull origin main
2. Hook update docs
3. Dev: /sync widgets
4. Claude show:
- Recent changes in widgets module
- Files affected
- Who made changes
5. Dev biết chính xác widgets module vừa thay đổi gìKịch Bản 3: Dependencies Update
1. Dev A commits pubspec.yaml changes
2. Hook detects dependency update
3. CHANGES.md shows: ⚠️ Dependencies updated - Run: flutter pub get
4. Dev B pulls code
5. Dev B: /sync
6. Claude warns: "Dependencies changed, run flutter pub get"
7. Dev B: flutter pub get🔧 Supported Project Types
- Flutter: Detects
pubspec.yaml, tracks modules inlib/ - Node.js: Detects
package.json, trackssrc/,lib/ - Python: Detects
requirements.txt, tracks modules - Ruby: Detects
Gemfile - Go: Detects
go.mod - Generic: Works with any Git project
📖 Output Examples
CHANGES.md
# Changes Log
## 2026-01-30
- **2a42b28** by Nguyen Huu Nhan (0 seconds ago)
📌 Branch: `main`
feat(docs): improve CONTEXT.md with comprehensive AI context
📦 Modules: `other`
Files: auto-doc-sync.js, CONTEXT.md
- **e1ca242** by Nguyen Huu Nhan (1 minute ago)
📌 Branch: `main`
test: verify library update detection
📦 Modules: `other`
⚠️ **Dependencies updated** - Run: `flutter pub get`
Files: pubspec.yamldocs/CONTEXT.md
# Project Context
**Auto-generated AI Context** - Last updated: 2026-01-30T06:57:10.793Z
## 🎯 Recent Changes Summary (Last 24h)
### ✨ New Features (1)
- **2a42b28**: feat(docs): improve CONTEXT.md with comprehensive AI context
- Affects: other
## 📊 Module Activity Analysis
### widgets
- **19 commit(s)** in last 24h
- **19 file(s)** changed
- ⚠️ **Updated**: Check [widgets.md](../modules/widgets.md) for latest changes
**Recent changes:**
- update code base (bda0ab7)
**Key files modified:**
- lib/features/widgets/buttons/primary_button.dart
- lib/features/widgets/cards/info_card.dart
- ... and 14 more
## 🤖 AI Context & Recommendations
### What AI Should Know:
1. **Activity Level**: 12 commit(s) in last 24h
2. **Most Active Modules**:
- `widgets`: 19 commits - **High activity, coordinate before changes**
### Before You Code:
1. Check recent changes in modules you'll modify
2. Coordinate with team on highly active modules🎯 Benefits
For Developers
- ✅ Biết ngay module nào đang hot → tránh conflicts
- ✅ Thấy dependencies updates → không bị build errors
- ✅ Hiểu context nhanh → onboard dễ dàng
For Teams
- ✅ Transparency: Ai làm gì, ở đâu
- ✅ Coordination: Biết module nào cần phối hợp
- ✅ History: Track changes chi tiết
For AI Assistants
- ✅ Comprehensive context về codebase state
- ✅ Breaking changes highlighted
- ✅ Module dependencies rõ ràng
🐛 Troubleshooting
Hook không chạy sau commit?
# Check git hook exists
ls -la .git/hooks/post-commit
# Make it executable
chmod +x .git/hooks/post-commit
# Test manually
node .claude/hooks/auto-doc-sync/auto-doc-sync.jsDuplicate entries?
User: Deduplicate all documentationCustom modules không detect?
User: Configure modules với custom rules📝 License
MIT
🤝 Contributing
PRs welcome! Đây là MCP server được extract từ Construction Project - một hệ thống đã tested và proven to work.
