pgcow
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
pgcow
One line: npx pgcow branch feat-a --allow-write (or bunx pgcow branch feat-a --allow-write): instant local data-directory branches via OS copy-on-write, aligned with git checkout.
What it is (and is not)
pgcow branches an on-disk app data directory (SQLite files, seeds, local vector indexes) under .pgcow/work/. It does not manage a live PostgreSQL PGDATA cluster (no PG_VERSION lifecycle, no running server handoff). Point --data-dir at whatever folder your tool reads; pgcow keeps per-git-branch copies cheap.
Related MCP server: conversation-branch
Why
database-lab-engine (dblab): ZFS/LVM thin clones on dedicated Linux hosts, not
npxorbunxon a laptop.Neon / Snaplet: Cloud or slow dump workflows, not offline folders on disk.
pgcow clones trees with clonefile / reflink / hardlink fallbacks, then junctions or symlinks the active --data-dir to the selected branch work tree (no full-directory copy on checkout when linking works).
Windows
Checkout uses directory junctions (mklink /J semantics via Node symlink type junction). Junctions require the work tree and --data-dir to live on the same volume; cross-volume paths fall back to copying on first init only.
Install
bunx pgcow init --data-dir ./pgdata
npx pgcow init --data-dir ./pgdata
# or install in your project / globally
bun add -d pgcow
npm i -D pgcowJSR:
bunx jsr add @kanchingyg/pgcow
npx jsr add @kanchingyg/pgcowcargo install --git https://github.com/kanchingyg/pgcowThe core engine is Rust (src/lib.rs, src/main.rs, src/mcp.rs). TypeScript under src/*.ts is included for npx / bunx / JSR usage and MCP bridge helpers.
Quick start
pgcow init --data-dir ./pgdata
pgcow branch feat-a --allow-write
pgcow checkout main
pgcow reset --allow-write
pgcow sync-git --allow-write # maps git branch names; slashes become filesystem slugsMCP + local models
npx pgcow --mcp --allow-write
bunx pgcow --mcp --allow-writeRegister in Cursor, Claude Code, or Ollama-driven agents so each session can create_db_branch without duplicating gigabytes on disk.
Flags
Flag | Purpose |
| Enable branch create/reset (default read-only) |
| Probe CoW / show restore plan |
| Active data directory (default |
| JSON-RPC MCP server on stdio |
MCP Tools Reference
Tool | Mutates | Description |
|
| Clone the active data directory into |
|
| Point the active |
|
| List all local data branches and identify the currently linked branch. |
|
| Reset the active branch data directory back to its base snapshot (requires |
Editor and Agent Integration
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"pgcow": {
"command": "npx",
"args": ["-y", "pgcow", "--mcp"]
}
}
}Claude Code CLI
claude mcp add pgcow -- npx -y pgcow --mcpProgrammatic Usage (JSR / TypeScript)
import * as bridge from "jsr:@kanchingyg/pgcow/bridge";Runtime Safety and Guardrails
Stdio frame isolation: When
--mcpis active,hijackStdoutForMcp()redirects accidentalconsole.logcalls tostderrso JSON-RPC 2.0 frames onstdoutnever corrupt.Read-only by default: Mutating tools (
mutates: true) are blocked in--dry-runmode and require explicit--allow-writeauthorization.Loop breaker: Repeated identical
(toolName, args)invocations are hashed with SHA-256 and halted after 3 consecutive repeats to prevent runaway agent loops.Context budget truncation: Tool outputs are middle-truncated (
60%head /40%tail) scaled to the probed local modeln_ctx(Ollama/api/show, llama.cpp/props, vLLM/v1/models).Secret redaction and path normalization: AWS keys (
AKIA*,ASIA*), bearer tokens, andsk-*keys are scrubbed before returning tool output, and Windows drive paths (C:\...) translate cleanly to/mnt/c/...when WSL mode is enabled.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Git-backed platform for skills, tools, and context for AI agents
Supabase-compatible Postgres for agents: projects, branches, SQL, auth, storage, email.
Runnable, versioned lists for agents: tools, prompts and lists as resources. Git under the hood.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceManages isolated Git worktrees for each ZCode thread, enabling safe parallel development with automatic setup, snapshot-based removal, PR review, and background agent orchestration.4MIT
- AlicenseAqualityBmaintenanceEnables git-branch-style A/B experimentation for long-running tasks, allowing users to create, compare, promote, discard, or roll back parallel conversation branches via MCP tools.15Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to checkpoint, diff, search, branch, merge, and restore intermediate states of pending Perforce changelists without submitting them. Each snapshot is stored as a local Git commit outside the Perforce workspace, so agents can commit milestones automatically and roll files back to earlier revisions.MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code, Codex, Cursor, and other MCP clients to run agent file edits and shell commands inside isolated copy-on-write workspace branches guarded by a kernel-level macOS Seatbelt sandbox. Exposes tools to inspect status, diff, merge branches, and apply changes back to the real project folder only on explicit request.MIT