lu-zhengda avatar

Virtual Filesystem

lu-zhengda/mcp-virtual-fs

Gives AI agents a PostgreSQL-backed virtual filesystem with session isolation and cross-session shared stores. Exposes 11 POSIX-style tools like read, write, append, mkdir, rm, mv, plus glob and grep for searching. Each agent session gets its own namespace automatically, but you can use named stores to share files between sessions or persist agent memory long-term. Handles the common problem where agent workspace data disappears when containers restart. Supports Row Level Security for multi-tenant setups. Works with Claude Desktop, Cursor, Windsurf, and other MCP clients. Set VFS_AUTO_INIT=true and point it at Postgres to get started.

GitHub stars
2
tools
11
auth
Secret needed
transport
STDIO
env vars
4
last updated
Feb 11, 2026

Tools

11 tools

Public tool metadata for what this MCP can expose to an agent.

readRead file contents

Read file contents

No parameter schema in public metadata yet.

writeWrite file (creates parents automatically)

Write file (creates parents automatically)

No parameter schema in public metadata yet.

appendAppend to file (creates if missing)

Append to file (creates if missing)

No parameter schema in public metadata yet.

statCheck existence and get metadata

Check existence and get metadata

No parameter schema in public metadata yet.

lsList directory (dirs first, then alphabetical)

List directory (dirs first, then alphabetical)

No parameter schema in public metadata yet.

mkdirCreate directory and parents (mkdir -p)

Create directory and parents (mkdir -p)

No parameter schema in public metadata yet.

rmRemove file or directory recursively

Remove file or directory recursively

No parameter schema in public metadata yet.

mvMove/rename file or directory

Move/rename file or directory

No parameter schema in public metadata yet.

globFind files by glob (e.g., `**/*.ts`, `**/*.{js,ts}`)

Find files by glob (e.g., `**/*.ts`, `**/*.{js,ts}`)

No parameter schema in public metadata yet.

grepSearch file contents by regex

Search file contents by regex

No parameter schema in public metadata yet.

storesList all persistent store names

List all persistent store names

No parameter schema in public metadata yet.

Sponsors

Configuration

DATABASE_URL*secret

PostgreSQL connection string (e.g. postgresql://user:pass@host:5432/dbname)

VFS_AUTO_INIT

Auto-create database tables on startup (set to 'true' for first run)

VFS_SESSION_ID

Deterministic session ID for resumable sessions across restarts

VFS_ENABLE_RLS

Enable PostgreSQL Row Level Security for database-enforced session isolation

Readme

mcp-virtual-fs

npm version CI npm downloads License: MIT Node.js

An MCP server that provides AI agents with a persistent, PostgreSQL-backed virtual filesystem. Supports session-isolated file operations, cross-session shared stores, glob/grep search, and Row Level Security — all exposed as standard Model Context Protocol tools.

Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, Cline, and others.

Features


View the full README on GitHub

Details

Repository
github.com/lu-zhengda/mcp-virtual-fs
Website
github.com/lu-zhengda/mcp-virtual-fs#readme
Categories
Databases, Developer Tools
Package
mcp-virtual-fs
Transport
STDIO
Auth
Required
Registry
MCP registry, active

More from lu-zhengda

Related Databases MCP servers

View all
1shrike-security avatarShrikeshrike-security/shrike-mcpGoverns what AI agents do: tool calls, SQL, commands, files checked against policy before they run.2stars
2alyiox avatarClickHousealyiox/mcp-clickhousexRead-only MCP server for ClickHouse metadata, parameterized queries, and plan analysis.1stars
3arpe-io avatarFastbcp Mcparpe-io/fastbcp-mcpMCP server for FastBCP — high-performance parallel database export to files and cloud1stars
4arpe-io avatarLakexpress Mcparpe-io/lakexpress-mcpMCP server for LakeXpress — automated database-to-cloud data pipeline as Parquet1stars
5bch1212 avatarQueryshieldbch1212/queryshieldSecure SQL proxy for AI agents — NL→SQL, AST safety, per-agent RLS, audit log.1stars
6boyce-io avatarBoyceboyce-io/boyceDeterministic SQL compiler for AI agents. Your agent stops guessing SQL.1stars