
Virtual Filesystem
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 toolsPublic 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*secretPostgreSQL connection string (e.g. postgresql://user:pass@host:5432/dbname)
VFS_AUTO_INITAuto-create database tables on startup (set to 'true' for first run)
VFS_SESSION_IDDeterministic session ID for resumable sessions across restarts
VFS_ENABLE_RLSEnable PostgreSQL Row Level Security for database-enforced session isolation
Readme
mcp-virtual-fs
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
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