
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
pgtriage
Advanced tools
MCP server for PostgreSQL performance auditing. Connect it to Claude Code (or any MCP client) and say "audit my database" to get actionable performance findings with exact fixes.
Not related to the pgAudit logging extension. pgtriage does performance triage, not compliance logging.
Built after diagnosing implicit type casts and missing indexes on multi-million-row tables in production fintech systems. The fixes were simple (one CREATE INDEX CONCURRENTLY statement each), but finding them required reading query plans most engineers never look at. pgtriage automates that diagnostic process and lets any AI client explain the results.
Any MCP Client (Claude Code / Cursor / Windsurf / VS Code)
| MCP (stdio)
v
pgtriage (data collection + pattern detection)
| psycopg3 (read-only)
v
PostgreSQL database
pgtriage connects to your PostgreSQL database and exposes performance auditing tools via the Model Context Protocol. It collects metrics from PostgreSQL system views, runs deterministic pattern detection, and returns structured findings. The MCP client provides the AI layer, interpreting results and explaining fixes in plain English.
No API keys required. No AI costs. No vendor lock-in. The intelligence comes from your MCP client.
{
"severity": "high",
"category": "connection_pressure",
"detail": "Connection utilization at 104% (104/100). Approaching max_connections limit.",
"suggested_fix": "Consider using a connection pooler (PgBouncer) or increasing max_connections if RAM allows.",
"evidence": {
"total_connections": 104,
"max_connections": 100,
"utilization_pct": 104.0
}
}
{
"severity": "medium",
"category": "duplicate_index",
"table": "account",
"detail": "Duplicate indexes on 'account': 'account_title_reverse_index' (16 kB) and 'account_group_reverse_index' (16 kB). Same column definition. One can be dropped.",
"suggested_fix": "DROP INDEX CONCURRENTLY account_group_reverse_index;"
}
From a real audit: 118 tables scanned, 88 findings, prioritized by severity.
pip install pgtriage
Add to your MCP settings (.claude/settings.json or project settings):
{
"mcpServers": {
"pgtriage": {
"command": "python",
"args": ["-m", "pgtriage"],
"env": {
"PGTRIAGE_CONNECTION_STRING": "postgres://user:pass@localhost:5432/dbname"
}
}
}
}
Recommended: Use a dedicated read-only database role:
CREATE ROLE pgtriage_reader LOGIN PASSWORD 'secure_password';
GRANT pg_read_all_stats TO pgtriage_reader;
GRANT USAGE ON SCHEMA public TO pgtriage_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO pgtriage_reader;
> audit my database
> check table health for the users table
> are there any unused indexes?
> review my PostgreSQL configuration
> find slow queries
full_auditRun a comprehensive performance audit covering table health, slow queries, index health, and configuration. Returns all findings sorted by severity.
check_table_healthAnalyze dead tuples, autovacuum stats, sequential scan ratios, and TOAST bloat. Optionally filter to a specific table.
analyze_slow_queriesPull the slowest queries from pg_stat_statements, run EXPLAIN ANALYZE on each, and detect patterns like sequential scans, stale statistics, and N+1 queries.
check_index_healthFind unused indexes (zero scans), duplicate indexes (same column definition), and tables that likely need indexes based on scan patterns.
check_configReview PostgreSQL settings (shared_buffers, work_mem, autovacuum_vacuum_scale_factor, random_page_cost, etc.) and flag suboptimal values. Checks connection utilization and long-running queries.
| Resource | Description |
|---|---|
pgtriage://status | Connection status, PostgreSQL version, loaded extensions |
pgtriage://tables | All tables with sizes and approximate row counts |
pg_stat_statements extension (recommended for slow query analysis, not required for other tools)pg_stat_* viewspgtriage never writes to your database. Three independent layers enforce this:
SET default_transaction_read_only = true on every connection. PostgreSQL rejects any write attempt at the server level.statement_timeout. Even if layers 1 and 2 somehow fail, nothing is committed and long-running queries are killed.Additionally:
git clone https://github.com/pgtriage/pgtriage.git
cd pgtriage
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
MIT
FAQs
MCP server for PostgreSQL performance auditing
The pypi package pgtriage receives a total of 26 weekly downloads. As such, pgtriage popularity was classified as not popular.
We found that pgtriage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.