@yawlabs/postgres-mcp 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/index.js +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.6] - 2026-05-16
|
|
11
|
+
|
|
12
|
+
### Docs
|
|
13
|
+
- `pg_table_privileges` description now flags the visibility caveat:
|
|
14
|
+
`information_schema.table_privileges` is filtered by what the calling role
|
|
15
|
+
can see, so a least-privileged role may miss grants involving unrelated
|
|
16
|
+
third-party roles. Recommends superuser or `pg_read_all_data` for a
|
|
17
|
+
complete picture.
|
|
18
|
+
- `pg_inspect_locks` description now documents the row shape: one row per
|
|
19
|
+
(blocked_pid, blocking_pid) pair, so a session waiting on multiple
|
|
20
|
+
blockers appears on multiple rows. Suggests grouping by `blocked_pid`
|
|
21
|
+
for a per-blocked-session count.
|
|
22
|
+
|
|
23
|
+
## [0.6.5] - 2026-05-15
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- `pg_explain` now returns an explicit error if EXPLAIN comes back with zero
|
|
27
|
+
rows instead of a misleading `{plan: ""}` (text) or `{plan: undefined}`
|
|
28
|
+
(json) payload. Pathological in practice -- EXPLAIN always returns at least
|
|
29
|
+
one row -- but the response shape is now tight either way.
|
|
30
|
+
|
|
31
|
+
### Docs
|
|
32
|
+
- `pg_kill` description clarifies that `pg_signal_backend` does NOT authorize
|
|
33
|
+
signalling a superuser-owned backend; only a superuser can signal another
|
|
34
|
+
superuser's session. The `note` field already disambiguated post-hoc; the
|
|
35
|
+
description now matches.
|
|
36
|
+
|
|
10
37
|
## [0.6.3] - 2026-05-15
|
|
11
38
|
|
|
12
39
|
### Infrastructure
|
package/dist/index.js
CHANGED
|
@@ -36361,7 +36361,7 @@ var identSchema = external_exports.string().min(1).max(63).refine((v) => Buffer.
|
|
|
36361
36361
|
var adminTools = [
|
|
36362
36362
|
{
|
|
36363
36363
|
name: "pg_inspect_locks",
|
|
36364
|
-
description: "Show current lock contention: which sessions are blocked and who is blocking them. Returns blocked PID, blocking PID, lock types, relation being contested, and the queries involved. Use this first when a tool call hangs or the app feels stuck - it's the fastest way to identify a long-held transaction holding a lock.",
|
|
36364
|
+
description: "Show current lock contention: which sessions are blocked and who is blocking them. Returns blocked PID, blocking PID, lock types, relation being contested, and the queries involved. Use this first when a tool call hangs or the app feels stuck - it's the fastest way to identify a long-held transaction holding a lock. Row shape: one row per (blocked_pid, blocking_pid) pair. A session waiting on multiple blockers appears on multiple rows -- group/deduplicate by `blocked_pid` if you want a per-blocked-session count.",
|
|
36365
36365
|
annotations: {
|
|
36366
36366
|
title: "Inspect blocking locks",
|
|
36367
36367
|
readOnlyHint: true,
|
|
@@ -36447,7 +36447,7 @@ var adminTools = [
|
|
|
36447
36447
|
},
|
|
36448
36448
|
{
|
|
36449
36449
|
name: "pg_table_privileges",
|
|
36450
|
-
description: "Show which roles have which privileges (SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER) on a table or on every table in a schema. If `table` is omitted, the result spans every table in `schema`, ordered by table then grantee. Use this to answer 'who can write to this table?' or to audit schema-wide access before a migration.",
|
|
36450
|
+
description: "Show which roles have which privileges (SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER) on a table or on every table in a schema. If `table` is omitted, the result spans every table in `schema`, ordered by table then grantee. Use this to answer 'who can write to this table?' or to audit schema-wide access before a migration. Visibility caveat: backed by `information_schema.table_privileges`, which postgres filters by what the calling role can see. A least-privileged role may not see grants involving unrelated third-party roles. For a complete picture, run as a superuser or a member of `pg_read_all_data`.",
|
|
36451
36451
|
annotations: {
|
|
36452
36452
|
title: "Show table privileges",
|
|
36453
36453
|
readOnlyHint: true,
|
|
@@ -36480,7 +36480,7 @@ var adminTools = [
|
|
|
36480
36480
|
},
|
|
36481
36481
|
{
|
|
36482
36482
|
name: "pg_kill",
|
|
36483
|
-
description: "Cancel a running query (SIGINT-equivalent) or terminate a backend connection (SIGTERM-equivalent) by PID. Find the PID via `pg_health` active_queries or `pg_inspect_locks`. Requires ALLOW_WRITES=1 since this changes database session state. The role in DATABASE_URL must have permission - cancelling another user's query needs the `pg_signal_backend` role or superuser. Cancel is graceful; terminate is forceful.",
|
|
36483
|
+
description: "Cancel a running query (SIGINT-equivalent) or terminate a backend connection (SIGTERM-equivalent) by PID. Find the PID via `pg_health` active_queries or `pg_inspect_locks`. Requires ALLOW_WRITES=1 since this changes database session state. The role in DATABASE_URL must have permission - cancelling another user's query needs the `pg_signal_backend` role or superuser. Note: `pg_signal_backend` does NOT cover superuser-owned backends - only a superuser can signal another superuser's session. Cancel is graceful; terminate is forceful.",
|
|
36484
36484
|
annotations: {
|
|
36485
36485
|
title: "Cancel or terminate a backend",
|
|
36486
36486
|
readOnlyHint: false,
|
|
@@ -36833,6 +36833,9 @@ var explainTools = [
|
|
|
36833
36833
|
if (!result.ok) return result;
|
|
36834
36834
|
const data = result.data;
|
|
36835
36835
|
const rows = data?.rows ?? [];
|
|
36836
|
+
if (rows.length === 0) {
|
|
36837
|
+
return { ok: false, error: "EXPLAIN returned no rows; unable to produce a plan." };
|
|
36838
|
+
}
|
|
36836
36839
|
if (format === "text") {
|
|
36837
36840
|
const lines = rows.map((r) => String(r["QUERY PLAN"] ?? ""));
|
|
36838
36841
|
return { ok: true, data: { plan: lines.join("\n") } };
|
|
@@ -37547,7 +37550,7 @@ function compareVersions(a, b) {
|
|
|
37547
37550
|
}
|
|
37548
37551
|
|
|
37549
37552
|
// src/index.ts
|
|
37550
|
-
var version2 = true ? "0.6.
|
|
37553
|
+
var version2 = true ? "0.6.6" : (await null).createRequire(import.meta.url)("../package.json").version;
|
|
37551
37554
|
var subcommand = process.argv[2];
|
|
37552
37555
|
if (subcommand === "version" || subcommand === "--version") {
|
|
37553
37556
|
console.log(version2);
|
package/package.json
CHANGED