File logo

File

Analyzes directories with tree views, file statistics, duplicate detection, code counts, and flexible file search.

Install File

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for file, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The file MCP server lets AI agents inspect and analyze local file systems through five MCP tools. It generates directory trees, summarizes file statistics, detects duplicates, counts code lines across 20+ languages, and searches by name, content, size, or modification date. Install it locally with npm, build the project, and register its Node.js entry point with an MCP-compatible client. Reach for it when an agent needs structured visibility into a directory without manually browsing files.

Use cases

  • Inspect a repository structure while excluding generated directories
  • Find duplicate files and estimate recoverable disk space
  • Measure code, comment, and blank lines by language
  • Search project files by content, size, or modification date

Key features

  • Configurable directory tree generation
  • File counts and size analysis by extension
  • Duplicate detection with MD5 hashing
  • Code metrics for 20+ languages
  • Multi-criteria file search

Tools5

What File lets your agent do. Expand a tool for its parameters.

Self-reported~110 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit7mo agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.

How File works

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:

Terminal
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.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about File

file is an MCP server that connects AI agents to local file systems for directory analysis. Its main tools generate directory trees, report file statistics, find duplicates with size and MD5 checks, count code lines across supported languages, and search files by names, content, size, or modification dates.

Install it by cloning the repository, running npm install, and running npm run build. Then register the absolute path to dist/index.js with your MCP client using Node.js.

Yes, file works with Claude Desktop through its MCP configuration file. Add a server entry that uses node as the command and the absolute path to dist/index.js as its argument, then use the built project as the configured server.

It first compares file sizes and then uses MD5 hashing to identify matching files. The duplicate finder accepts a directory, minimum file size, and maximum traversal depth, and returns duplicate groups with paths, sizes, and total wasted space.

Yes, it counts Python and TypeScript lines, along with code, comments, and blanks. The code counter supports more than 20 languages, including JavaScript, Go, Rust, Java, C/C++, C#, Ruby, PHP, Swift, Kotlin, HTML, CSS, JSON, YAML, Markdown, Shell, SQL, and Lua.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFile AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/file?style=directory)](https://allmcps.com/mcp/file)
HTML Embed
<a href="https://allmcps.com/mcp/file"><img src="https://allmcps.com/api/badge/file?style=directory" alt="File on AllMCPs" /></a>