postgres-mcp-safe 0.1.1 → 0.1.3
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/README.md +7 -1
- package/bin/postgres-mcp-safe.js +2 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -5,7 +5,9 @@ A drop-in replacement for the deprecated `@modelcontextprotocol/server-postgres`
|
|
|
5
5
|
Lets AI tools (Claude, Cursor, Zed, ...) query a Postgres database, read its schema and explain queries. Swap the
|
|
6
6
|
package name in your MCP config and keep everything else.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/postgres-mcp-safe) [](https://github.com/Poudel0/postgres-mcp-safe/actions/workflows/ci.yml)
|
|
9
|
+
|
|
10
|
+
[](https://mcprush.com/to/postgres-read-only-safe-mcp?ref=badge)
|
|
9
11
|
|
|
10
12
|
## Migrating from server-postgres
|
|
11
13
|
|
|
@@ -49,6 +51,10 @@ Flags go **before** the URL.
|
|
|
49
51
|
| `--allow-explain-analyze` | off | Lets `explain` run `EXPLAIN ANALYZE`, which executes the query. |
|
|
50
52
|
| `--allow-superuser` | off | Allows a superuser role, or a member of one. Read-only is then **not** guaranteed. |
|
|
51
53
|
|
|
54
|
+
Each call opens a fresh connection (that's part of the safety model). Against a remote database over TLS that costs a
|
|
55
|
+
few round trips: about 0.5 s per call at 50 ms latency. On Postgres 17+ you can save one round trip by adding
|
|
56
|
+
`sslnegotiation=direct` to the URL.
|
|
57
|
+
|
|
52
58
|
Limits can't be turned off; `0` is an error. The URL can also be a keyword DSN (`host=db dbname=app`), and the
|
|
53
59
|
standard `PG*` environment variables (`PGPASSWORD`, ...) are read as libpq would.
|
|
54
60
|
|
package/bin/postgres-mcp-safe.js
CHANGED
|
@@ -14,7 +14,8 @@ try {
|
|
|
14
14
|
console.error(
|
|
15
15
|
`postgres-mcp-safe: no binary for ${process.platform}-${process.arch} (${pkg} is not installed).\n` +
|
|
16
16
|
"Supported: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64. " +
|
|
17
|
-
"
|
|
17
|
+
"npm skips this package silently if it can't fetch it, and npx then caches the broken install.\n" +
|
|
18
|
+
"Fix: reinstall without --no-optional / --omit=optional, or for npx clear its cache (rm -rf ~/.npm/_npx) and retry.",
|
|
18
19
|
);
|
|
19
20
|
process.exit(1);
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postgres-mcp-safe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Drop-in replacement for @modelcontextprotocol/server-postgres that is actually read-only.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"node": ">=18"
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"postgres-mcp-safe-linux-
|
|
31
|
-
"postgres-mcp-safe-
|
|
32
|
-
"postgres-mcp-safe-darwin-
|
|
33
|
-
"postgres-mcp-safe-
|
|
34
|
-
"postgres-mcp-safe-win32-x64": "0.1.
|
|
30
|
+
"postgres-mcp-safe-linux-x64": "0.1.3",
|
|
31
|
+
"postgres-mcp-safe-darwin-x64": "0.1.3",
|
|
32
|
+
"postgres-mcp-safe-darwin-arm64": "0.1.3",
|
|
33
|
+
"postgres-mcp-safe-linux-arm64": "0.1.3",
|
|
34
|
+
"postgres-mcp-safe-win32-x64": "0.1.3"
|
|
35
35
|
}
|
|
36
36
|
}
|