Filesystem MCP
A local filesystem MCP server that lets LLMs and AI agents read, write, search, diff, patch, and manage files safely and efficiently. Built for reliable, structured, and controlled filesystem interaction.
Install / Use
/learn @j0hanz/Filesystem MCPQuality Score
Category
Development & EngineeringSupported Platforms
README
Filesystem MCP Server
A local filesystem MCP server that lets LLMs and AI agents read, write, search, diff, patch, and manage files safely and efficiently. Built for reliable, structured, and controlled filesystem interaction.
Overview
A secure, production-ready Model Context Protocol server that gives AI assistants controlled access to the local filesystem. All operations are sandboxed to explicitly allowed directories with path traversal prevention, sensitive file blocking, and optional Bearer token authentication.
Supports stdio (default) and Streamable HTTP transport with SSE support. HTTP sessions are implemented with isolated per-session server state.
Key Features
- 18 filesystem tools — read, write, search, diff, patch, hash, and bulk operations with structured output schemas
- Security-first — path validation, symlink escape prevention, sensitive file denylist, localhost-only CORS, optional API key auth
- Dual transport — stdio for local use, Streamable HTTP with SSE for networked/multi-session deployments
- Structured output — all tools return typed
outputSchema/structuredContentfor reliable LLM parsing - Self-documenting — 6 built-in resources (
internal://instructions,internal://tool-catalog, etc.) and 4 built-in prompts (get-help,compare-files,analyze-path,get-tool-help)
Requirements
- Node.js >= 24
Quick Start
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
Docker
docker run -i --rm -v /path/to/project:/workspace:ro ghcr.io/j0hanz/filesystem-mcp /workspace
Or using Docker Compose:
services:
filesystem-mcp:
build: .
stdin_open: true
volumes:
- ./:/projects/workspace:ro
command: ['/projects/workspace']
CLI Usage
filesystem-mcp [options] [allowedDirs...]
Arguments:
allowedDirs Directories the server can access
Options:
--allow-cwd Allow the current working directory as an additional root
--port <number> Enable HTTP transport on the given port
-v, --version Display server version
-h, --help Display help
Examples:
$ npx @j0hanz/filesystem-mcp@latest /path/to/project
$ npx @j0hanz/filesystem-mcp@latest --allow-cwd
$ npx @j0hanz/filesystem-mcp@latest --port 3000 /path/to/project
Client Configuration
<details> <summary><b>Install in VS Code</b></summary>Add to .vscode/mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
Or install via CLI:
code --add-mcp '{"name":"filesystem","command":"npx","args":["-y","@j0hanz/filesystem-mcp@latest"]}'
</details>
<details>
<summary><b>Install in VS Code Insiders</b></summary>
Add to .vscode/mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
Or install via CLI:
code-insiders --add-mcp '{"name":"filesystem","command":"npx","args":["-y","@j0hanz/filesystem-mcp@latest"]}'
</details>
<details>
<summary><b>Install in Cursor</b></summary>
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Visual Studio</b></summary>
Add to <SOLUTIONDIR>.mcp.json or %USERPROFILE%\.mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Goose</b></summary>
Add to ~/.config/goose/config.yaml:
extensions:
filesystem:
name: Filesystem MCP
cmd: npx
args:
- -y
- '@j0hanz/filesystem-mcp@latest'
enabled: true
type: stdio
</details>
<details>
<summary><b>Add to LM Studio</b></summary>
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Claude Desktop</b></summary>
Add to claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Claude Code</b></summary>
claude mcp add filesystem-mcp -- npx -y @j0hanz/filesystem-mcp@latest
Or add a project-scoped .mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Windsurf</b></summary>
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Amp</b></summary>
amp mcp add filesystem-mcp -- npx -y @j0hanz/filesystem-mcp@latest
Or add to settings.json:
{
"amp.mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Cline</b></summary>
Add to cline_mcp_settings.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}
</details>
<details>
<summary><b>Install in Codex</b></summary>
codex mcp add filesystem -- npx -y @j0hanz/filesystem-mcp@latest
Or add to ~/.codex/config.toml (or .codex/config.toml in a trusted project):
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@j0hanz/filesystem-mcp@latest"]
</details>
<details>
<summary><b>Install in GitHub Copilot Coding Agent</b></summary>
Add this JSON in your repository's GitHub Copilot coding agent MCP configuration:
{
"mcpServers": {
"filesystem": {
"type": "local",
"command": "npx",
"args"
Related Skills
node-connect
337.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
83.2kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Hook Development
83.2kThis skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
