Virtual MCP Server

PostgreSQL-backed virtual filesystem for AI agents with persistent, session-isolated storage.

Local serverstdioTypeScript

What is the Virtual MCP server?

Virtual MCP server exists for a simple reason — assistants are far more useful when they can act on Virtual directly instead of describing what you should do. PostgreSQL-backed virtual filesystem for AI agents with persistent, session-isolated storage.

What you get

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

  • 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 (**/*.ts) or search content by regex, powered by PostgreSQL trigram indexes
  • Row Level Security — — optional database-enforced isolation between sessions for multi-tenant deployments

What the assistant can call

Once Virtual is connected, these are the calls the assistant has available:

  • read — path
  • write — path, content
  • append — path, content
  • stat — path
  • mkdir — path
  • glob — pattern
  • grep — pattern, path_filter?
  • stores(none)
  • Requirements — The Requirements tool exposed by this server
  • Commands — The Commands tool exposed by this server
  • Testing — Tests use testcontainers to spin up real PostgreSQL instances in Docker. No mocks — the integration tests

Configuration and credentials

You will need 4 environment variables: DATABASE_URL, VFS_AUTO_INIT, VFS_SESSION_ID, VFS_ENABLE_RLS. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js 20 or later - PostgreSQL 14 or later (with pg_trgm extension — included in most distributions)

Setting it up

Installation goes through your MCP client rather than a global install: point it at npm on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Choosing this one

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Virtual's toolset — read, write, append and 8 more — is a fair guide to whether it matches your workflow. It is maintained by lu-zhengda; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Virtual.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the virtual mcp server does with a few real requests.

Available tools

ToolWhat it does
readpath
writepath, content
appendpath, content
statpath
mkdirpath
globpattern
greppattern, path_filter?
stores*(none)*
RequirementsThe Requirements tool exposed by this server.
CommandsThe Commands tool exposed by this server.
TestingTests use [testcontainers](https://node.testcontainers.org/) to spin up real PostgreSQL instances in Docker. No mocks — the integration tests exercise actual SQL queries, trigram indexes, and RLS policies.

How to install the Virtual MCP server

{
  "mcpServers": {
    "virtual-fs": {
      "command": "npx",
      "args": ["-y", "npm"],
      "env": {
        "DATABASE_URL": "your-value",
        "VFS_AUTO_INIT": "your-value",
        "VFS_SESSION_ID": "your-value",
        "VFS_ENABLE_RLS": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Node.js 20 or later - PostgreSQL 14 or later (with pg_trgm extension — included in most distributions)
VariableDescriptionRequired
DATABASE_URLEndpoint or connection string the server talks to.Yes
VFS_AUTO_INITConfiguration value read at startup.Optional
VFS_SESSION_IDConfiguration value read at startup.Optional
VFS_ENABLE_RLSConfiguration value read at startup.Optional

Example prompts to try

  • Use Virtual to read.
  • Use Virtual to write.
  • Use Virtual to append.

Frequently asked questions

It connects Virtual to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (read, write, append, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Virtual directly.