by CyberhavenInc
A data security-first filesystem MCP server that implements .mcpignore to prevent MCP clients from accessing sensitive data.
Filesystem-mcpignore is a Node.js server that extends the functionality of the standard Filesystem MCP Server. Its primary purpose is to enhance data security by allowing users to define which files and directories MCP (Model Context Protocol) clients can access using a .mcpignore
file. This is particularly useful for preventing AI models or other MCP clients from inadvertently accessing sensitive information on your filesystem.
To use filesystem-mcpignore, you need to configure your MCP client (e.g., Claude, Cline, Cursor) to use this server. The README provides examples of how to add the mcpignore-filesystem
server to your client's configuration file (e.g., claude_desktop_config.json
, cline_mcp_settings.json
, mcp.json
).
The core of its usage lies in creating .mcpignore
files within the directories you specify as arguments when running the server. These .mcpignore
files follow the same pattern matching rules as .gitignore
, allowing you to specify files or directories to be ignored.
Example NPX Configuration:
{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": [
"-y",
"@cyberhaven/mcpignore-filesystem",
"/Users/<username>/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
.mcpignore
Support: Control MCP client access to your filesystem based on patterns defined in .mcpignore
files.read_file
, write_file
, and create_directory
while allowing directory_tree
and search_files
for file name retrieval only.Q: What is the purpose of .mcpignore
?
A: The .mcpignore
file is used to define patterns for files and directories that MCP clients should not be able to access. It acts as a security filter.
Q: Does .mcpignore
work like .gitignore
?
A: Yes, the .mcpignore
file uses the same pattern matching rules as .gitignore
, making it familiar and easy to configure for developers.
Q: Which MCP client tools are supported? A: The project explicitly mentions support for Claude, Cline, and Cursor, with configuration examples provided for each.
Q: Can I allow some tools to see file names but not their content?
A: Yes, tools like directory_tree
and search_files
are allowed to retrieve file names even for ignored paths, but they are blocked from accessing the actual file content or performing write operations.
Q: Where should I create the .mcpignore
file?
A: You should create an .mcpignore
file for each directory that you specify as an argument when running the mcpignore-filesystem
server.
.mcpignore
supportProtect your most sensitive data by using this data security first filesystem. This node.js server builds on top of Filesystem MCP Server and lets you control which files your MCP Client can access using .mcpignore
file.
.mcpignore
Note: Create an .mcpignore
file for each direcoties specified via args
.mcpignore
The .mcpignore
file uses the same patterns as .gitignore
# Ignore specific file `.env`
.env
# Ignore all files with a `.safetensor` extension
*.safetensors
# Ignore specific directory, 'assets/logos' and its files
assets/logos/
For details, refer to Filesystem MCP Server API Spec
Tool | Behavior |
---|---|
read_file | Block |
read_multiple_files | Block |
write_file | Block |
edit_file | Block |
create_directory | Block |
list_directory | Block |
directory_tree | Allow |
move_file | Block |
search_files | Allow |
get_file_info | Block |
list_allowed_directories | N/A |
Note: directory_tree
and search_files
are allowed only to retrieve the file names
claude_desktop_config.json
cline_mcp_settings.json
mcp.json
Note: .mcpingore
applies to the list of allowed directories that you provide as args
{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": [
"-y",
"@cyberhaven/mcpignore-filesystem",
"/Users/<username>/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
This project is licensed under the MIT License. See LICENSE.
See CONTRIBUTING.md for information on contributing to this repository.
See SECURITY.md for information on security.
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by chaitin
Provides a self‑hosted web application firewall and reverse‑proxy that filters, monitors, and blocks malicious HTTP/S traffic, protecting web applications from attacks such as SQL injection, XSS, brute‑force, bot abuse, and various code injections.
by PortSwigger
Integrates Burp Suite with AI clients via the Model Context Protocol, providing a built‑in SSE server and a packaged Stdio proxy for seamless AI‑driven interaction with Burp.
by cycodehq
Boost security in the development lifecycle via static application security testing, software composition analysis, secrets detection, and infrastructure‑as‑code scanning.
by auth0
Auth0 MCP Server enables AI agents to manage Auth0 tenants using natural language, streamlining tasks like application and user management.
by ChristophEnglisch
keycloak-model-context-protocol is an MCP server implementation for Keycloak user management, enabling AI-powered administration of Keycloak users and realms through the Model Context Protocol (MCP).
by Spathodea-Network
OpenCTI MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with the OpenCTI (Open Cyber Threat Intelligence) platform, enabling querying and retrieving threat intelligence data through a standardized interface.
by mytechnotalent
Provides real-time threat intelligence and detailed malware sample metadata from Malware Bazaar through an AI‑driven MCP server, enabling authorized cybersecurity research workflows.
by kapilduraphe
This project provides an Okta MCP (Multi-Cloud Platform) server that enables Claude to interact with Okta's user management system, offering comprehensive user and group management capabilities along with onboarding automation.
by descope-sample-apps
descope-mcp-server-stdio is a Model Context Protocol (MCP) server that integrates Descope's Management APIs with applications like Claude Desktop. It enables users to manage user data and audit logs directly from their desktop environment.