File

io.github.rog0x由 GitHub 帳號 rog0x 發布v1.0.1更新於 Oct 24, 2026

Dir tree, file stats, duplicates, LOC for AI agents

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

讓助理檢查本機目錄:目錄樹、檔案統計、重複檔案偵測、程式碼行數統計與檔案搜尋。

可以做什麼
這個本機 MCP 伺服器提供五個唯讀的檔案系統分析工具。dir_tree 產生視覺化目錄樹,可設定深度與忽略規則;file_stats 彙總目錄內容,包括檔案總數、依副檔名的大小分布,以及最大、最新與最舊的檔案。duplicate_finder 以大小與 MD5 雜湊找出重複檔案並回報浪費空間,code_counter 統計 20 多種語言的程式碼、註解與空白行,file_search 依檔名萬用字元、內容正規表示式、大小與修改日期尋找檔案。
適用情境
適合助理需要了解程式碼庫或資料夾結構、檢視磁碟用量、尋找重複檔案、依語言統計專案規模,或依名稱、內容、日期定位檔案而不必手動執行命令列指令的情況。
執行需求
以 npm 套件(@rog0x/mcp-file-tools)透過 stdio 在本機執行,需要 Node.js;README 說明需複製儲存庫、執行 npm install 與 npm run build,然後在用戶端設定中以絕對路徑註冊建置產物 dist/index.js。僅限桌面端;未宣告驗證、環境變數或標頭。
安裝前請注意
工具會讀取本機檔案與目錄內容,包括用於正規表示式搜尋與雜湊的檔案內容,因此結果可能向助理暴露敏感路徑或資料。此伺服器為唯讀,不會修改、移動或刪除檔案。目錄路徑以絕對路徑傳入,應謹慎限定存取範圍。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 File,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@rog0x/mcp-file-tools

MCP server providing file and directory analysis tools for AI agents. Gives Claude (and other MCP-compatible AI) the ability to explore, analyze, and search file systems.

Tools

ToolDescription
dir_treeGenerate a visual directory tree structure with configurable depth and ignore patterns
file_statsAnalyze a directory: total files, size breakdown by extension, largest/newest/oldest files
duplicate_finderFind duplicate files by size + MD5 hash, report wasted space
code_counterCount lines of code by language: code, comments, and blank lines (like cloc/scc)
file_searchSearch files by name glob, content regex, size range, and date range

Installation

bash
git clone https://github.com/rog0x/mcp-file-tools.gitcd mcp-file-toolsnpm installnpm run build

Configuration

Claude Code

bash
claude mcp add mcp-file-tools node /absolute/path/to/mcp-file-tools/dist/index.js

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "mcp-file-tools": {      "command": "node",      "args": ["/absolute/path/to/mcp-file-tools/dist/index.js"]    }  }}

Tool Details

dir_tree

Generate a visual directory tree like the tree command.

Parameters:  dir_path (required)     - Absolute path to the directory  max_depth (optional)    - Max depth to traverse (default: 5, 0 = unlimited)  ignore_patterns (optional) - Patterns to ignore (default: node_modules, .git, dist, etc.)

file_stats

Get a comprehensive analysis of a directory's contents.

Parameters:  dir_path (required)     - Absolute path to the directory  max_depth (optional)    - Max depth to traverse (default: 10)

Returns: total files, total size, file counts by extension, top 10 largest files, top 10 newest/oldest files.

duplicate_finder

Find duplicate files using size pre-filtering and MD5 hashing.

Parameters:  dir_path (required)     - Absolute path to the directory  min_size (optional)     - Minimum file size in bytes (default: 1)  max_depth (optional)    - Max depth to traverse (default: 10)

Returns: duplicate groups with file paths, sizes, and total wasted space.

code_counter

Count lines of code across 20+ languages with comment detection.

Parameters:  dir_path (required)     - Absolute path to the directory  max_depth (optional)    - Max depth to traverse (default: 10)

Supported languages: TypeScript, JavaScript, Python, Java, C/C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, HTML, CSS, JSON, YAML, Markdown, Shell, SQL, Lua.

file_search

Search for files using multiple criteria simultaneously.

Parameters:  dir_path (required)        - Absolute path to the directory  name_pattern (optional)    - Glob pattern (e.g. "**/*.ts")  content_pattern (optional) - Regex to search file contents  min_size (optional)        - Minimum file size in bytes  max_size (optional)        - Maximum file size in bytes  modified_after (optional)  - ISO date string  modified_before (optional) - ISO date string  max_results (optional)     - Max results (default: 100)

License

MIT

來源:README.md,提交 c917eca

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分