Virtual Filesystem

Created By
lu-zhengda4 months ago
An MCP server that provides AI agents with a persistent, PostgreSQL-backed virtual filesystem. Supports session-isolated file operations, cross-session shared stores, 11 POSIX-style tools (read, write, ls, mkdir, rm, mv, glob, grep, etc.), and optional Row Level Security for multi-tenant deployments. Works with Claude Desktop, Claude Code, Cursor, Windsurf, Cline, and any MCP client.
Overview

Features

  • Persistent file storage — files are stored in PostgreSQL and survive process restarts, container recycling, and redeployments
  • Session isolation — each agent session gets its own namespace automatically, no configuration needed
  • Cross-session stores — named persistent stores for sharing data between agents or for long-term agent memory
  • 11 POSIX-style tools — read, write, append, stat, ls, mkdir, rm, mv, glob, grep, stores
  • Glob and grep search — find files by pattern or search content by regex, powered by PostgreSQL trigram indexes
  • Row Level Security — optional database-enforced isolation between sessions for multi-tenant deployments
  • Zero config — auto-creates tables on first run with VFS_AUTO_INIT=true

Use Cases

  • Agent scratchpad — persistent workspace to read/write files across tool calls
  • Long-term agent memory — store notes, context, and knowledge across sessions
  • Multi-agent collaboration — multiple agents share files through cross-session stores
  • Sandboxed file operations — agents interact with a virtual filesystem instead of the host OS

Quick Start

  1. Run PostgreSQL (e.g. docker run -d -e POSTGRES_DB=vfs -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:16-alpine)
  2. Add the server config to your MCP client
  3. Start using tools: write, read, ls, glob, grep, etc.

Environment Variables

| Variable | Required | Description | |--------|--------| | DATABASE_URL | Yes | PostgreSQL connection string | | VFS_AUTO_INIT | No | Auto-create tables on startup | | VFS_SESSION_ID | No | Deterministic session ID for resumable sessions | | VFS_ENABLE_RLS | No | Enable Row Level Security |

Server Config

{
  "mcpServers": {
    "virtual-fs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-virtual-fs"
      ],
      "env": {
        "DATABASE_URL": "<YOUR_POSTGRESQL_CONNECTION_STRING>",
        "VFS_AUTO_INIT": "true"
      }
    }
  }
}
Project Info
Created At
4 months ago
Updated At
4 months ago
Author Name
lu-zhengda
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Gpt Scrambler

2 days ago