local-filesystem-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Local Filesystem MCP
A local TypeScript Model Context Protocol (MCP) server that lets compatible AI assistants work with files and directories, inspect the local system, capture screenshots, run approved commands, and automate a headless Chromium browser.
Filesystem operations are restricted to configured allowed roots. The server includes permission checks and audit logging. It intentionally does not expose permanent file or directory deletion tools.
Project icon: preview and download
The repository includes the MCP folder sparkle icon at public/mcp-folder-sparkle-icon.png.
Preview
![]()
Download: mcp-folder-sparkle-icon.png
You can open the preview above in a Markdown-compatible viewer or use the download link to save the original PNG.
Related MCP server: filesystem-mcp
Features
The server registers 48 MCP tools across four areas: 24 file-operation tools, 9 directory-operation tools, 7 system and screenshot tools, and 8 browser-automation tools.
File operations
Tool | Inputs | Description |
|
| Read a UTF-8 text file. |
|
| Return a binary file as Base64 with its name, size, and MIME type (up to 10 MiB). |
|
| Read 1–20 text files in one call. |
|
| Create a file or replace its contents. |
|
| Append text to a file. |
|
| Replace a matching text occurrence. |
|
| Copy a file. |
|
| Move or rename a file. |
|
| Search names recursively; does not search file contents. |
|
| List immediate directory entries. |
|
| Return file or directory metadata. |
|
| Calculate a file's SHA-256 hash. |
|
| Inspect permission bits. |
|
| Change permission bits using an integer mode. |
|
| Add a regular file to the local trust store. |
|
| Remove a file from the local trust store. |
|
| Move a file into the |
|
| Restore a trashed file or directory to its original path. |
|
| Save Base64-encoded binary content with optional checksum verification. |
|
| Start a resumable chunked upload. |
|
| Append the next sequential upload chunk. |
|
| Check resumable upload progress. |
|
| Verify size, chunk count, and SHA-256 before publishing the file. |
|
| Abort an upload and remove its temporary file. |
Directory operations
Tool | Inputs | Description |
|
| Create a directory. |
|
| Return a recursive directory tree. |
|
| Calculate the total directory size. |
|
| Move a directory and update matching trust-store paths. |
|
| Watch for filesystem changes for 1–60 seconds. |
|
| Add a directory to the local trust store. |
|
| Remove a directory from the local trust store. |
|
| Move a directory and all its contents into |
|
| Restore a directory and all its contents from |
System tools
Tool | Inputs | Description |
| None | Return the server process working directory when it is within an allowed root. |
| None | List configured filesystem roots. |
|
| Report total, used, free, and available disk space. |
|
| Run any executable except commands rejected by the security denylist. |
| optional | Capture the full desktop. |
| optional | Interactively capture a selected screen region. |
| optional | Capture the active application window. |
Screenshot files can optionally be saved as PNG files inside an allowed root. Without saveTo, the image is returned to the MCP client and the temporary capture is cleaned up.
Browser automation
Browser tools use Playwright and a headless Chromium browser. The current implementation keeps one browser session and one active page in memory.
Tool | Inputs | Description |
|
| Navigate to an HTTP or HTTPS URL. |
|
| Click the first element matching a CSS selector. |
|
| Fill the first matching form field. |
| optional | Extract page text. |
| optional | List page links and their absolute URLs. |
| optional | Return a PNG screenshot of the browser page. |
| None | Navigate back in browser history. |
| None | Close the current browser session. |
This is a basic browser automation layer, not a full browser-control framework. Multiple tabs, persistent login profiles, downloads/uploads, keyboard and mouse APIs, semantic locators, and network/console inspection are not currently implemented. URL validation currently checks the URL format, HTTP(S) protocol, and embedded credentials; it does not provide complete SSRF protection. Only navigate to websites you trust, and do not use this browser against private/internal network services.
Technology stack
Node.js 20 or newer
TypeScript
pnpm 12.16.1
MCP SDK v2:
@modelcontextprotocol/server@modelcontextprotocol/nodefor the Node HTTP handlerZod v4 for tool schemas and environment validation
Playwright with Chromium for browser automation
dotenv for environment configuration
Prettier for formatting
Project structure
local-filesystem-mcp/
├── src/
│ ├── config/
│ │ ├── env.ts
│ │ └── paths.ts
│ ├── security/
│ │ ├── audit-log.ts
│ │ ├── authentication.ts
│ │ ├── command-allowlist.ts
│ │ ├── command-runner.ts
│ │ ├── command-validator.ts
│ │ ├── path-validator.ts
│ │ ├── permissions.ts
│ │ ├── register-trust-action.ts
│ │ └── trust-store.ts
│ ├── tools/
│ │ ├── browser/
│ │ │ ├── browser-context.ts
│ │ │ ├── browser-navigate.tool.ts
│ │ │ ├── browser-click.tool.ts
│ │ │ ├── browser-type.tool.ts
│ │ │ ├── browser-screenshot.tool.ts
│ │ │ ├── browser-get-text.tool.ts
│ │ │ ├── browser-get-links.tool.ts
│ │ │ ├── browser-go-back.tool.ts
│ │ │ └── browser-close.tool.ts
│ │ ├── directory-operations/
│ │ │ ├── delete-directory.tool.ts
│ │ │ └── restore-directory.tool.ts
│ │ ├── file-operations/
│ │ │ ├── delete-file.tool.ts
│ │ │ └── restore-from-trash.tool.ts
│ │ ├── system/
│ │ │ └── screenshot.tool.ts
│ │ └── register-all-tools.ts
│ ├── transports/
│ │ ├── http.ts
│ │ └── stdio.ts
│ ├── utils/
│ │ └── errors.ts
│ └── index.ts
├── tests/
├── logs/
├── .env.example
├── package.json
├── pnpm-lock.yaml
├── tsconfig.json
└── README.mdThe trust store is stored under logs/trust-store.json; audit events are written under logs/. Trash is stored in a .trash/ directory inside the corresponding allowed root. Original relative paths are preserved, and restore operations refuse to overwrite an existing destination. Directory moves also update matching trust-store paths. The exact source files for each tool are grouped by operation type.
Prerequisites
Node.js 20+
pnpm 12.16.1
Git
A supported desktop screenshot utility if you want to use desktop screenshot tools:
gnome-screenshot,scrot,flameshot, or ImageMagick'simport
Chromium installed through Playwright for browser tools
Installation
Clone the repository and install dependencies:
git clone <repository-url> local-filesystem-mcp
cd local-filesystem-mcp
corepack enable
corepack prepare pnpm@12.16.1 --activate
pnpm installInstall the Playwright Chromium browser:
pnpm exec playwright install chromiumOn Linux, if required operating-system libraries are missing, install them with:
pnpm exec playwright install --with-deps chromiumPlaywright is installed as a project dependency in node_modules. Chromium is downloaded to Playwright's browser cache for the current operating-system user (commonly ~/.cache/ms-playwright on Linux).
Environment configuration
Create a .env file in the project root. Configure the variables supported by src/config/env.ts:
Variable | Default | Description |
| Current user's home directory | One or more existing absolute paths the server is allowed to access. Separate multiple roots with the platform path delimiter (usually |
|
| Set to |
|
| HTTP bind host. The current schema accepts only |
|
| HTTP server port. |
| Required | A non-empty token required by environment validation. |
Example for Linux:
FILESYSTEM_ROOTS=/home/your-user/Documents:/home/your-user/Projects
FILESYSTEM_READ_ONLY=false
HTTP_HOST=127.0.0.1
HTTP_PORT=3002
MCP_AUTH_TOKEN=replace-with-a-long-random-secretUse real paths that exist on your machine. Do not commit .env or publish your token. The current environment schema does not define FILESYSTEM_ALLOW_DELETE; permanent deletion tools are not registered.
Running the server
Available scripts:
Command | Purpose |
| Run the TypeScript server with |
| Compile TypeScript into |
| Run the compiled server. |
| Run the Node.js test suites. |
| Format project files with Prettier. |
Build and start:
pnpm build
pnpm startOr run in development:
pnpm devThe entry point starts both STDIO and HTTP transports. STDIO is intended for MCP clients that launch the server process. The HTTP MCP endpoint is:
http://127.0.0.1:<HTTP_PORT>/mcpHTTP authentication status
An authentication helper using a Bearer token exists, but the authorization check in src/transports/http.ts is currently commented out. The HTTP endpoint therefore does not enforce MCP_AUTH_TOKEN at request time. It binds to loopback (127.0.0.1) by default; do not expose or forward this endpoint to an untrusted network until request authentication is enabled and tested. The token is still required by current environment validation.
Connecting an MCP client
The exact configuration format depends on the MCP client. For a local STDIO connection, configure the client to launch the built entry point with Node.js and pass the required environment variables.
Generic example:
{
"mcpServers": {
"local-filesystem-mcp": {
"command": "node",
"args": ["/absolute/path/to/local-filesystem-mcp/dist/index.js"],
"env": {
"FILESYSTEM_ROOTS": "/absolute/path/to/allowed/directory",
"FILESYSTEM_READ_ONLY": "true",
"HTTP_HOST": "127.0.0.1",
"HTTP_PORT": "3002",
"MCP_AUTH_TOKEN": "replace-with-a-long-random-secret"
}
}
}
}Use an absolute path to dist/index.js, build before connecting, and ensure the configured roots exist. Follow the documentation for your MCP client for its current configuration file and schema.
Security
Allowed roots: Filesystem paths are validated against the configured roots. Use the narrowest roots that support your workflow.
Read-only mode: Set
FILESYSTEM_READ_ONLY=truewhen you only need to inspect files.Trash instead of permanent deletion:
delete_fileanddelete_directorymove items into.trash/under the matching allowed root. They preserve the original relative path and refuse to overwrite an existing Trash item.\n- Restore support:restore_from_trashrestores a trashed file or directory automatically;restore_directoryrestores directories specifically. Restore refuses to overwrite an existing original path. For nested items, restore parent directories first.Overwrites and moves:
write_filecan replace an existing file; move operations change paths; permission tools change access bits. Review these actions before invoking them.Command execution:
run_commandaccepts arbitrary executable names and arguments, with the denylist checked on every invocation. Privilege-escalation tools, destructive disk/file commands, permission-changing tools, shells/interpreters, remote-access utilities, and Git push-related operations are blocked. Shell interpretation is disabled (shell: false). The denylist is defense-in-depth, not an OS sandbox: allowed programs and package scripts can launch other processes or access files using the server process's operating-system permissions. Run this server as an unprivileged user and keepFILESYSTEM_ROOTSnarrow.Audit logging: Tool operations are recorded in the local logs directory.
Trust store: Trusted file and directory entries are stored locally. Trust registration is not a substitute for operating-system permissions or content validation.
Browser security: Browser URL checks are basic and do not fully prevent server-side request forgery (SSRF). Do not browse untrusted URLs or internal/private network targets.
HTTP security: HTTP Bearer authentication is not currently enforced; keep the endpoint bound to loopback and do not expose it to a network.
Testing and formatting
Run:
pnpm test
pnpm build
pnpm formatTo format without changing files, you can run:
pnpm exec prettier --check .Troubleshooting
Problem | What to check |
| Enable Corepack and activate the pnpm version declared in |
| Run |
Chromium executable is missing | Run |
Chromium reports missing Linux libraries | Run |
Screenshot capture fails | Install one of the supported screenshot utilities and ensure a graphical desktop session is available. |
Filesystem path is rejected | Confirm the path is absolute and falls within one of |
Write operation is denied | Check |
HTTP endpoint does not respond | Confirm |
Contributing
Create a focused branch for your change.
Keep tool schemas, permission checks, audit events, and documentation consistent.
Add or update tests for behavior changes.
Run
pnpm testandpnpm build.Document security implications and known limitations.
License
This project is licensed under the MIT License. See LICENSE.
Filesystem access policies
The server applies path restrictions centrally through validatePath, so the rules cover file, directory, and browser screenshot save operations.
Variable | Default | Purpose |
| Current user's home directory | One or more allowed base directories. |
|
| Blocks direct access to each configured root itself while allowing permitted child paths. |
| Empty | Explicit absolute file or directory paths to deny, including all descendants of a blocked directory. |
|
| Allows or blocks dotenv files such as |
|
| Blocks filesystem write operations when enabled. |
On Linux/macOS, separate multiple paths with :; on Windows, use ; (without the space). For example:
FILESYSTEM_ROOTS=/home/your-user/Desktop:/home/your-user/Downloads
FILESYSTEM_DENY_ROOT_ACCESS=true
FILESYSTEM_BLOCKED_PATHS=/home/your-user/Desktop/Private:/home/your-user/Documents/Confidential
FILESYSTEM_ALLOW_ENV_FILES=false
FILESYSTEM_READ_ONLY=falseA blocked directory also blocks every path below it. Configure exact absolute paths that exist on disk. The configured roots should be broad enough to contain the folders you need, but as narrow as practical. Denying a root blocks listing or reading that root directly; it does not automatically block its children.
Browser screenshots
The browser_screenshot tool accepts fullPage and an optional saveTo absolute path. The destination must end in .png, be inside an allowed root, and must not already exist. Example:
{
"fullPage": true,
"saveTo": "/home/your-user/Desktop/project/docs/screenshots/home.png"
}The screenshot save destination is checked against the same root, blocked-path, and dotenv-file policies as other filesystem operations.
Saving binary files from AI clients
The save_binary_file MCP tool saves arbitrary file types (images, PDFs, office documents, audio, video, and archives) from base64-encoded bytes to an absolute destination path inside a configured filesystem root.
No application-level file-size limit is imposed; practical limits depend on the MCP client/transport, available memory, and disk space because the bytes are passed as base64 in the tool request.
Destination paths are checked with the existing filesystem path validator.
Write permission and audit logging are enforced.
Existing files are not overwritten unless
overwrite: trueis explicitly supplied.The MCP client must provide the file bytes as base64; this tool does not extract attachments from chat history or download arbitrary URLs.
Restart the MCP server/client after updating the server so the new tool is discovered. For a browser right-click “Save to Local Filesystem” menu, a separate browser extension or client-side integration is required; an MCP server alone cannot add browser context-menu entries.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Browse and manage files in your Moxt AI workspace from any MCP client.
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides file system operations (list, read, write, search) via MCP, enabling an AI agent to manage files through natural language.ISC
- AlicenseAqualityDmaintenanceEnables AI assistants to read, write, and manage files on the local system with security features like path restrictions and optional read-only mode.92MIT
- AlicenseAqualityDmaintenanceProvides LLMs with local filesystem operations (read/write files, list directories) and command execution via MCP, enabling file management and task automation within AI clients.74 npmISC
- AlicenseNot gradedqualityDmaintenanceProvides safe, allowlisted local filesystem access for MCP-compatible AI clients, enabling directory listing, file reading/writing (with byte limits), and text search while blocking paths outside approved roots and symlink escapes.MIT