Skip to main content

Tusk

PostgreSQL admin and SQL studio with an AI copilot and light analytics — one process, one browser tab.

Tusk is what you open every day to work with your Postgres: a multi-tab SQL editor, a schema map, a table profiler, the admin console (processes, locks, backups, roles, settings), dashboards, scheduled jobs with notifications, and an AI copilot grounded in your real schema. Agents can use it too: Tusk is an MCP server, read-only, with the same permissions as the person whose token they carry.

Documentation · Changelog · Roadmap

Built with Claude Code (Anthropic).

Tusk Studio

What's inside

Tab What it does
Studio Multi-tab SQL editor (CodeMirror 6, autocomplete from your schema), results as table / chart / map, EXPLAIN with an AI reading of the plan, saved queries and history, per-connection colours, one-click table preview.
Schema Interactive diagram of tables and foreign keys. Hosts Schema Watch (snapshot + diff of the catalog, notifications on drift) and Data Contracts (freeze the schema you depend on; be told when it breaks).
Explore Profile any table: per-column stats, null rates, distinct counts, histograms.
Admin Server dashboard, active queries with kill, locks and blocking chains, settings, extensions, roles, VACUUM/ANALYZE/REINDEX, backup and restore with pg_dump.
Analytics Dashboards and charts on top of your connections, with auto-detected chart types. Built in since 0.4.36.
Scheduled Backups (with retention), VACUUM/ANALYZE, queries with saved results, pipelines and schema checks on a cron, interval or one-shot trigger.
Notifications Slack, Discord, Telegram, email or webhook for job, backup, schema and contract events.
Data Small visual ETL with Polars: files, Postgres, open data → filter / join / aggregate → export, import into Postgres or save as a pipeline.
AI Copilot Ask in plain language, get SQL grounded in the actual catalog; explain a plan; runs against your own provider (Ollama, OpenAI-compatible, Anthropic).
MCP server POST /mcp: Claude Code, Cursor or any MCP client can list connections, read schemas, run read-only queries and check schema changes — audited, permission-scoped.
Users & tokens Single-user mode by default; multi-user mode with groups, sessions, personal API tokens and an audit log.
Desktop window tusk app opens Studio in a native window (preview).

Screenshots of every page are in the docs and in docs/screenshots/.

Install

Python 3.13.

pip install "tuskdata[all]"        # Studio + PostgreSQL + admin tooling (recommended)
pip install "tuskdata[studio]"     # Web UI only
pip install "tuskdata[app]"        # + native window (pywebview)

tusk studio                        # http://127.0.0.1:8000

From source:

git clone https://github.com/tuskdata/tuskdata.git
cd tuskdata
uv pip install -e ".[all]"

Container: docker compose up --build uses the in-repo Dockerfile (python:3.13-slim, port 8000, healthcheck on /api/health). Tusk runs as one process with its state in ~/.tusk; see Deploying on Kubernetes and ADR 0001 for why there is exactly one replica.

Quick start

tusk studio                         # local, single-user, binds 127.0.0.1
tusk studio --host 0.0.0.0 -p 3000  # on a server (put it behind TLS)
tusk app                            # native window (preview)

Add a connection on the Home page, open Studio, run a query. ⌘K / Ctrl+K jumps anywhere.

Multi-user mode

tusk auth enable
tusk auth init                      # admin user + default groups
tusk studio

Personal API tokens (for MCP clients, scripts, CI) are created in Profile → API tokens or with tusk auth token create <user> <name> --expires-days 90. A token is the user: same connections, same permissions.

Connect an AI agent

claude mcp add --transport http tusk http://127.0.0.1:8000/mcp
# multi-user: add --header "Authorization: Bearer tusk_..."

Tools: list_connections, get_schema, run_query (read-only, capped), explain_query, schema_changes, contract_status, list_saved_queries, run_saved_query. Every call lands in the audit log.

CLI

tusk studio [--host H] [--port N] [--pg-bin-path P]   Start the web studio
tusk app [--url URL] [--port N]                        Studio in a native window (preview)
tusk config show | set KEY VALUE                       Configuration
tusk users list | create | delete | reset-password     User management (multi-user)
tusk auth enable | disable | init                      Auth mode
tusk auth token create | list | revoke                 Personal API tokens
tusk ai stats [--days N] [--verbose]                   Copilot hit-rate report
tusk plugins                                           Installed plugins
tusk features                                          Installed optional features
tusk version

Where things live

~/.tusk/
├── config.toml          # settings (also editable in Settings → Studio)
├── connections.toml     # saved connections
├── tusk.db              # everything Tusk keeps about itself: users, sessions, API
│                        # tokens, audit, query history, saved queries, AI memory,
│                        # notifications, scheduled jobs and runs, schema snapshots,
│                        # contracts, admin stats history
├── backups/             # pg_dump output
├── scheduled_results/   # saved query results from jobs
├── schema_layouts/      # Schema diagram positions, per connection and user
├── workspaces/          # Data page state
└── plugins/             # per-plugin SQLite + TOML (tusk_bi.db, …)

Environment knobs worth knowing: TUSK_ADMIN_ALLOW_LAN=1 (admin endpoints from a trusted LAN in single-user mode), TUSK_ALLOW_PRIVATE_WEBHOOKS=1 (webhooks to private addresses, dev only).

Plugins

Analytics ships inside the package as a built-in plugin; the same mechanism is open to third parties. A plugin is a Python package exposing a TuskPlugin subclass through the tusk.plugins entry point; it gets a tab, routes, templates, static files, isolated SQLite storage, CLI commands, scheduled-job kinds and notification events.

from pathlib import Path
from tusk.plugins.base import TuskPlugin

class MyPlugin(TuskPlugin):
    name = "tusk-myplugin"
    version = "0.1.0"
    tab_label = "My Plugin"
    tab_icon = "puzzle"                      # Lucide icon

    def get_templates_path(self) -> Path | None:
        return Path(__file__).parent / "templates"

    def get_route_handlers(self) -> list:
        from .routes import MyPageController
        return [MyPageController]
[project.entry-points."tusk.plugins"]
myplugin = "my_plugin:MyPlugin"

Plugin templates extend base.html and can use the macro library in templates/components/ (badge, modal, alert, empty_state, stat_card, form fields, status dots, map and pipeline canvas). The macros carry no colours: they map to the design tokens, so they follow the light/dark theme.

tusk-cluster (distributed queries with DataFusion + Arrow Flight) exists as a separate plugin and is currently paused.

Tech stack

Litestar 2 · Granian · MiniJinja · msgspec · Tailwind · Alpine.js + HTMX · Lucide · CodeMirror 6 · MapLibre GL · psycopg 3 · DuckDB · Polars · structlog · litestar-mcp.

Development

uv pip install -e ".[all]" --group dev
pytest tests/ -q                            # unit + API tests; e2e need `playwright install chromium`
python scripts/demo_db.py                   # synthetic demo database (needs local Postgres)
python scripts/docs_screenshots.py          # regenerate docs/screenshots/
mkdocs serve                                # docs at http://127.0.0.1:8000/tuskdata/

Code, comments, commits and docs are in English. Bugs found while a release is being prepared go into that release, not a hotfix.

License

MIT — © 2026 Jearel Alcantara

Download files

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

Source Distribution

tuskdata-0.4.43.tar.gz (565.0 kB view details)

Uploaded Source

Built Distribution

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

tuskdata-0.4.43-py3-none-any.whl (675.3 kB view details)

Uploaded Python 3

File details

Details for the file tuskdata-0.4.43.tar.gz.

File metadata

  • Download URL: tuskdata-0.4.43.tar.gz
  • Upload date:
  • Size: 565.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tuskdata-0.4.43.tar.gz
Algorithm Hash digest
SHA256 4ab985869a81ce59d994cfe6a087498a666ce28013955f1a9864cfe71b15efc0
MD5 d445e8b26f4fb3023f828a133b04d2bd
BLAKE2b-256 ce3d2e2947d449e93bbf5f760f55ad6228249d178662969d25f061a5e2308f0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tuskdata-0.4.43.tar.gz:

Publisher: publish.yml on tuskdata/tuskdata

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

File details

Details for the file tuskdata-0.4.43-py3-none-any.whl.

File metadata

  • Download URL: tuskdata-0.4.43-py3-none-any.whl
  • Upload date:
  • Size: 675.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tuskdata-0.4.43-py3-none-any.whl
Algorithm Hash digest
SHA256 e5b2a72934cf637626afdaab5c8a7405707cba51262e8c8ccafad322f3ca2209
MD5 6fdb7d56c6fe010111e5ad6cb2584434
BLAKE2b-256 abaf7c092bad94f6d554d0d8ed9c0f8439cbb78f83f17546ca4887e425a9ae43

See more details on using hashes here.

Provenance

The following attestation bundles were made for tuskdata-0.4.43-py3-none-any.whl:

Publisher: publish.yml on tuskdata/tuskdata

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

Release history Release notifications | RSS feed

0.4.47

2 files

0.4.46

2 files

0.4.45

2 files

0.4.44

2 files

This release

0.4.43 This release

2 files

0.4.42

2 files

0.4.41

2 files

0.4.40

2 files

0.4.39

2 files

0.4.38

2 files

0.4.37

2 files

0.4.36

2 files

0.4.35

2 files

0.4.34

2 files

0.4.33

2 files

0.4.32

2 files

0.4.31

2 files

0.4.30

2 files

0.4.29

2 files

0.4.27

2 files

0.4.26

2 files

0.4.25

2 files

0.4.24

2 files

0.4.23

2 files

0.4.22

2 files

0.4.21

2 files

0.4.20

2 files

0.4.19

2 files

0.4.18

2 files

0.4.17

2 files

0.4.16

2 files

0.4.15

2 files

0.4.14

2 files

0.2.0

2 files

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page