Securely Control Filesystem Access for AI Clients
Filesystem MCP server that blocks AI access to sensitive files and directories using .gitignore-style .mcpignore rules.
Why it matters
Grant AI clients controlled access to your filesystem, ensuring sensitive data remains protected. This asset enforces access policies using .mcpignore files, similar to .gitignore, for granular security.
Outcomes
What it gets done
Define filesystem access rules with .mcpignore files.
Allow AI clients to read, write, and list files within permitted directories.
Prevent unauthorized access to sensitive files and directories.
Enable secure file searching and metadata retrieval.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-mcpignore-filesytem | bash Capabilities
Tools your agent gets
Read file contents with security restrictions for ignored paths
Read contents of multiple files with access control for ignored paths
Write file contents with security restrictions for ignored paths
Edit file contents with access control for ignored paths
Create directories with permission checks for ignored paths
List directory contents with access control for ignored paths
Get directory tree structure with file names only for security
Move files and directories with permission checks for ignored paths
Overview
MCPIgnore Filesystem MCP Server
MCPIgnore Filesystem is a security-focused filesystem MCP server that blocks AI clients from reading, writing, or listing files matched by .gitignore-style .mcpignore rules, while still allowing standard filesystem operations elsewhere. Use it when granting an AI assistant filesystem access while needing to exclude sensitive paths like secrets or credentials. Not needed if unrestricted filesystem access is acceptable.
What it does
MCPIgnore Filesystem is a security-focused filesystem MCP server that restricts what files and directories an MCP client (Claude, Cline, Cursor) can read, write, or modify, using .mcpignore files with the same pattern syntax as .gitignore. It provides standard filesystem operations while enforcing these access restrictions on every call.
When to use - and when NOT to
Use it when you want to give an AI assistant filesystem access to a project or directory while explicitly excluding sensitive paths - secrets, credentials, .env files, or other data you don't want exposed to the model. Create a .mcpignore file in each allowed directory using .gitignore-style patterns to define what's off-limits. Do not use it if you need unrestricted filesystem access with no exclusion layer - a plain filesystem MCP server would suffice in that case; this server exists specifically to add a protective boundary.
Capabilities
read_file,read_multiple_files,write_file,edit_file,create_directory,list_directory,move_file,get_file_info- all blocked for any path matching.mcpignorerules.directory_treeandsearch_files- allowed, but restricted to returning file names only, without exposing file content for ignored paths.list_allowed_directories- lists the directories the server is configured to operate within.
How to install
npx -y @cyberhaven/mcpignore-filesystem /Users/<username>/Desktop /path/to/other/allowed/dir
Register with an MCP client (Claude, Cline, Cursor):
{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": [
"-y",
"@cyberhaven/mcpignore-filesystem",
"/Users/<username>/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
Create a .mcpignore file (using .gitignore syntax) inside each allowed directory to define which files and subpaths are blocked from the MCP client.
Who it's for
Developers and security-conscious teams who want to grant an AI assistant filesystem access to a project directory while guaranteeing sensitive files (secrets, credentials, private data) stay out of reach.
Source README
A security-focused filesystem MCP server that uses .mcpignore files to control MCP client access to files and directories, protecting sensitive data while providing filesystem operations.
Installation
NPX
npx -y @cyberhaven/mcpignore-filesystem /Users/<username>/Desktop /path/to/other/allowed/dir
Configuration
MCP Clients (Claude/Cline/Cursor)
{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": [
"-y",
"@cyberhaven/mcpignore-filesystem",
"/Users/<username>/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
Available Tools
| Tool | Description |
|---|---|
read_file |
Read file contents (blocked for ignored paths) |
read_multiple_files |
Read contents of multiple files (blocked for ignored paths) |
write_file |
Write file contents (blocked for ignored paths) |
edit_file |
Edit file contents (blocked for ignored paths) |
create_directory |
Create directories (blocked for ignored paths) |
list_directory |
List directory contents (blocked for ignored paths) |
directory_tree |
Get directory tree structure (allowed for file names only) |
move_file |
Move files/directories (blocked for ignored paths) |
search_files |
Search files (allowed for file names only) |
get_file_info |
Get file metadata (blocked for ignored paths) |
list_allowed_directories |
List allowed directories |
Features
- MCP client filesystem access control based on .mcpignore
- File read/write with security restrictions
- Directory creation/listing/deletion with access control
- File/directory movement with permission checks
- File search with sensitive data protection
- File metadata retrieval with security filtering
- Uses .gitignore-style patterns for access control
Notes
Create a .mcpignore file for each directory specified via arguments. The .mcpignore file uses the same patterns as .gitignore. Some tools, such as directory_tree and search_files, are allowed only for retrieving file names, blocking access to sensitive content.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.