Skip to content

Commit 8c2f5c6

Browse files
committed
feat: Add real-time monitoring and auto-refresh capabilities to file watcher documentation
1 parent 3e6ff5a commit 8c2f5c6

File tree

3 files changed

+69
-3
lines changed

3 files changed

+69
-3
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ Code Index MCP is a [Model Context Protocol](https://modelcontextprotocol.io) se
4141
- **Others**: Lua, Perl, R, MATLAB, configuration files
4242
- **50+ File Types Total** - [View complete list](#supported-file-types)
4343

44+
### **Real-time Monitoring & Auto-refresh**
45+
- **File Watcher**: Automatic index updates when files change
46+
- **Cross-platform**: Native OS file system monitoring (inotify, FSEvents, ReadDirectoryChangesW)
47+
- **Smart Debouncing**: Batches rapid changes to prevent excessive rebuilds (default: 6 seconds)
48+
- **Thread-safe**: Non-blocking background operations with ThreadPoolExecutor
49+
4450
### **Performance & Efficiency**
4551
- **Smart Indexing**: Recursively scans with intelligent filtering of build directories
4652
- **Persistent Caching**: Stores indexes for lightning-fast subsequent access
@@ -128,7 +134,7 @@ Code Index MCP is a [Model Context Protocol](https://modelcontextprotocol.io) se
128134

129135
The easiest way to get started with any MCP-compatible application:
130136

131-
**Prerequisites:** Python 3.10+ and [uv](https://github.com/astral-sh/uv) installed
137+
**Prerequisites:** Python 3.10+, [uv](https://github.com/astral-sh/uv), and [watchdog](https://pypi.org/project/watchdog/) for file monitoring
132138

133139
1. **Add to your MCP configuration** (e.g., `claude_desktop_config.json` or `~/.claude.json`):
134140
```json
@@ -211,6 +217,12 @@ Then configure:
211217
| **`find_files`** | Locate files using glob patterns (e.g., `**/*.py`) |
212218
| **`get_file_summary`** | Analyze file structure, functions, imports, and complexity |
213219

220+
### 🔄 **Monitoring & Auto-refresh**
221+
| Tool | Description |
222+
|------|-------------|
223+
| **`get_file_watcher_status`** | Check file watcher status and configuration |
224+
| **`configure_file_watcher`** | Enable/disable auto-refresh and configure settings |
225+
214226
### 🛠️ **System & Maintenance**
215227
| Tool | Description |
216228
|------|-------------|
@@ -273,6 +285,16 @@ Search for "API_ENDPOINT" only in Python files
273285

274286
</details>
275287

288+
<details>
289+
<summary><strong>Auto-refresh Configuration</strong></summary>
290+
291+
```
292+
Configure automatic index updates when files change
293+
```
294+
*Uses: `configure_file_watcher` to enable/disable monitoring and set debounce timing*
295+
296+
</details>
297+
276298
<details>
277299
<summary><strong>Project Maintenance</strong></summary>
278300

README_ja.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ Code Index MCPは、AIモデルと複雑なコードベースの橋渡しをす
4141
- **その他の言語**:Lua、Perl、R、MATLAB、設定ファイル
4242
- **合計50+ファイルタイプ** - [完全なリストを表示](#サポートされているファイルタイプ)
4343

44+
### **リアルタイム監視・自動更新**
45+
- **ファイルウォッチャー**:ファイル変更時の自動インデックス更新
46+
- **クロスプラットフォーム**:ネイティブOS ファイルシステム監視 (inotify、FSEvents、ReadDirectoryChangesW)
47+
- **スマートデバウンス**:急速な変更をバッチ処理して過度な再構築を防止(デフォルト:6秒)
48+
- **スレッドセーフ**:ThreadPoolExecutor による非ブロッキングバックグラウンド操作
49+
4450
### **パフォーマンス・効率性**
4551
- **スマートインデックス作成**:ビルドディレクトリをインテリジェントにフィルタリングしながら再帰的スキャン
4652
- **永続キャッシュ**:超高速な後続アクセスのためのインデックス保存
@@ -128,7 +134,7 @@ Code Index MCPは、AIモデルと複雑なコードベースの橋渡しをす
128134

129135
任意のMCP対応アプリケーションで開始する最も簡単な方法:
130136

131-
**前提条件:** Python 3.10+[uv](https://github.com/astral-sh/uv) がインストール済み
137+
**前提条件:** Python 3.10+[uv](https://github.com/astral-sh/uv)、ファイル監視用の [watchdog](https://pypi.org/project/watchdog/) がインストール済み
132138

133139
1. **MCP設定に追加**(例:`claude_desktop_config.json` または `~/.claude.json`):
134140
```json
@@ -211,6 +217,12 @@ pip install code-index-mcp
211217
| **`find_files`** | globパターンを使用したファイル検索(例:`**/*.py`|
212218
| **`get_file_summary`** | ファイル構造、関数、インポート、複雑度の解析 |
213219

220+
### 🔄 **監視・自動更新**
221+
| ツール | 説明 |
222+
|--------|------|
223+
| **`get_file_watcher_status`** | ファイルウォッチャーの状態と設定を確認 |
224+
| **`configure_file_watcher`** | 自動更新の有効化/無効化と設定の構成 |
225+
214226
### 🛠️ **システム・メンテナンス**
215227
| ツール | 説明 |
216228
|--------|------|
@@ -273,6 +285,16 @@ Pythonファイルのみで "API_ENDPOINT" を検索してください
273285

274286
</details>
275287

288+
<details>
289+
<summary><strong>自動更新設定</strong></summary>
290+
291+
```
292+
ファイル変更時の自動インデックス更新を設定してください
293+
```
294+
*使用ツール:`configure_file_watcher` で監視の有効化/無効化とデバウンス時間を設定*
295+
296+
</details>
297+
276298
<details>
277299
<summary><strong>プロジェクトメンテナンス</strong></summary>
278300

README_zh.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
- **其他語言**:Lua、Perl、R、MATLAB、配置檔案
4242
- **共 50+ 種檔案類型** - [查看完整列表](#支援的檔案類型)
4343

44+
### **即時監控與自動刷新**
45+
- **檔案監控器**:檔案變更時自動更新索引
46+
- **跨平台**:原生作業系統檔案系統監控 (inotify、FSEvents、ReadDirectoryChangesW)
47+
- **智慧防抖**:批次處理快速變更以防止過度重建(預設:6 秒)
48+
- **執行緒安全**:使用 ThreadPoolExecutor 進行非阻塞背景操作
49+
4450
### **效能與效率**
4551
- **智慧索引**:遞迴掃描並智慧篩選建構目錄
4652
- **持久快取**:儲存索引以實現超快速的後續存取
@@ -128,7 +134,7 @@
128134

129135
在任何相容 MCP 的應用程式中開始使用的最簡單方法:
130136

131-
**先決條件:** Python 3.10+[uv](https://github.com/astral-sh/uv) 已安裝
137+
**先決條件:** Python 3.10+[uv](https://github.com/astral-sh/uv) 和用於檔案監控的 [watchdog](https://pypi.org/project/watchdog/) 已安裝
132138

133139
1. **新增到您的 MCP 配置**(例如 `claude_desktop_config.json``~/.claude.json`):
134140
```json
@@ -211,6 +217,12 @@ pip install code-index-mcp
211217
| **`find_files`** | 使用萬用字元模式尋找檔案(例如 `**/*.py`|
212218
| **`get_file_summary`** | 分析檔案結構、函式、匯入和複雜度 |
213219

220+
### 🔄 **監控與自動刷新**
221+
| 工具 | 描述 |
222+
|------|------|
223+
| **`get_file_watcher_status`** | 檢查檔案監控器狀態和配置 |
224+
| **`configure_file_watcher`** | 啟用/停用自動刷新並配置設定 |
225+
214226
### 🛠️ **系統與維護**
215227
| 工具 | 描述 |
216228
|------|------|
@@ -273,6 +285,16 @@ pip install code-index-mcp
273285

274286
</details>
275287

288+
<details>
289+
<summary><strong>自動刷新配置</strong></summary>
290+
291+
```
292+
配置檔案變更時的自動索引更新
293+
```
294+
*使用:`configure_file_watcher` 啟用/停用監控並設定防抖時間*
295+
296+
</details>
297+
276298
<details>
277299
<summary><strong>專案維護</strong></summary>
278300

0 commit comments

Comments
 (0)