Database · 2 skills
PostgreSQL MCP and Claude skills
Run read-only SQL against PostgreSQL for business numbers and database health: signups, slow queries, dead tuples, connections and size growth.
Connect PostgreSQL to your agent (MCP)
- MCP server. The PostgreSQL project doesn't publish an MCP server, and the reference Postgres server from the MCP project has been archived. A common community choice is Postgres MCP Pro (
postgres-mcp), whose--access-mode=restrictedruns every statement in a read-only transaction with a time limit:claude mcp add --env DATABASE_URI=postgresql://report_reader:<password>@db.example.com:5432/app --transport stdio postgres -- uvx postgres-mcp --access-mode=restricted. In Codex and Cursor, put the same command, arguments andDATABASE_URIin the server config. Managed hosts such as Supabase and Neon run their own MCP servers. psqlwith a connection string. Claude Code and Codex can runpsql "$DATABASE_URL" -X -A -F ',' -c "SELECT ..."directly; it needs only the client and the URL.- A read-only role, used by both:
CREATE ROLE report_reader LOGIN PASSWORD '...',GRANT CONNECT ON DATABASE app TO report_reader, thenGRANT pg_read_all_data, pg_monitor TO report_readeron Postgres 14 and later (on older versions, grantUSAGEon the schema andSELECTon its tables). AddALTER ROLE report_reader SET default_transaction_read_only = onandALTER ROLE report_reader SET statement_timeout = '30s'.
The role is the safeguard that holds whichever tool connects: with only read privileges it can't write, alter or drop anything, pg_monitor lets it see the statistics views, and the timeout stops a runaway query. Point it at a read replica if you have one.
2 PostgreSQL skills
Postgres daily metrics from your own tables
Every morning: one number from a saved SQL query against your Postgres database, such as signups or orders, with the change since the day before.
FoundersEvery day at 8:00Stat tileUses PostgreSQL.Pages that earn sign-ups: Search Console, GA4 and your sign-ups
Every Monday: organic clicks, GA4 sessions and real sign-ups for each landing page, joined on the URL, with the pages to push and the pages to fix.
SEOMondays at 9:00Report cardUses Google Search Console, Google Analytics, Supabase, PostgreSQL, Stripe.What agents do with PostgreSQL
With a connection string, an agent answers two kinds of questions. Business ones come from your own tables: new signups per day, orders, active accounts, rows created since yesterday. Health ones come from Postgres's statistics views. pg_stat_statements (from the extension of the same name) ranks queries by total_exec_time, mean_exec_time and calls; pg_stat_activity shows sessions with their state, query_start and wait_event, so long-running and idle-in-transaction sessions stand out; pg_stat_user_tables gives n_live_tup, n_dead_tup, seq_scan and last_autovacuum; and pg_database_size() and pg_total_relation_size() track growth.
Teams schedule a daily metrics post from a few saved queries, a weekly list of the slowest queries, tables with many dead tuples or no recent autovacuum, connections against max_connections, and database size against last month.
Often used with PostgreSQL
Teams that use these
Your PostgreSQL numbers, on one board with everything else
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.