Skip to main content
Glama
universal-mcp-fs

universal-mcp-fs

by Prabhas125

universal-mcp-fs

A secure, local MCP server that gives AI assistants controlled access to your filesystem.

npm version GitHub License: MIT Node.js TypeScript Platform MCP


🛠️ Built With


Overview

universal-mcp-fs gives AI assistants — Claude Desktop today, and any other stdio-compatible MCP client as they add support — filesystem access and command execution on your machine, gated behind an interactive approval system.

  • stdio only. No HTTP server, no open ports, no internet exposure.

  • Elicitation-based approval. Dangerous actions (delete, run commands, move files) pause and ask the connected client to show a native approval popup — the same kind of Allow/Deny prompt you already see for other tool calls in Claude Desktop.

  • Sensitive paths are blocked outright (.ssh, .aws, .gnupg, browser credential stores, /etc/shadow, etc.) — before any approval prompt is even offered.

  • 17 tools covering file read/write/move/copy/delete, directory listing, filename and content search, and shell command execution (foreground and background).


Related MCP server: Remote Server MCP

Install

npm install -g universal-mcp-fs

Option 2 — from source (GitHub)

git clone https://github.com/Prabhas125/universal-mcp-fs.git
cd universal-mcp-fs
npm install
npm run build

Setup: Claude Desktop

Edit your Claude Desktop config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

If you installed via npm (Option 1):

{
  "mcpServers": {
    "filesystem": {
      "command": "universal-mcp-fs",
      "args": ["--allowed-dirs", "/home/user;/home/user/projects"]
    }
  }
}

If you built from source (Option 2):

{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": [
        "/full/path/to/universal-mcp-fs/dist/index.js",
        "--allowed-dirs",
        "/home/user;/home/user/projects"
      ]
    }
  }
}

On Windows, use double-escaped backslashes in the path, e.g. "C:\\Users\\yourname\\projects\\universal-mcp-fs\\dist\\index.js".

Then restart Claude Desktop. It will spawn the server automatically and the 17 tools will be available in chat. No further setup, no login, no token.

Verify it's connected

Ask Claude something like "list the files in [one of your allowed directories]". If it responds with a directory listing, the server is connected. If Claude says it has no matching tool, double check the config file path and JSON syntax, then fully quit and reopen Claude Desktop (a reload isn't enough — it only reads this file on startup).


Configuration options

All options can be passed as CLI args in the config's args array, or as environment variables in an env block.

CLI flag

Env var

Default

Description

--allowed-dirs

MCP_ALLOWED_DIRS

your home directory

Semicolon-separated list of directories the server may access

--disable-commands

MCP_DISABLE_COMMANDS=true

commands enabled

Disables run_command / run_command_background

--disable-delete

MCP_DISABLE_DELETE=true

delete enabled

Disables delete_file / delete_directory

--max-file-size

MCP_MAX_FILE_SIZE

10485760 (10 MB)

Max bytes read_file will read in one call

--command-timeout

MCP_COMMAND_TIMEOUT_MS

30000

Default timeout for run_command, in ms

--elicitation-timeout

MCP_ELICITATION_TIMEOUT_MS

120000

How long an approval popup waits before auto-denying, in ms

--max-search-results

MCP_MAX_SEARCH_RESULTS

50

Cap on results from search tools


Tool reference

Filesystem — read_file, read_file_lines, write_file, create_directory, list_directory, move_file, copy_file, delete_file, delete_directory

Search — search_files (by filename/glob), search_content (grep-like, with context lines)

Commands — run_command, run_command_background, list_processes, kill_process

Info — file_info, system_info

Full parameter docs are visible to the AI client automatically (and to you, via npx @modelcontextprotocol/inspector).


Permission system

Some tools always require your approval before running: delete_file, delete_directory, run_command, run_command_background, move_file, kill_process, and write_file when overwriting an existing file.

When one of these is called, the server sends an elicitation request to Claude Desktop, which renders it as a native approval dialog — the same UI you already see for regular tool-call confirmations. You can:

  • Approve — the action runs once

  • Approve + "always allow" — this exact action (same tool, same file/command) is silently approved from then on, persisted to ~/.universal-mcp-fs/always-allow.json

  • Decline/cancel — the action is aborted, nothing happens

If you don't respond within 2 minutes, the request automatically resolves to denied — it will not hang the connection or leave Claude waiting indefinitely.

Sensitive paths (.ssh, .aws, .gnupg, browser credential files, /etc/shadow) are rejected before any approval prompt is offered — no amount of clicking "allow" gets past this list. You can extend it via config/default.json if you build from source.

Every decision (approved, declined, always-allow, timed out, blocked) is logged to ~/.universal-mcp-fs/audit.log and to stderr, visible in Claude Desktop's MCP server logs.


Security model

  • No network transport — this server never opens a port or listens for external connections.

  • All file operations are validated against --allowed-dirs; anything outside is rejected regardless of approval.

  • Symlinks are resolved before validation, so a symlink inside an allowed directory can't be used to escape it.

  • Path traversal (../..) is normalized away before any check runs.

  • If the connected client doesn't support elicitation, dangerous tools fail closed (denied), never fail open.


Publishing / contributing

npm run build
npm version patch     # bumps package.json, creates a git tag
git push && git push --tags
npm publish

Issues and PRs welcome.

License

MIT

Available Tools

17 tools
copy_fileCopy File or DirectoryA

Copy a file or directory (recursively for directories). Does not modify the source, so no approval is required.

Args:

  • source (string): Path to copy from.

  • destination (string): Path to copy to.

Inputs: source (required), destination (required).

create_directoryCreate DirectoryA
Idempotent

Create a directory, including any missing parent directories (like mkdir -p).

Args:

  • path (string): Directory path to create.

Returns: confirmation of the created path. No error if the directory already exists.

Inputs: path (required).

delete_directoryDelete DirectoryA
Destructive

Permanently delete a directory and all its contents, recursively. ALWAYS requires interactive user approval before proceeding — this cannot be undone.

Args:

  • path (string): Directory to delete.

Inputs: path (required).

delete_fileDelete FileA
Destructive

Permanently delete a single file. ALWAYS requires interactive user approval before proceeding — this cannot be undone.

Args:

  • path (string): Path to the file to delete.

Inputs: path (required).

file_infoGet File InfoA
Read-onlyIdempotent

Get metadata about a file or directory: size, created/modified dates, permissions, and type.

Args:

  • path (string): Path to inspect.

Returns: size in bytes, created/modified timestamps, POSIX permission bits, and whether it's a directory or symlink.

Inputs: path (required).

kill_processKill Background ProcessA
Destructive

Terminate a background process previously started with run_command_background. Requires interactive user approval before proceeding.

Args:

  • pid (number): Process ID to kill (must be one tracked by this server — see list_processes).

Inputs: pid (required).

list_directoryList DirectoryA
Read-onlyIdempotent

List the contents of a directory with metadata (type, size, modified date).

Args:

  • path (string): Directory to list.

  • recursive (boolean, optional): List subdirectories recursively. Default: false.

  • show_hidden (boolean, optional): Include dotfiles/dotdirs. Default: false.

Returns: a listing with one entry per line: type, size, modified date, name.

Inputs: path (required), recursive, show_hidden.

list_processesList Background ProcessesA
Read-onlyIdempotent

List background processes started via run_command_background during this session, with their status.

Returns: a list of tracked processes with PID, command, status, and start time.

Inputs: no named parameters.

move_fileMove or Rename FileA
Destructive

Move or rename a file or directory. ALWAYS requires interactive user approval before proceeding.

Args:

  • source (string): Current path.

  • destination (string): Target path.

Error Handling:

  • Both source and destination are validated against allowed directories and blocked paths.

  • Returns an error if the user declines the approval prompt.

Inputs: source (required), destination (required).

read_fileRead FileA
Read-onlyIdempotent

Read the full contents of a file. Text files are returned as UTF-8 text; binary files are detected automatically and returned as base64.

Args:

  • path (string): Absolute or relative path to the file.

Returns: file contents as text, or a note that the file is binary with base64 content.

Error Handling:

  • Returns an error if the path is outside allowed directories or matches a blocked pattern (e.g. .ssh, .aws).

  • Returns "File or directory not found" if the path does not exist.

Inputs: path (required).

read_file_linesRead File LinesA
Read-onlyIdempotent

Read a specific line range from a file. Useful for large files where reading the whole thing would exceed limits.

Args:

  • path (string): Path to the file.

  • start_line (number): 1-indexed starting line (inclusive).

  • end_line (number): 1-indexed ending line (inclusive).

Returns: the requested lines, each prefixed with its line number.

Inputs: path (required), end_line (required), start_line (required).

run_commandRun Shell CommandA
Destructive

Execute a shell command and return its stdout/stderr. ALWAYS requires interactive user approval before running.

Args:

  • command (string): The command to execute (interpreted by the platform shell — cmd.exe on Windows, bash on Linux).

  • cwd (string, optional): Working directory. Defaults to the first allowed directory.

  • timeout (number, optional): Timeout in milliseconds. Default: 30000, max 300000.

Returns: stdout, stderr, and exit code.

Error Handling:

  • Returns an error if the user declines the approval prompt.

  • Returns an error if the command exceeds the timeout (process is killed).

Inputs: command (required), cwd, timeout.

run_command_backgroundRun Command in BackgroundA
Destructive

Start a long-running command in the background and return immediately with its process ID. ALWAYS requires interactive user approval before running.

Args:

  • command (string): The command to execute.

  • cwd (string, optional): Working directory. Defaults to the first allowed directory.

Returns: the process ID (pid), which can be used with list_processes and kill_process.

Note: background processes have no timeout, but they are tracked and can be killed with kill_process. They do not survive this server process restarting (e.g. Claude Desktop being closed and reopened).

Inputs: command (required), cwd.

search_contentSearch File ContentsA
Read-onlyIdempotent

Grep-like search: find a text query across files in a directory, returning matching lines with 2 lines of context before/after.

Args:

  • directory (string): Base directory to search within.

  • query (string): Text to search for (case-sensitive, literal substring match).

  • file_pattern (string, optional): Glob to limit which files are searched (e.g. "**/*.js"). Default: all files.

  • max_results (number, optional): Cap on returned matches. Default: 50.

Returns: matching lines with file path, line number, and surrounding context.

Inputs: query (required), directory (required), max_results, file_pattern.

search_filesSearch Files by NameA
Read-onlyIdempotent

Find files matching a glob pattern within a directory (e.g. "**/.ts", ".log").

Args:

  • directory (string): Base directory to search within.

  • pattern (string): Glob pattern to match filenames against.

  • max_results (number, optional): Cap on returned results. Default: 50.

Returns: a list of matching file paths, relative to the search directory.

Inputs: pattern (required), directory (required), max_results.

system_infoGet System InfoA
Read-onlyIdempotent

Get information about the machine this server is running on: OS, hostname, home directory, Node version, CPU count, and total memory.

Returns: a JSON object with platform details.

Inputs: no named parameters.

write_fileWrite FileA
Destructive

Create a new file or overwrite an existing one. Parent directories are created automatically.

Overwriting an EXISTING file requires interactive user approval (elicitation) — the server will pause and ask the connected client to confirm before proceeding.

Args:

  • path (string): Path to write to.

  • content (string): Text content to write (UTF-8).

  • overwrite (boolean, optional): Must be true to overwrite an existing file. Default: false.

Error Handling:

  • Returns an error without writing if the file exists and overwrite is not true.

  • Returns an error if the user declines the overwrite approval prompt.

Inputs: path (required), content (required), overwrite.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 17 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: read_file vs read_file_lines differ by scope; write_file, move_file, copy_file, delete_file, delete_directory are all unique operations; search_files vs search_content are different search types; run_command vs run_command_background vs process management tools are separate; system_info and file_info are metadata distinct from content tools. No overlap.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., read_file, list_directory, search_content, kill_process). No mixing of camelCase or other conventions, making the namespace predictable.

    Tool Count4/5

    17 tools is slightly above the typical 3-15 range, but each tool covers a distinct operation (file read/write, directory ops, searching, command execution, process management, system info) and the scope justifies the count. It feels well-scoped for a file system server.

    Completeness5/5

    The tool set covers all essential file system operations: create, read, update (overwrite), delete for files; directory creation and deletion; move/copy; file and content search; metadata retrieval; and even command execution with process management. No obvious gaps for common tasks.

    Related MCP Connectors

    Related MCP Servers