Version 0.1.0. An MCP (Model Context Protocol) server that automatically logs all INSERT, UPDATE, and DELETE operations in a PostgreSQL database and exposes the log to AI coding agents via MCP tools. Unlike manual database introspection, it sets up audit triggers on all tracked tables once, then lets agents query recent row changes without writing SQL. Currently requires Node >=20 and Postgres >=13. Ships four tools: setup_activity_logging, refresh_activity_triggers, get_recent_db_changes, and summarize_recent_db_changes. Not yet stable; API and trigger behavior may change between minor versions.
npm install postgres-activity-mcpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Add the MCP server to your client configuration (e.g., Claude Desktop or custom MCP client), pointing to your local Postgres.
Use a superuser for local development, or grant the necessary permissions manually.
Manually drop triggers on tables you don't want to track, or configure tracked schemas in the tool call.
Upgrade Postgres to 13+ or stay on 0.1.0 with an older trigger function and manual adjustment.
Test on your schema; file issues on GitHub if triggers fail silently.
After upgrading the MCP server, always re-run setup_activity_logging to get the latest trigger function.
Grant CREATE on schema: GRANT CREATE ON SCHEMA public TO your_user;
Check DATABASE_URL connection string and that the database is running.
Run setup_activity_logging tool again to (re)create the function.