@sarmadparvez/postgresql-mcp 1.0.5 → 1.0.7
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 +43 -20
- package/package.json +19 -3
package/README.md
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
# postgresql-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@sarmadparvez/postgresql-mcp)
|
|
4
|
+
[](https://www.npmjs.com/package/@sarmadparvez/postgresql-mcp)
|
|
5
|
+
[](https://opensource.org/licenses/ISC)
|
|
6
|
+
|
|
7
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for PostgreSQL with full read-write support, atomic transactions, and schema inspection. Works with **Claude Desktop**, **Cursor**, **Windsurf**, and any MCP-compatible AI client.
|
|
8
|
+
|
|
9
|
+
Connect any PostgreSQL database — **local**, **Supabase**, **AWS RDS**, or **self-hosted** — to your AI assistant in seconds.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Full read-write SQL access (`SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`)
|
|
14
|
+
- Atomic multi-statement transactions with automatic rollback on failure
|
|
15
|
+
- Schema inspection: columns, types, nullability, defaults, primary keys
|
|
16
|
+
- Optional read-only mode via `?mode=readonly`
|
|
17
|
+
- No cloud lock-in — works with any standard PostgreSQL connection string
|
|
18
|
+
- Single file, minimal dependencies
|
|
4
19
|
|
|
5
20
|
## Why this exists
|
|
6
21
|
|
|
@@ -74,30 +89,30 @@ First, install the package globally:
|
|
|
74
89
|
npm install -g @sarmadparvez/postgresql-mcp
|
|
75
90
|
```
|
|
76
91
|
|
|
77
|
-
Then find the paths to node and the installed
|
|
92
|
+
Then find the paths to `node` and the installed script:
|
|
78
93
|
|
|
79
94
|
```bash
|
|
80
|
-
which node
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
which node
|
|
96
|
+
# e.g. /usr/local/bin/node
|
|
97
|
+
# nvm users: /Users/yourname/.nvm/versions/node/v22.12.0/bin/node
|
|
83
98
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
> # Find the installed script
|
|
89
|
-
> ls $(npm root -g)/@sarmadparvez/postgresql-mcp/index.js
|
|
90
|
-
> ```
|
|
99
|
+
npm root -g
|
|
100
|
+
# e.g. /usr/local/lib/node_modules
|
|
101
|
+
# nvm users: /Users/yourname/.nvm/versions/node/v22.12.0/lib/node_modules
|
|
102
|
+
```
|
|
91
103
|
|
|
92
104
|
Add this to your `claude_desktop_config.json`:
|
|
93
105
|
|
|
94
|
-
|
|
106
|
+
- Replace `command` with the output of `which node`
|
|
107
|
+
- Replace the prefix of the script path with the output of `npm root -g` — the suffix `/@sarmadparvez/postgresql-mcp/index.js` stays the same
|
|
108
|
+
|
|
95
109
|
```json
|
|
96
110
|
{
|
|
97
111
|
"mcpServers": {
|
|
98
112
|
"postgres": {
|
|
99
|
-
"command": "/
|
|
113
|
+
"command": "/usr/local/bin/node",
|
|
100
114
|
"args": [
|
|
115
|
+
"/usr/local/lib/node_modules/@sarmadparvez/postgresql-mcp/index.js",
|
|
101
116
|
"postgresql://user:pass@localhost:5432/mydb"
|
|
102
117
|
]
|
|
103
118
|
}
|
|
@@ -105,22 +120,30 @@ Add this to your `claude_desktop_config.json`:
|
|
|
105
120
|
}
|
|
106
121
|
```
|
|
107
122
|
|
|
108
|
-
|
|
123
|
+
For read-only access, append `?mode=readonly` to the connection string:
|
|
124
|
+
|
|
109
125
|
```json
|
|
110
126
|
{
|
|
111
127
|
"mcpServers": {
|
|
112
|
-
"postgres": {
|
|
113
|
-
"command": "/
|
|
128
|
+
"postgres-readonly": {
|
|
129
|
+
"command": "/usr/local/bin/node",
|
|
114
130
|
"args": [
|
|
115
|
-
"/
|
|
116
|
-
"postgresql://user:pass@localhost:5432/mydb"
|
|
131
|
+
"/usr/local/lib/node_modules/@sarmadparvez/postgresql-mcp/index.js",
|
|
132
|
+
"postgresql://user:pass@localhost:5432/mydb?mode=readonly"
|
|
117
133
|
]
|
|
118
134
|
}
|
|
119
135
|
}
|
|
120
136
|
}
|
|
121
137
|
```
|
|
122
138
|
|
|
123
|
-
|
|
139
|
+
## Compatible AI Clients
|
|
140
|
+
|
|
141
|
+
This MCP server works with any client that supports the Model Context Protocol:
|
|
142
|
+
|
|
143
|
+
- [Claude Desktop](https://claude.ai/download) (Anthropic)
|
|
144
|
+
- [Cursor](https://www.cursor.com)
|
|
145
|
+
- [Windsurf](https://windsurf.com)
|
|
146
|
+
- Any other MCP-compatible client
|
|
124
147
|
|
|
125
148
|
## Dependencies
|
|
126
149
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarmadparvez/postgresql-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "MCP server for PostgreSQL with full read-write support. Works with any PostgreSQL instance — local, Supabase, RDS, or self-hosted.",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "MCP server for PostgreSQL with full read-write support, transactions, and schema inspection. Works with any PostgreSQL instance — local, Supabase, AWS RDS, or self-hosted. Use with Claude, Cursor, Windsurf, and any MCP-compatible AI client.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"postgresql-mcp": "./index.js"
|
|
@@ -14,12 +14,28 @@
|
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"mcp",
|
|
17
|
+
"mcp-server",
|
|
17
18
|
"model-context-protocol",
|
|
18
19
|
"postgresql",
|
|
19
20
|
"postgres",
|
|
21
|
+
"database",
|
|
22
|
+
"sql",
|
|
20
23
|
"ai",
|
|
21
24
|
"claude",
|
|
22
|
-
"
|
|
25
|
+
"cursor",
|
|
26
|
+
"windsurf",
|
|
27
|
+
"llm",
|
|
28
|
+
"supabase",
|
|
29
|
+
"rds",
|
|
30
|
+
"aws-rds",
|
|
31
|
+
"read-write",
|
|
32
|
+
"transactions",
|
|
33
|
+
"schema",
|
|
34
|
+
"anthropic",
|
|
35
|
+
"tool-use",
|
|
36
|
+
"ai-tools",
|
|
37
|
+
"postgres-mcp",
|
|
38
|
+
"postgresql-mcp"
|
|
23
39
|
],
|
|
24
40
|
"author": "sarmadparvez",
|
|
25
41
|
"license": "ISC",
|