Skip to main content

Postgres MCP server — agent-first database workbench

Project description

Vigil

A Postgres MCP server built for AI agents.

Vigil is the database workbench for the AI-augmented developer. Connect Claude Code, Cursor, or any MCP-compatible client to your Postgres database and let the agent introspect the schema, sample data, and write safe queries — without copy-pasting schemas into chat windows.

Why

Every modern dev workflow now includes an AI agent. Every DB GUI was designed before that was true. Vigil flips the model: the agent is a first-class user, not a sidebar feature.

What that means in practice:

  • Schema introspection optimized for LLM context windows (compact JSON, foreign keys flattened, sample rows inline).
  • Read-only by default — INSERT/UPDATE/DELETE/DDL are rejected at the gateway. Agent can't drop your tables.
  • EXPLAIN exposed as a tool so the agent can reason about query plans before proposing optimizations.
  • Statement timeout + row cap enforced server-side. No agent can DOS your database by accident.

Status

v0.0.1 — alpha. Postgres only. Stdio MCP transport only. No GUI yet.

Install

pip install tabulus

Run

export DATABASE_URL=postgres://user:pass@host:5432/dbname
vigil

Then point your MCP client at the vigil command.

Claude Code (project-level)

Create .mcp.json in your project root:

{
  "mcpServers": {
    "vigil": {
      "command": "vigil",
      "args": [],
      "env": {
        "DATABASE_URL": "postgres://user:pass@host:5432/dbname"
      }
    }
  }
}

Restart Claude Code in that directory and approve the trust prompt.

Claude Code (user-level via CLI)

claude mcp add vigil "$(which vigil)" --env DATABASE_URL=postgres://user:pass@host:5432/dbname

Cursor

Add to ~/.cursor/mcp_servers.json:

{
  "mcpServers": {
    "vigil": {
      "command": "vigil",
      "env": { "DATABASE_URL": "postgres://user:pass@host:5432/dbname" }
    }
  }
}

Tools

Tool Description
list_tables All tables with row count estimates + sizes
describe_schema Columns, PK, FKs, indexes, sample rows for a table
sample_rows Random sample from a table
safe_select Run a read-only SELECT (write keywords rejected)
explain Get query plan (EXPLAIN FORMAT JSON)

Configuration

Variable Default Purpose
DATABASE_URL — (required) Postgres connection URL
VIGIL_MAX_ROWS 100 Hard cap on rows returned by any tool
VIGIL_SAMPLE_SIZE 3 Sample rows included in describe_schema
VIGIL_STATEMENT_TIMEOUT_MS 5000 Server-side query timeout
VIGIL_REDACT off Set on to scrub PII (emails, API keys, JWTs, credit cards, phones, IPs) from sample_rows, safe_select, and describe_schema output before the agent sees it. Recommended for production.
VIGIL_ALLOW_WRITES false Set true to disable the write block (NOT recommended)

Roadmap

  • v0.1 — Postgres parity, polished install
  • v0.2 — SQLite adapter
  • v0.3 — MySQL / MariaDB adapter
  • v0.x — Tauri desktop GUI shell on top of the same core
  • v1.0 — Stable, cross-platform, multi-DB

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabulus-0.0.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabulus-0.0.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file tabulus-0.0.1.tar.gz.

File metadata

  • Download URL: tabulus-0.0.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tabulus-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0731aceb4352e246dde5e0a335189066292691c22d4ff50af70f54e30b88192c
MD5 3acb774df7e0bca56b9257b246d19e8d
BLAKE2b-256 cfde78110a854ef223107328095b61e1b360e9041e598110574a6cb20a03258d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulus-0.0.1.tar.gz:

Publisher: publish.yml on WalkingMountain/tabulus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tabulus-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tabulus-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tabulus-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8aec9c0bcf604129ea7ae0042a1efff628233027252bf77109cdbee056947855
MD5 bd5f9e0671e0fd249776690f576697ee
BLAKE2b-256 63d262c84a23c12b839632c6e0158f41e61d622e4d357809cde1d47cf4a39284

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulus-0.0.1-py3-none-any.whl:

Publisher: publish.yml on WalkingMountain/tabulus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page