DirForge
Supports external authentication via reverse proxy headers, allowing integration with Authelia for authentication.
Supports external authentication via reverse proxy headers, allowing integration with Authentik for authentication.
Provides a read-only S3-compatible API that can be accessed by MinIO client for file browsing and downloads.
Exposes Prometheus metrics at the /metrics endpoint for monitoring server operations.
Provides a read-only S3-compatible API that can be used by rclone for file access and synchronization.
DirForge
A stateless, read-only web file browser for homelab and NAS power users. No database, no background workers, no disk writes - just point it at a mounted path and go.
Browse files in a clean web UI with search, previews, and archive inspection. Download individual files or entire folders as ZIP. Access the same data through a RESTful JSON API, an S3-compatible endpoint for tools like rclone, a read-only WebDAV mount for native OS file managers, or an MCP server for AI assistants. Everything runs in a single stateless container with no external dependencies.
Quick Start
Prerequisite: Docker or Podman (images are published for amd64 and arm64).
Docker run
docker run -d \
--name dirforge \
-p 8091:8080 \
-e RootPath=/data \
-v /srv/share:/data:ro \
ghcr.io/dissimilis/dirforge:latestDocker Compose
cp .env.example .env
# edit HOST_PATH, BasicAuthUser, and BasicAuthPass in .env
docker compose up -dWarning: The default compose file falls back to
admin/dirforgecredentials if you don't setBasicAuthUserandBasicAuthPassin your.env. Change these before exposing the service on your network.
Podman
The same commands work with Podman. Replace docker with podman:
podman run -d \
--name dirforge \
-p 8091:8080 \
-e RootPath=/data \
-v /srv/share:/data:ro \
ghcr.io/dissimilis/dirforge:latestFor Compose, use podman compose (Podman 4.1+):
cp .env.example .env
# edit HOST_PATH in .env
podman compose up -dNotes for Podman users:
podman composeis a built-in subcommand in Podman 4.1+, not the older third-partypodman-composePython package.DirForge uses ports above 1024, so rootless Podman works without extra configuration.
On SELinux systems (Fedora, RHEL), add
:zto volume mounts:-v /srv/share:/data:ro,z.
Standalone (Windows)
Download
dirforge-win-x64.zipfrom the latest releaseExtract to a folder (e.g.
C:\DirForge)Edit
appsettings.json— setRootPathto the directory you want to shareConsole mode: Double-click
DirForge.exeto run interactivelyWindows Service: Right-click
install-service.bat→ Run as administrator. DirForge will start on boot automatically. Useuninstall-service.batto remove the service.
Standalone (Linux)
Download
dirforge-linux-x64.tar.gz(orlinux-arm64) from the latest releaseExtract:
tar -xzf dirforge-linux-x64.tar.gz -C /opt/dirforgeEdit
appsettings.json— setRootPathto the directory you want to shareRun directly:
./DirForgeInstall as systemd service:
sudo useradd -r -s /usr/sbin/nologin dirforge sudo cp dirforge.service /etc/systemd/system/ # Edit /etc/systemd/system/dirforge.service to adjust paths if needed sudo systemctl daemon-reload sudo systemctl enable --now dirforge
The tarball includes an example dirforge.service file with systemd hardening options.
Open http://localhost:8091.
With the default config profile in this repository, sharing, dashboard, and metrics are enabled.
Related MCP server: File Tools MCP Server
Features
Browsing
List and grid view layouts
Sortable columns (name, size, date)
Light and dark themes (toggle or set default via
DefaultTheme)File preview modal for text, images, video, audio, and PDF
Inline archive browser for
.zip,.tar,.tar.gz,.tgz, and.gzImage lightbox with navigation
Recursive search with configurable depth and time budget
Age badges on files and folders
Custom site title via
SiteTitle
Sharing & Downloads
Direct file downloads
Folder download as ZIP archive (with configurable max size)
Signed share links with expiry
One-time share links
QR code generation for share links
File hash calculation (CRC32, MD5, SHA-1, SHA-256, SHA-512)
Sidecar checksum verification (
.md5,.sha1,.sha256,.sha512,.sfv)
WebDAV
Read-only WebDAV endpoint at
/webdav/(DAV Class 1)Supports
OPTIONS,PROPFIND,GET, andHEADmethodsCompatible with Windows Explorer, macOS Finder, and other WebDAV clients
Same security policies as the web UI (hidden paths, denied extensions, auth)
S3-Compatible API
Read-only S3 endpoint at
/s3/for scripted and programmatic accessCompatible with
aws cli,rclone, MinIO client, and other S3-compatible toolsAWS Signature V4 authentication (access key + secret key)
Supports
ListBuckets,GetBucketLocation,ListObjectsV2,GetObject,HeadObjectHTTP Range requests for partial downloads
Hidden paths, denied extensions, and auth enforced
Security & Operations
HTTP Basic Auth (username + password)
Bearer token auth via configurable header (for MCP clients, API consumers, automation)
External auth via reverse proxy headers (e.g. Authelia, Authentik)
Hide files by dotfile flag or glob patterns
Deny downloads by file extension
Fixed-window rate limiting (per-IP and global)
Health endpoints (
/health,/healthz,/readyz)In-memory dashboard at
/dashboardwith optional dedicated credentialsPrometheus metrics at
/metricsRESTful JSON API at
/api/(browse, search, share, archive)MCP server at
/mcp/(JSON-RPC 2.0, Streamable HTTP transport)Integration stats JSON at
/dashboard/statsDistroless chiseled container image
Configuration
Defaults are defined in src/DirForge/appsettings.json. Override any value with an environment variable of the same name. Boolean values must be true or false. For the full list of options, see .env.example.
Variable | Default | Description |
|
| Root directory to browse. |
|
| HTTP listen port. |
|
| IP address the app binds to. |
| unset | Basic Auth username. |
| unset | Basic Auth password. |
| unset | Bearer token for token-based auth (MCP clients, API consumers, automation). |
|
| Header to read the bearer token from. |
|
| Enable HMAC-signed share links. |
| empty | Secret for signing share links. Set a long random value in production; if empty an in-memory secret is generated at startup. |
|
| Hide entries starting with |
|
| Extensions blocked in direct and ZIP downloads. |
|
| UI theme ( |
|
| Custom page title/header label. |
|
| Read-only WebDAV at |
|
| Read-only S3 API at |
|
| RESTful JSON API at |
|
| MCP server at |
|
| Auto-calculate subdirectory sizes on page load (slow on large trees). |
|
| Cache TTL for computed directory sizes in seconds (0–2592000; 0 disables). |
|
| Directory listing cache TTL in seconds (1–2592000). |
Security
Hardened example profile - copy into your .env and adjust:
BasicAuthUser=admin
BasicAuthPass=change-this
BearerToken=replace-with-long-random-token
ShareSecret=replace-with-long-random-value
ForwardedHeadersKnownProxies=10.0.0.2
DashboardAuthUser=metrics
DashboardAuthPass=change-this-tooMount only directories you want to expose; prefer read-only mounts (
:ro).Baseline defaults are homelab-oriented, not internet-hardened.
Set
BasicAuthUser/BasicAuthPasswhen exposed outside a trusted network.Set
BearerTokenfor token-based auth (useful for MCP clients, API consumers, and automation that poorly support Basic Auth). Both auth methods can be enabled simultaneously, either one grants access.When
BearerTokenHeaderNameisAuthorization(default), the middleware acceptsAuthorization: Bearer <token>andAuthorization: <token>. Set a custom header name (e.g.X-API-Key) to read the raw token from that header instead.Set
ShareSecretto a long random value in production. If empty, DirForge uses an in-memory secret and share links reset on restart.For reverse proxy auth, set
ExternalAuthEnabled=trueand pinForwardedHeadersKnownProxies. Bearer token auth is also bypassed when external auth is enabled.Hidden paths and denied extensions are enforced for both direct downloads and ZIP output.
Dashboard and metrics data are in-memory only and reset on restart.
If
DashboardAuthUser/DashboardAuthPassare set,/dashboardand/metricsaccept only those credentials./dashboard/statsuses the same dashboard auth behavior: if dashboard credentials are configured, they are required.Static UI assets are served from
/dirforge-assets/*(plus/favicon.ico) and are intentionally public.
WebDAV
DirForge includes a read-only WebDAV endpoint at /webdav/ (DAV Class 1), enabled by default. It supports OPTIONS, PROPFIND, GET, and HEAD. All write methods return 405 Method Not Allowed.
Client Access
Client | Connection |
macOS Finder | Finder → Go → Connect to Server → |
Windows Explorer | Map Network Drive → |
Linux (GVFS) |
|
cadaver / curl |
|
Windows HTTP Limitation
Windows Explorer's WebDAV client (Mini-Redirector) refuses Basic Auth over plain HTTP by default. You must either:
Use HTTPS (via reverse proxy, recommended)
Set the registry key
HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevelto2and restart theWebClientservice
Security
WebDAV requests follow the same auth and security pipeline as the web UI:
Basic Auth or bearer token credentials are required when configured
External auth headers are honored when
ExternalAuthEnabled=trueHidden paths (
HideDotfiles,HidePathPatterns) and denied extensions (DenyDownloadExtensions) are enforcedPath traversal protection applies to all WebDAV paths
Set EnableWebDav=false to disable the endpoint entirely.
S3-Compatible API
DirForge includes a read-only S3-compatible endpoint at /s3/, disabled by default. It implements the minimal subset of the S3 API needed for listing and downloading files with standard S3 tools.
Supported Operations
Operation | Description |
|
|
|
|
|
|
|
|
|
|
All write operations (PUT, POST, DELETE) return 405 Method Not Allowed.
Authentication
S3 requests use AWS Signature V4 - the same signing protocol as real AWS S3. Your secret key is never sent over the wire; clients sign each request with an HMAC-based signature that the server verifies.
By default, the S3 endpoint reuses your BasicAuthUser / BasicAuthPass as access key / secret key. Set S3AccessKeyId and S3SecretAccessKey for dedicated S3 credentials.
Credentials are required - the app will not start with EnableS3Endpoint=true and no credentials configured.
Client Examples
aws cli:
export AWS_ACCESS_KEY_ID=mykey
export AWS_SECRET_ACCESS_KEY=mysecret
aws --endpoint-url http://localhost:8091/s3 s3 ls
aws --endpoint-url http://localhost:8091/s3 s3 ls s3://dirforge/
aws --endpoint-url http://localhost:8091/s3 s3 ls s3://dirforge/subdir/
aws --endpoint-url http://localhost:8091/s3 s3 cp s3://dirforge/file.txt .rclone:
rclone config create myremote s3 \
provider=Other \
endpoint=http://localhost:8091/s3 \
access_key_id=mykey \
secret_access_key=mysecret \
region=us-east-1
rclone ls myremote:dirforge
rclone copy myremote:dirforge/file.txt .Security
S3 requests bypass Basic Auth (they use SigV4 instead) but enforce all the same file-level policies:
Hidden paths (
HideDotfiles,HidePathPatterns) are not visibleDenied extensions (
DenyDownloadExtensions) return403 Access DeniedPath traversal and symlink containment checks apply
Set EnableS3Endpoint=false (default) to disable the endpoint entirely.
MCP (Model Context Protocol)
DirForge exposes an MCP endpoint at /mcp that lets AI assistants browse directories, read files, search by name or content, check hashes, find duplicates, get disk usage reports, and more. Requires EnableMcpEndpoint=true (default) and a BearerToken set in your DirForge config. All hide/deny/auth policies apply.
Setup (Claude Code, Codex, etc.)
Just ask your AI assistant:
"Add DirForge MCP server at http://localhost:8091/mcp with bearer token
changeme"
Then swap changeme for your actual BearerToken in a file config was added.
Symlinks and Hardlinks
DirForge follows symlinks but enforces strict containment: every symlink target must resolve to a path under RootPath. Links that escape the root are silently blocked.
Symlinks
When a request path contains a symlink, DirForge resolves it segment-by-segment. At each level, if a path component is a reparse point (symlink or junction), the final target is resolved and checked against RootPath. If the resolved target is outside the root, the entire path is rejected.
This means you can use symlinks freely inside your shared directory tree — for example, to present files from multiple physical locations under a single virtual layout — as long as every target points somewhere within RootPath.
During recursive operations (search, ZIP download, S3 listing), it tracks visited canonical paths to prevent infinite loops caused by circular symlinks. A directory that has already been visited (after symlink resolution) is skipped.
Hardlinks
Hardlinks are regular directory entries that share an inode with another file. They have no special metadata that distinguishes them from normal files, so DirForge treats them as ordinary files. Both names are listed and downloadable independently. There is no risk of escaping RootPath through hardlinks since they cannot point outside the filesystem they reside on, and they cannot reference directories.
Summary
Link Type | Followed | Root Containment | Cycle Protection |
Symlink | Yes | Enforced per-segment | Yes (visited set) |
Junction (Windows) | Yes | Enforced per-segment | Yes (visited set) |
Hardlink | N/A (treated as regular file) | N/A | N/A |
Integrations API
For homelab dashboards (Homarr, Homepage, etc.), DirForge exposes:
GET /dashboard/stats
The endpoint returns compact JSON with 11 basic fields:
generatedAtUtc, ready, uptimeSeconds, totalRequests, inFlightRequests, requestsPerMinute, averageLatencyMs, totalDownloadTrafficBytes, totalDownloadCount, fileCount, zipCount.
Contributing
See CONTRIBUTING.md.
Development
dotnet restore src/DirForge/DirForge.csproj
dotnet build src/DirForge/DirForge.csproj -c Release --no-restore
docker build -t dirforge:dev . # or: podman build -t dirforge:dev .Image Tags
Images are published to ghcr.io/dissimilis/dirforge.
Tag | When pushed | Use for |
| Every non-pre-release GitHub Release | Stable production use |
| Every GitHub Release | Pinned stable version |
| Every push to | Latest development build |
| Every push to | Pinned to a specific commit |
License
MIT. See LICENSE.
Third-Party Attribution
File icon vector set in
src/DirForge/wwwroot/file-icon-vectors/is attributed to dmhendricks.
Available Tools
21 toolscompare_directoriesA
Compare two directories side by side. Shows files only in the first, only in the second, files that differ, and identical files.
Inputs: path1 (required), path2 (required), maxDepth, include, +1 more.
diff_snapshotsA
Detect filesystem changes in a directory. On first call (without a previousToken), returns a snapshot token. On subsequent calls, pass the previous token to get a structured diff of added, removed, and modified files. The token is self-contained — no server-side state is stored.
Inputs: path, previousToken, maxDepth.
disk_usage_summaryA
Summarize total size, file count, and directory count for a path. Shows top subdirectories by size. Optionally filter by glob pattern to summarize only matching files.
Inputs: path, maxDepth, include, exclude.
find_largestA
Find the largest files under a directory, sorted by size descending.
Inputs: path, maxResults, maxDepth, include, +1 more.
find_largest_directoriesB
Find the largest directories by total recursive size, sorted by size descending.
Inputs: path, maxResults, maxDepth, exclude.
find_potential_duplicatesA
Find potential duplicate files by grouping files with identical sizes then hashing candidates. Uses XXH3-128 with 5 × 2 MiB probabilistic chunk sampling (first, last, and 3 pseudo-random interior chunks per file) — results are potential duplicates, not guaranteed exact matches.
Inputs: path, minSize, maxDepth, maxResults, +2 more.
find_recentB
Find the most recently modified files under a directory, sorted by date descending.
Inputs: path, maxResults, maxDepth, include, +1 more.
get_directory_treeA
Get a visual tree representation of a directory structure, similar to the 'tree' command.
Inputs: path, maxDepth, includeSizes.
get_file_hashesA
Compute CRC32, MD5, SHA1, SHA256, and SHA512 hashes of a file.
Inputs: path (required).
get_file_infoB
Get detailed metadata about a file including size, modification date, and MIME type.
Inputs: path (required).
group_tree_by_dateA
Summarize all files under a directory grouped by modification date buckets (Today, Yesterday, This week, This month, This year, Older).
Inputs: path.
group_tree_by_typeB
Summarize all files under a directory grouped by file extension, with counts and total sizes.
Inputs: path, maxDepth.
list_archive_entriesB
List files and directories inside an archive (ZIP, TAR, TAR.GZ). Supports browsing into subdirectories within the archive.
Inputs: archivePath (required), path.
list_directoryB
List contents of a directory. Returns file and folder names with sizes and modification dates.
Inputs: path.
read_archive_entryA
Read the text contents of a file entry inside an archive (ZIP, TAR, TAR.GZ).
Inputs: archivePath (required), entryPath (required), maxBytes.
read_fileA
Read the text contents of a file. Only works for text files within the size limit. Binary files (images, videos, executables, etc.) will be rejected.
Inputs: path (required), maxBytes, startLine, endLine.
searchC
Search for files and folders by name pattern.
Inputs: query (required), path, maxResults.
search_by_dateA
Find files modified within a date range. Supports before, after, or between. Results sorted by date descending.
Inputs: path, after, before, maxResults, +4 more.
search_by_sizeA
Find files within a size range. Supports min, max, or both. At least one of minSize or maxSize is required. Results sorted by size descending.
Inputs: path, minSize, maxSize, maxResults, +3 more.
search_contentA
Search for text inside files (grep-like). Returns matching lines with line numbers. Only searches text files.
Inputs: query (required), path, maxResults, maxFileSize.
verify_sidecarA
Verify a file's integrity against a sidecar checksum file. Looks for a sidecar file in the same directory as the target file by appending a hash extension (e.g. for 'movie.mkv' it checks 'movie.mkv.sha256', 'movie.mkv.md5', 'movie.mkv.sfv', etc.). Supported sidecar formats: .sha512, .sha256, .sha1, .md5 (and their *sum variants), and .sfv (CRC32). Returns the algorithm used, the expected hash from the sidecar, the freshly computed hash, and whether they match.
Inputs: path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Each tool has a clearly distinct purpose: compare directories, diff snapshots, disk usage summary, various find operations, tree visualization, file hashing, grouping, archive handling, searching, and integrity verification. No two tools overlap in functionality.
Tool names follow a consistent snake_case convention and mostly use verb_noun (e.g., compare_directories, find_largest). A minor deviation is 'disk_usage_summary' which is a noun phrase rather than a verb phrase, but overall the pattern is clear and predictable.
21 tools cover a comprehensive set of file system operations including listing, searching, comparing, archiving, hashing, and grouping. The count is well-scoped for a utility server without being overwhelming or sparse.
The tool set thoroughly covers analysis and inspection of directories and files (searching, comparing, archiving, hashing, grouping). However, it lacks write operations (create, delete, move, copy), which may be intentional for a read-only utility but leaves a notable gap for full file management.
Maintenance
Related MCP Connectors
Publish HTML, Markdown, and multi-file sites as shareable URLs instantly via MCP.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
Browse and manage files in your Moxt AI workspace from any MCP client.
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to safely explore directories, read files, search content by pattern or filename, and edit files with checksum verification and dry-run preview within sandboxed filesystem access.76MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides file and directory tools for LLMs, including project structure analysis, file reading, and project context resources, with support for .gitignore patterns.MIT
- AlicenseBqualityDmaintenanceA secure, read-only MCP server for browsing and searching files in a specified directory with path traversal protection and .gitignore support.3MIT
- AlicenseNot gradedqualityAmaintenanceThis self-hosted MCP server connects an MCP client such as ChatGPT to approved local project folders, enabling file reading and editing, code search, shell command execution, and Git worktree workflows without uploading code to a third party. It also supports mounting external stdio or Streamable HTTP MCP servers as dynamic capabilities.482 npmMIT