🛠️ IndieKit

I Ported Python's Best PostgreSQL Tools to TypeScript

2026-07-03 · 9 分钟阅读 · PostgreSQL, TypeScript, Open Source, MCP, Developer Tools

Python has excellent PostgreSQL tooling — schemainspect, migra, pg_activity. TypeScript has... not much. So I ported them.

The Problem

If you're a Node/TS developer working with PostgreSQL, your options are:

Python developers have had elegant solutions for years. TypeScript developers deserve the same.

What I Built

pg-toolkit — a unified CLI and SDK that brings 5 PostgreSQL tools together:

  1. doctor — 20+ health checks with scoring and auto-generated fix SQL
  2. inspect — Full schema inspection (tables, views, functions, indexes, enums, triggers, RLS...)
  3. diff — Compare two databases, generate migration SQL (ALTER/CREATE/DROP)
  4. top — Real-time activity monitor (like pg_activity but in your terminal)
  5. types — Generate TypeScript types from your database schema

One npx command. No Python. No Docker. No config files.

The Interesting Part: Porting Decisions

schemainspect → pg-inspect

migra → pg-diff

pg_activity → pg-top

Why Not Just Use the Python Originals?

Fair question. If you're already in a Python environment, those tools are great. But:

  1. Your deploy pipeline is probably Node-based — adding Python just for DB tools is friction
  2. Programmatic accessimport { doctor } from '@indiekitai/pg-toolkit' works in your existing codebase
  3. MCP support — Every tool works as an MCP server, so AI agents (Claude, Cursor) can inspect and diagnose your database directly
  4. Single dependency — One npm install instead of managing Python virtualenvs

The MCP Angle

This is what I'm most excited about. Every tool in pg-toolkit exposes an MCP server. Your AI coding agent can:

Not "AI-powered" (no LLMs inside). Just well-structured tools that AI agents can use.

Numbers

Try It

npx @indiekitai/pg-toolkit doctor postgres://localhost/mydb

GitHub: https://github.com/indiekitai/pg-toolkit · npm: https://www.npmjs.com/package/@indiekitai/pg-toolkit


Feedback welcome. This is v0.2 — rough edges exist.