Virtual Fs logo

Virtual Fs

PostgreSQL-backed virtual filesystem with session isolation, persistent stores, and POSIX-style file search tools.

Install Virtual Fs

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "virtual-fs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-virtual-fs"
      ],
      "env": {
        "DATABASE_URL": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y mcp-virtual-fs

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 2d ago.

Overview

The virtual-fs MCP server gives agents a PostgreSQL-backed virtual filesystem for persistent file operations without accessing the host filesystem. It exposes tools for reading, writing, appending, listing, moving, deleting, searching, and inspecting files, with automatic parent creation and structured JSON responses. Sessions receive separate namespaces automatically, while named stores support data shared across sessions or retained as agent memory. Use it when an agent needs durable scratch space, searchable artifacts, or isolated file storage across restarts.

Use cases

  • Give agents persistent scratch space
  • Store long-term agent notes in named stores
  • Share files between multiple agent sessions
  • Persist CI/CD artifacts and reports
  • Search stored files by glob or regex

Key features

  • PostgreSQL-backed persistent file storage
  • Automatic session-isolated namespaces
  • Cross-session named stores
  • POSIX-style file and directory operations
  • Glob and regex content search
  • Optional PostgreSQL Row Level Security

Tools11

What Virtual Fs lets your agent do. Expand a tool for its parameters.

Self-reported~108 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

5/5 checks healthy over the last 36d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · mcp-virtual-fs (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads159Package downloads in the last 30 days.
Last commit8mo agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Tools exposed11Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Virtual Fs works

What virtual-fs does

The virtual-fs MCP server presents a file-oriented interface backed by PostgreSQL. Agent operations are stored in the database rather than on the machine running the MCP process, so files remain available after process restarts, container recycling, and redeployments. The server is suitable for agent scratch work, persistent notes, build outputs, logs, reports, and other data that benefits from a filesystem-shaped API.

Each connection gets a session namespace by default. This keeps one agent session's files separate from another session's files without requiring a session argument in every tool call. Named stores provide an alternative namespace for information that should be shared between sessions or kept as longer-term memory.

How it works

The virtual-fs MCP server uses PostgreSQL as its storage backend and requires PostgreSQL 14 or newer with the pg_trgm extension. Node.js 20 or later is also required. The server can initialize its tables on startup when VFS_AUTO_INIT=true; otherwise, the schema can be applied manually with the supplied SQL file.

Session identity depends on the transport and configuration. Stdio connections receive a generated UUID for each process, while HTTP/SSE connections use the transport-provided MCP session ID. Setting VFS_SESSION_ID provides a deterministic or resumable identity, but transport session identity has priority. Passing a store parameter switches an operation from the current session namespace to a named persistent store. Stores are created when first used, and the stores tool lists their names.

Optional PostgreSQL Row Level Security can add database-enforced isolation for multi-tenant deployments. RLS requires applying the provided RLS SQL and configuring the server with an appropriate database role.

Setup and configuration

Provide DATABASE_URL in the MCP client's environment. A typical configuration runs the package with npx, points it at PostgreSQL, and sets VFS_AUTO_INIT=true for first-run table creation. Manual schema management is also supported with psql $DATABASE_URL -f sql/schema.sql.

Available environment variables include:

  • DATABASE_URL: PostgreSQL connection string; required.
  • VFS_AUTO_INIT: creates tables at startup when enabled; defaults to false.
  • VFS_SESSION_ID: optional deterministic session identifier.
  • VFS_ENABLE_RLS: enables Row Level Security when set up in the database; defaults to false.
  • VFS_STORAGE_BACKEND: selects the storage backend and defaults to postgres.

Tools and capabilities

The virtual-fs MCP server exposes these tools:

  • read returns file content and size.
  • write creates or replaces a file and creates missing parent directories.
  • append adds content to a file or creates it when absent.
  • stat reports whether a path exists and returns available metadata.
  • ls lists directory entries, placing directories first and sorting alphabetically.
  • mkdir creates a directory and any missing parents.
  • rm removes a file or recursively removes a directory.
  • mv moves or renames a file or directory.
  • glob finds paths using patterns such as **/*.ts or brace extensions.
  • grep searches file contents with a regular expression and can accept a path filter.
  • stores lists persistent store names.

All tools except stores accept the optional store parameter. Responses use structured JSON, which lets an agent inspect results such as file sizes, match counts, directory entries, and deletion status.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Virtual Fs

virtual-fs is an MCP server that connects AI agents to a persistent PostgreSQL-backed virtual filesystem. Its main tools read, write, append, stat, ls, mkdir, rm, mv, glob, grep, and stores support file operations, directory management, pattern discovery, regex search, and named cross-session stores.

Install and run it through an MCP client with `npx -y mcp-virtual-fs`. Configure `DATABASE_URL` for PostgreSQL, and set `VFS_AUTO_INIT=true` if the server should create its tables automatically on first startup. Node.js 20+ and PostgreSQL 14+ are required.

Yes, virtual-fs works with Cursor. Add it to Cursor's MCP configuration using the `npx` command and provide the required PostgreSQL connection string in the server environment.

virtual-fs assigns each MCP connection a separate namespace automatically. Stdio uses a generated process UUID, HTTP/SSE uses the transport session ID, and `VFS_SESSION_ID` can provide a deterministic identity. Named stores are available when sessions need to share data.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewVirtual Fs AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/virtual-fs?style=directory)](https://allmcps.com/mcp/virtual-fs)
HTML Embed
<a href="https://allmcps.com/mcp/virtual-fs"><img src="https://allmcps.com/api/badge/virtual-fs?style=directory" alt="Virtual Fs on AllMCPs" /></a>