Skip to content

Configuration

MCP Filesystem Ultra is configured entirely through command-line flags. These flags are passed via the args array in your claude_desktop_config.json (for Claude Desktop) or directly when running the binary.

All flags are optional — the server runs with sensible defaults out of the box.


{
"mcpServers": {
"filesystem-ultra": {
"command": "C:\\path\\to\\filesystem-ultra-v4.exe",
"args": [
"C:\\Users\\you\\projects"
]
}
}
}
{
"mcpServers": {
"filesystem-ultra": {
"command": "C:\\path\\to\\filesystem-ultra-v4.exe",
"args": [
"--compact-mode",
"--cache-size", "200MB",
"--parallel-ops", "8",
"--max-search-results", "50",
"--max-list-items", "100",
"--backup-dir", "C:\\Backups\\MCP",
"--backup-max-age", "14",
"--backup-max-count", "200",
"--log-dir", "C:\\Logs\\MCP",
"--log-level", "error",
"C:\\Users\\you\\projects",
"C:\\Backups\\MCP"
]
}
}
}

FlagTypeDefaultDescription
--allowed-pathsstring(none)Comma-separated list of allowed base paths. Files outside these paths cannot be accessed.

Allowed paths can also be passed as positional arguments after all flags:

Terminal window
# Using --allowed-paths flag
filesystem-ultra-v4.exe --allowed-paths "C:\project,C:\backups"
# Using positional arguments (equivalent)
filesystem-ultra-v4.exe C:\project C:\backups
# Both formats work together
filesystem-ultra-v4.exe --compact-mode C:\project C:\backups

When --allowed-paths is empty (the default), there are no restrictions. When set, all operations verify that the target path is within one of the allowed directories. Symlinks are resolved via filepath.EvalSymlinks() before checking containment.

Important: If you configure --backup-dir, include that directory in your allowed paths so backup operations can access it.


FlagTypeDefaultDescription
--compact-modebooleanfalseEnable compact responses that minimize token usage (65-75% savings). Responses use shorter formats, fewer headers, and abbreviated metadata.
--max-response-sizestring10MBMaximum response size. Accepts size suffixes: KB, MB, GB. Responses exceeding this limit are truncated.
--max-search-resultsinteger1000Maximum number of search results returned by search_files. Lower values reduce token consumption for broad searches.
--max-list-itemsinteger500Maximum items returned in directory listings by list_directory. Lower values reduce token consumption for large directories.

Compact mode example:

Without compact mode (approximately 50 tokens per directory entry):

Directory listing for: C:\project\src
Type Name Size Modified
----------------------------------------------------
[DIR] components - 2026-03-10
[FILE] index.ts 2.3 KB 2026-03-10

With compact mode (approximately 3 tokens per entry):

src: components/, index.ts(2KB), app.tsx(5KB)

FlagTypeDefaultDescription
--cache-sizestring100MBMemory cache limit for the 3-tier caching system (file content, directory listings, metadata). Accepts size suffixes: KB, MB, GB.
--parallel-opsinteger2x CPU cores (max 16)Maximum number of concurrent file operations. Higher values improve throughput for batch and pipeline workloads.
--binary-thresholdstring1MBFile size threshold for binary protocol detection. Files larger than this threshold may use different handling strategies.

Cache sizing guidance:

Cache SizeRecommended ForTypical Memory Usage
50MBSmall projects, constrained environments50-80 MB
100MBDefault, most development work80-120 MB
200MBLarge codebases, frequent repeated reads150-250 MB
500MBEnterprise projects, log analysis200-400 MB

The cache uses automatic eviction — when the limit is reached, the oldest entries are removed. Cache hit rates typically reach 85-95% during a session and 98%+ after warmup.


FlagTypeDefaultDescription
--backup-dirstringSystem temp directoryDirectory for backup storage. Default: %TEMP%\mcp-batch-backups (Windows) or /tmp/mcp-batch-backups (Linux/WSL).
--backup-max-ageinteger7Maximum age of backups in days. Backups older than this are eligible for cleanup.
--backup-max-countinteger100Maximum number of backups to keep. When exceeded, the oldest backups are deleted automatically.

Example configuration:

{
"args": [
"--backup-dir", "C:\\Backups\\MCP",
"--backup-max-age", "14",
"--backup-max-count", "200",
"C:\\project",
"C:\\Backups\\MCP"
]
}

Important: The backup directory must be included in allowed paths (either via --allowed-paths or as a positional argument) for the backup tool to access it.

Backups are created automatically before destructive operations (edit_file, delete_file, multi_edit, and batch/pipeline destructive steps). Each backup is stored in its own directory with a unique ID:

20260313-143022-abc123/
metadata.json # Backup information (timestamp, operation, context)
files/
your_file.go # Backed up file contents

FlagTypeDefaultDescription
--risk-threshold-mediumfloat20.0Percentage of file change that triggers MEDIUM risk level.
--risk-threshold-highfloat75.0Percentage of file change that triggers HIGH risk level.
--risk-occurrences-mediuminteger50Number of replacement occurrences that triggers MEDIUM risk.
--risk-occurrences-highinteger100Number of replacement occurrences that triggers HIGH risk.

Risk level behavior:

LevelConditions (defaults)What Happens
LOW< 20% change, < 50 occurrencesProceeds silently
MEDIUM20-74% change, or 50-100 occurrencesAuto-proceeds with backup and risk notice
HIGH75-89% change, or > 100 occurrencesAuto-proceeds with backup and prominent warning
CRITICAL>= 90% changeBlocked — requires force: true

Adjusting thresholds for stricter or more lenient editing:

{
"args": [
"--risk-threshold-medium", "15.0",
"--risk-threshold-high", "50.0",
"--risk-occurrences-medium", "30",
"--risk-occurrences-high", "75"
]
}

Only CRITICAL risk (>= 90% of file content changed) blocks the operation. MEDIUM and HIGH risk edits auto-proceed with an automatic backup. This design eliminates wasteful retry round-trips in agentic workflows.


FlagTypeDefaultDescription
--hooks-enabledbooleanfalseEnable the pre/post operation hook system. Hooks allow custom validation and formatting logic for 12 event types.
--hooks-configstring(none)Path to a hooks configuration JSON file. Required when --hooks-enabled is true.

Hook event types:

The hook system supports 12 event types: pre/post for read, write, edit, delete, search, and list operations. Hooks can validate parameters, transform content, enforce policies, and format output.

Example hooks configuration:

{
"hooks": [
{
"event": "pre_write",
"type": "validate",
"config": {
"max_file_size": 5242880,
"blocked_extensions": [".exe", ".dll"]
}
},
{
"event": "post_edit",
"type": "format",
"config": {
"formatter": "gofmt",
"extensions": [".go"]
}
}
]
}

See Hooks for detailed documentation.


FlagTypeDefaultDescription
--log-levelstringinfoLog level for stderr output. Values: debug, info, warn, error. Uses slog with JSON handler.
--debugbooleanfalseEnable debug mode. Equivalent to --log-level debug but also enables additional diagnostic output.
--log-dirstring(none)Directory for audit logs and metrics snapshots. When set, enables operation logging for all 16 tool invocations.

Audit logging (when --log-dir is set):

The server writes two files:

FileFormatDescription
operations.jsonlJSON LinesOne entry per tool call with timing, status, path, bytes, file size, args summary, risk level, lines changed, and match count. Auto-rotates at 10 MB, keeps the last 3 files.
metrics.jsonJSONPerformance metrics snapshot updated every 30 seconds.

When --log-dir is not set, audit logging is disabled with zero overhead — the auditWrap() function returns the handler unchanged.

Example:

{
"args": [
"--log-dir", "C:\\Logs\\MCP",
"--log-level", "warn"
]
}

The audit logs can be viewed through the separate Dashboard binary. See below.


FlagTypeDefaultDescription
--versionbooleanfalsePrint version information and exit.
--benchbooleanfalseRun a performance benchmark and exit.
--vscode-apibooleantrueEnable VS Code API integration when available.

The Dashboard is a separate binary (dashboard.exe) that reads audit logs and serves a web UI for monitoring.

Terminal window
# Build the dashboard
go build -ldflags="-s -w" -trimpath -o dashboard.exe ./cmd/dashboard/
# Run
dashboard.exe --log-dir=C:\Logs\MCP --backup-dir=C:\Backups\MCP --port=9100
FlagDefaultDescription
--log-dir(required)Same directory as the MCP server’s --log-dir
--backup-dir(required)Same directory as the MCP server’s --backup-dir
--port9100HTTP port for the dashboard UI

The dashboard and MCP server communicate only through files — there is no direct coupling. The dashboard reads operations.jsonl and metrics.json, and provides real-time updates via Server-Sent Events (SSE).

Dashboard pages: Dashboard (metrics), Operations (audit log), Backups (enterprise recovery), Statistics, Proxy/Tokens, Edit Analysis.


For environments where token cost is the primary concern:

{
"args": [
"--compact-mode",
"--max-search-results", "20",
"--max-list-items", "50",
"--log-level", "error",
"C:\\project"
]
}

For batch workloads and large codebases:

{
"args": [
"--cache-size", "500MB",
"--parallel-ops", "16",
"--max-search-results", "2000",
"C:\\project"
]
}

For enterprise environments with audit requirements:

{
"args": [
"--compact-mode",
"--cache-size", "200MB",
"--parallel-ops", "8",
"--log-dir", "C:\\Logs\\MCP",
"--log-level", "info",
"--backup-dir", "C:\\Backups\\MCP",
"--backup-max-age", "30",
"--backup-max-count", "500",
"--hooks-enabled",
"--hooks-config", "C:\\config\\mcp-hooks.json",
"C:\\project",
"C:\\Backups\\MCP",
"C:\\Logs\\MCP"
]
}

For environments with tight access control:

{
"args": [
"--allowed-paths", "C:\\project\\src,C:\\project\\tests",
"--risk-threshold-medium", "10.0",
"--risk-threshold-high", "40.0",
"--risk-occurrences-medium", "20",
"--risk-occurrences-high", "50",
"--backup-max-count", "500",
"--log-dir", "C:\\Logs\\MCP",
"C:\\project\\src",
"C:\\project\\tests"
]
}

The server does not read environment variables directly. All configuration is through CLI flags. However, the server detects the following environment conditions automatically:

  • WSL detection: Auto-detects when running inside Windows Subsystem for Linux
  • CPU count: Used to set default --parallel-ops (2x CPU cores, max 16)
  • Temp directory: Used as default --backup-dir when not specified

Some settings can be checked or adjusted at runtime:

// View current performance settings and cache stats
server_info({ action: "stats" })
// View tool documentation and available features
server_info({ action: "help", topic: "overview" })
// Configure WSL auto-sync at runtime
wsl({ action: "autosync_config", enabled: true, sync_on_write: true })


Last updated: March 2026 Version: 4.0.0