@achmadya-dev/mcp-postgres-query 0.2.0 → 0.2.2
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 +13 -16
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -32,36 +32,33 @@ Or use `envFile` instead of inline `env` (see [Cursor MCP docs](https://cursor.c
|
|
|
32
32
|
## Develop from source
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
|
|
35
|
+
git clone https://github.com/achmadya-dev/mcp-postgres-query.git
|
|
36
|
+
cd mcp-postgres-query
|
|
36
37
|
pnpm install
|
|
37
|
-
|
|
38
|
-
pnpm
|
|
38
|
+
pnpm run build
|
|
39
|
+
pnpm test
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
`.cursor/mcp.json`:
|
|
42
|
+
Open the repo root in Cursor. You need a reachable PostgreSQL instance — set connection env in `.cursor/mcp.json` or via `envFile`:
|
|
42
43
|
|
|
43
44
|
```json
|
|
44
45
|
{
|
|
45
46
|
"mcpServers": {
|
|
46
47
|
"postgres": {
|
|
47
48
|
"command": "node",
|
|
48
|
-
"args": ["${workspaceFolder}/
|
|
49
|
-
"
|
|
49
|
+
"args": ["${workspaceFolder}/dist/index.js"],
|
|
50
|
+
"env": {
|
|
51
|
+
"POSTGRES_HOST": "localhost",
|
|
52
|
+
"POSTGRES_PORT": "5432",
|
|
53
|
+
"POSTGRES_USER": "your_user",
|
|
54
|
+
"POSTGRES_PASSWORD": "your_password",
|
|
55
|
+
"POSTGRES_DATABASE": "your_database"
|
|
56
|
+
}
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
}
|
|
53
60
|
```
|
|
54
61
|
|
|
55
|
-
Relevant `.env` keys:
|
|
56
|
-
|
|
57
|
-
```env
|
|
58
|
-
POSTGRES_HOST=localhost
|
|
59
|
-
POSTGRES_PORT=5432
|
|
60
|
-
POSTGRES_USER=dev
|
|
61
|
-
POSTGRES_PASSWORD=devpassword
|
|
62
|
-
POSTGRES_DATABASE=devdb
|
|
63
|
-
```
|
|
64
|
-
|
|
65
62
|
## Environment variables
|
|
66
63
|
|
|
67
64
|
### Connection
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { runMcp } from "@achmadya-dev/mcp-core";
|
|
3
3
|
import packageJson from "../package.json" with { type: "json" };
|
|
4
4
|
import { postgres_ddl } from "./tools/postgres_ddl.js";
|
|
5
5
|
import { postgres_delete } from "./tools/postgres_delete.js";
|
|
6
6
|
import { postgres_insert } from "./tools/postgres_insert.js";
|
|
7
7
|
import { postgres_select } from "./tools/postgres_select.js";
|
|
8
8
|
import { postgres_update } from "./tools/postgres_update.js";
|
|
9
|
-
await
|
|
9
|
+
await runMcp({
|
|
10
10
|
name: "PostgreSQL Database",
|
|
11
11
|
version: packageJson.version,
|
|
12
|
+
transport: "stdio",
|
|
12
13
|
tools: [postgres_select, postgres_insert, postgres_update, postgres_delete, postgres_ddl],
|
|
13
14
|
});
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,CAAC;IACX,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,CAAC;CAC1F,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@achmadya-dev/mcp-postgres-query",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for PostgreSQL to run SQL queries via stdio (read-only by default)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "achmadya",
|
|
@@ -31,19 +31,20 @@
|
|
|
31
31
|
"node": ">=20"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@achmadya-dev/mcp-core": "^0.
|
|
34
|
+
"@achmadya-dev/mcp-core": "^0.6.0",
|
|
35
35
|
"pg": "8.13.1",
|
|
36
36
|
"zod": "4.3.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@changesets/cli": "2.29.8",
|
|
39
40
|
"@jest/globals": "30.4.1",
|
|
40
41
|
"@types/jest": "30.0.0",
|
|
41
42
|
"@types/node": "22.10.0",
|
|
42
43
|
"@types/pg": "8.11.10",
|
|
44
|
+
"husky": "9.1.7",
|
|
43
45
|
"jest": "30.4.2",
|
|
44
46
|
"ts-jest": "29.4.11",
|
|
45
|
-
"typescript": "5.7.2"
|
|
46
|
-
"@changesets/cli": "2.29.8"
|
|
47
|
+
"typescript": "5.7.2"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "tsc -p tsconfig.build.json",
|