by CyberhavenInc
Enforces .mcpignore patterns to restrict MCP client file system access while providing full read/write and directory operations.
Filesystem Mcpignore adds .mcpignore support to the Model Context Protocol (MCP) filesystem server, allowing you to define ignore patterns (same syntax as .gitignore) that control which files and directories an MCP client can read, write, or manipulate.
mcpignore-filesystem.{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": ["-y", "@cyberhaven/mcpignore-filesystem", "/path/to/allowed/dir1", "/path/to/allowed/dir2"]
}
}
}
.env or proprietary assets.Q: Can I still list a directory that contains ignored files?
A: Yes. list_directory is blocked for ignored paths, but directory_tree and search_files are allowed to return names of non‑ignored files.
Q: How do ignore patterns propagate to sub‑directories?
A: Each directory can have its own .mcpignore. Patterns are applied relative to the directory containing the file.
Q: What happens if a client tries to write to an ignored file? A: The operation is blocked and the client receives an access‑denied error.
Q: Do I need to install any additional dependencies?
A: No. The server runs directly with npx and pulls the @cyberhaven/mcpignore-filesystem package from npm.
Q: Is the server compatible with other MCP servers? A: It builds on the official Model Context Protocol filesystem server, so it can replace or sit alongside other MCP filesystem implementations.
.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.
.mcpignoreNote: Create an .mcpignore file for each direcoties specified via args
.mcpignoreThe .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.jsoncline_mcp_settings.jsonmcp.jsonNote: .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.
{
"mcpServers": {
"mcpignore-filesystem": {
"command": "npx",
"args": [
"-y",
"@cyberhaven/mcpignore-filesystem",
"/path/to/allowed/dir1",
"/path/to/allowed/dir2"
]
}
}
}claude mcp add mcpignore-filesystem npx -y @cyberhaven/mcpignore-filesystem /path/to/allowed/dir1 /path/to/allowed/dir2Explore related MCPs that share similar capabilities and solve comparable challenges
by chaitin
A self‑hosted web application firewall and reverse proxy that protects web applications from attacks and exploits by filtering, monitoring, and blocking malicious HTTP/S traffic.
by safedep
Provides enterprise‑grade open source software supply chain security by scanning source code, dependencies, containers and SBOMs, detecting vulnerabilities and malicious packages, and enforcing policy as code.
by semgrep
Offers an MCP server that lets LLMs, agents, and IDEs run Semgrep scans to detect security vulnerabilities in source code.
by PortSwigger
Enables Burp Suite to communicate with AI clients via the Model Context Protocol, providing an MCP server and bundled stdio proxy.
by cycodehq
Boost security in the development lifecycle via SAST, SCA, secrets, and IaC scanning.
by mobb-dev
Provides automatic security vulnerability remediation for code via a command‑line interface and an MCP server, leveraging findings from popular SAST tools such as Checkmarx, CodeQL, Fortify, and Snyk.
by ChristophEnglisch
Provides AI‑powered administration of Keycloak users and realms through the Model Context Protocol, enabling automated creation, deletion, and listing of users and realms from MCP clients such as Claude Desktop.
by Spathodea-Network
Provides a Model Context Protocol server that enables querying and retrieving threat intelligence data from OpenCTI through a standardized interface.
by firstorderai
Provides seamless access to two‑factor authentication codes and passwords for AI agents, enabling automated login while maintaining security.