Skip to content

Commit 7eb2390

Browse files
authored
update readme to fix docker (#40)
* update readme to fix docker * prioritize docker
1 parent f79b522 commit 7eb2390

File tree

1 file changed

+38
-49
lines changed

1 file changed

+38
-49
lines changed

README.md

Lines changed: 38 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,34 @@ Postgres Pro includes an expanding set of tools covering several areas:
7272

7373
Before getting started, ensure you have:
7474
1. Access credentials for your database.
75-
2. Python 3.12 or higher *or* Docker.
75+
2. Docker *or* Python 3.12 or higher.
76+
7677
#### Access Credentials
7778
You can confirm your access credentials are valid by using `psql` or a GUI tool such as [pgAdmin](https://www.pgadmin.org/).
7879

7980

80-
#### Python or Docker
81+
#### Docker or Python
8182

8283
The choice to use Docker or Python is yours.
83-
We generally recommend using whichever is most familiar to you.
84+
We generally recommend Docker because Python users can encounter more environment-specific issues.
85+
However, it often makes sense to use whichever method you are most familiar with.
8486

8587

8688
### Installation
8789

8890
Choose one of the following methods to install Postgres Pro:
8991

90-
#### Option 1: Using Python
92+
#### Option 1: Using Docker
93+
94+
Pull the Postgres Pro MCP server Docker image.
95+
This image contains all necessary dependencies, providing a reliable way to run Postgres Pro in a variety of environments.
96+
97+
```bash
98+
docker pull crystaldba/postgres-mcp
99+
```
100+
101+
102+
#### Option 2: Using Python
91103

92104
If you have `pipx` installed you can install Postgres Pro with:
93105

@@ -103,14 +115,6 @@ uv pip install postgres-mcp
103115

104116
If you need to install `uv`, see the [uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/).
105117

106-
#### Option 2: Using Docker
107-
108-
Pull the Postgres Pro MCP server Docker image.
109-
This image contains all necessary dependencies, providing a reliable way to run Postgres Pro in a variety of environments.
110-
111-
```bash
112-
docker pull crystaldba/postgres-mcp
113-
```
114118

115119
### Configure Your AI Assistant
116120

@@ -128,14 +132,20 @@ You can also use `Settings` menu item in Claude Desktop to locate the configurat
128132

129133
You will now edit the `mcpServers` section of the configuration file.
130134

131-
##### If you are using `pipx`
135+
##### If you are using Docker
132136

133137
```json
134138
{
135139
"mcpServers": {
136140
"postgres": {
137-
"command": "postgres-mcp",
141+
"command": "docker",
138142
"args": [
143+
"run",
144+
"-i",
145+
"--rm",
146+
"-e",
147+
"DATABASE_URI",
148+
"crystaldba/postgres-mcp",
139149
"--access-mode=unrestricted"
140150
],
141151
"env": {
@@ -146,16 +156,20 @@ You will now edit the `mcpServers` section of the configuration file.
146156
}
147157
```
148158

149-
##### If you are using `uv`
159+
The Postgres Pro Docker image will automatically remap the hostname `localhost` to work from inside of the container.
160+
161+
- MacOS/Windows: Uses `host.docker.internal` automatically
162+
- Linux: Uses `172.17.0.1` or the appropriate host address automatically
163+
164+
165+
##### If you are using `pipx`
150166

151167
```json
152168
{
153169
"mcpServers": {
154170
"postgres": {
155-
"command": "uv",
171+
"command": "postgres-mcp",
156172
"args": [
157-
"run",
158-
"postgres-mcp",
159173
"--access-mode=unrestricted"
160174
],
161175
"env": {
@@ -166,19 +180,17 @@ You will now edit the `mcpServers` section of the configuration file.
166180
}
167181
```
168182

169-
##### If you are using Docker
183+
184+
##### If you are using `uv`
170185

171186
```json
172187
{
173188
"mcpServers": {
174189
"postgres": {
175-
"command": "docker",
190+
"command": "uv",
176191
"args": [
177192
"run",
178-
"--rm",
179-
"-e",
180-
"DATABASE_URI",
181-
"crystaldba/postgres-mcp",
193+
"postgres-mcp",
182194
"--access-mode=unrestricted"
183195
],
184196
"env": {
@@ -189,34 +201,11 @@ You will now edit the `mcpServers` section of the configuration file.
189201
}
190202
```
191203

192-
The Postgres Pro Docker image will automatically remap the hostname `localhost` to work from inside of the container.
193-
194-
- MacOS/Windows: Uses `host.docker.internal` automatically
195-
- Linux: Uses `172.17.0.1` or the appropriate host address automatically
196-
197204

198205
##### Connection URI
199206

200207
Replace `postgresql://...` with your [Postgres database connection URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS).
201208

202-
You can also use `psql`-style connection parameters:
203-
204-
```json
205-
{
206-
"mcpServers": {
207-
"postgres": {
208-
"command": "postgres-mcp",
209-
"args": [
210-
"-h", "localhost",
211-
"-p", "5432",
212-
"-U", "username",
213-
"-d", "dbname",
214-
"--access-mode=unrestricted"
215-
]
216-
}
217-
}
218-
}
219-
```
220209

221210
##### Access Mode
222211

@@ -314,7 +303,7 @@ Postgres Pro Tools:
314303

315304
**Postgres MCP Servers**
316305
- [Query MCP](https://github.com/alexander-zuev/supabase-mcp-server). An MCP server for Supabase Postgres with a three-tier safety architecture and Supabase management API support.
317-
- [PG-MCP](https://github.com/stuzero/pg-mcp). An MCP server for PostgreSQL with flexible connection options, explain plans, extension context, and more.
306+
- [PG-MCP](https://github.com/stuzero/pg-mcp-server). An MCP server for PostgreSQL with flexible connection options, explain plans, extension context, and more.
318307
- [Reference PostgreSQL MCP Server](https://github.com/modelcontextprotocol/servers/tree/main/src/postgres). A simple MCP Server implementation exposing schema information as MCP resources and executing read-only queries.
319308
- [Supabase Postgres MCP Server](https://github.com/supabase-community/supabase-mcp). This MCP Server provides Supabase management features and is actively maintained by the Supabase community.
320309
- [Nile MCP Server](https://github.com/niledatabase/nile-mcp-server). An MCP server providing access to the management API for the Nile's multi-tenant Postgres service.
@@ -483,7 +472,7 @@ We remain open to revising this decision in the future.
483472
Like the [Reference PostgreSQL MCP Server](https://github.com/modelcontextprotocol/servers/tree/main/src/postgres), Postgres Pro takes Postgres connection information at startup.
484473
This is convenient for users who always connect to the same database but can be cumbersome when users switch databases.
485474

486-
An alternative approach, taken by [PG-MCP](https://github.com/stuzero/pg-mcp), is provide connection details via MCP tool calls at the time of use.
475+
An alternative approach, taken by [PG-MCP](https://github.com/stuzero/pg-mcp-server), is provide connection details via MCP tool calls at the time of use.
487476
This is more convenient for users who switch databases, and allows a single MCP server to simultaneously support multiple end-users.
488477

489478
There must be a better approach than either of these.

0 commit comments

Comments
 (0)