Skip to main content

Postgres MCP server — agent-first database workbench

Project description

Tabulus

A Postgres MCP server built for AI agents.

Tabulus 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. Tabulus 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. The 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.
  • Opt-in PII redactor (TABULUS_REDACT=on) scrubs emails, API keys, JWTs, credit cards, phones, and IPs from tool output before the agent sees them.

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
tabulus

Then point your MCP client at the tabulus command.

Claude Code (project-level)

Create .mcp.json in your project root:

{
  "mcpServers": {
    "tabulus": {
      "command": "tabulus",
      "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 tabulus "$(which tabulus)" --env DATABASE_URL=postgres://user:pass@host:5432/dbname

Cursor

Add to ~/.cursor/mcp_servers.json:

{
  "mcpServers": {
    "tabulus": {
      "command": "tabulus",
      "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
TABULUS_MAX_ROWS 100 Hard cap on rows returned by any tool
TABULUS_SAMPLE_SIZE 3 Sample rows included in describe_schema
TABULUS_STATEMENT_TIMEOUT_MS 5000 Server-side query timeout
TABULUS_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.
TABULUS_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.3.tar.gz (13.8 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.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabulus-0.0.3.tar.gz
  • Upload date:
  • Size: 13.8 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.3.tar.gz
Algorithm Hash digest
SHA256 6acac518a615ae590656b971ae2a7234c4d2ce16f46abb81d22943657cee2014
MD5 c7891a6b3ae2eb0a6507c3a5e7717eee
BLAKE2b-256 a2ab9f77b707a877fae8883854b4cbb0e010d05b840d0030457b8c1689b32cc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulus-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: tabulus-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77f85a74563a711cb3e8e4513a4c01f4a466ec5d6f676d1b1a0cc3ca16fe21b9
MD5 0a10015a6185bd89bbd9ee154c1eb5ae
BLAKE2b-256 18ab84b80845494343b58928d24431f1bc4560faa5e18829ac5da266c635844a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabulus-0.0.3-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