# file [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/rog0x/mcp-file-tools  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/file

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

## Tools
Capabilities this server exposes over MCP:

- **dir_tree** — Generate a visual directory tree structure with configurable depth and ignore patterns
- **file_stats** — Analyze a directory: total files, size breakdown by extension, largest/newest/oldest files
- **duplicate_finder** — Find duplicate files by size + MD5 hash, report wasted space
- **code_counter** — Count lines of code by language: code, comments, and blank lines (like cloc/scc)
- **file_search** — Search files by name glob, content regex, size range, and date range

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What file does

The file MCP server provides directory inspection and analysis tools for local file systems. It does not present a general-purpose file editing interface; its documented capabilities focus on understanding directory structure, file composition, duplicate data, source-code volume, and search matches.

`dir_tree` produces a visual hierarchy for a directory. You can limit traversal depth and provide ignore patterns, which helps keep generated or vendor directories out of the result. `file_stats` reports the number and total size of files, groups files by extension, and identifies the largest, newest, and oldest entries.

The remaining tools cover specialized analysis. `duplicate_finder` groups files that have matching sizes and MD5 hashes, then reports the paths, sizes, and estimated wasted space. `code_counter` separates code, comment, and blank lines for more than 20 listed languages. `file_search` combines glob-based name matching, content regular expressions, byte-size limits, and modification-date filters.

## How it works

Each operation receives an absolute directory path and optional traversal or filtering parameters. Traversal limits prevent an operation from scanning deeper than needed. The default maximum depth is 5 for `dir_tree` and 10 for the other directory-oriented tools; a depth of 0 gives `dir_tree` unlimited traversal.

Duplicate detection first uses file size as a pre-filter and then applies MD5 hashing to identify matching files. Code counting recognizes TypeScript, JavaScript, Python, Java, C and C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, HTML, CSS, JSON, YAML, Markdown, Shell, SQL, and Lua. Search results can be capped with `max_results`, which defaults to 100.

## Setup and configuration

Clone the repository, install its npm dependencies, and compile the project:

```bash
git clone https://github.com/rog0x/mcp-file-tools.git
cd mcp-file-tools
npm install
npm run build
```

The resulting Node.js entry point is `dist/index.js`. Register that file with an MCP client using an absolute path. For Claude Code, the documented command is:

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

Claude Desktop uses the same command and script path in its `claude_desktop_config.json` MCP server configuration.

## Tools and capabilities

- `dir_tree`: renders a directory tree with configurable depth and ignored patterns.
- `file_stats`: summarizes counts, total size, extensions, and selected file timestamps and sizes.
- `duplicate_finder`: finds duplicate groups and calculates wasted space.
- `code_counter`: reports code, comment, and blank lines by supported language.
- `file_search`: filters files by glob, content regex, size, modification date, and result count.

## Limitations and notes

The file MCP server requires directory paths and is intended for local directory analysis. The documented interface does not describe file-writing, deletion, or other mutation tools. Results depend on the selected traversal depth and filters, so a limited scan may omit files outside those parameters. Duplicate identification is based on size followed by MD5 hashing, while content search uses a regular expression supplied by the caller.

_Full upstream README: https://allmcps.com/mcp/file/readme_

