You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 316ac11
Browse filesBrowse the repository at this point in the historyBrowse files
feat(filesystem): ignore dot directories by default to reduce token usage
- Add environment variable MCP_FILESYSTEM_INCLUDE_HIDDEN (default: false)
- Filter dot-prefixed files/directories in list_directory, directory_tree, search_files
- Reduces token usage from large directories like .git, .terraform, etc.
- Enhances security by avoiding exposure of potentially sensitive hidden files
- Includes comprehensive tests for the new filtering functionality
- Update documentation to explain the new behavior and environment variable
Fixesmodelcontextprotocol#2219
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Ola Hungerford <[email protected]>
Copy file name to clipboardExpand all lines: src/filesystem/README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,20 @@ Node.js server implementing Model Context Protocol (MCP) for filesystem operatio
15
15
16
16
The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots).
17
17
18
+
### Hidden Files and Directories
19
+
20
+
By default, the filesystem server **ignores dot-prefixed files and directories** (like `.git`, `.env`, `.terraform`, etc.) to:
21
+
- Reduce token usage (especially from large directories like `.git`)
22
+
- Enhance security by avoiding exposure of potentially sensitive hidden files
23
+
- Follow the convention that dot-prefixed items are typically "hidden" for good reason
24
+
25
+
To include hidden files and directories, set the environment variable:
26
+
```bash
27
+
export MCP_FILESYSTEM_INCLUDE_HIDDEN=true
28
+
```
29
+
30
+
This affects the following operations: `list_directory`, `list_directory_with_sizes`, `directory_tree`, and `search_files`.
31
+
18
32
### Method 1: Command-line Arguments
19
33
Specify Allowed directories when starting the server:
0 commit comments